jface

SWT Combo and CCombo as CellEditor

拈花ヽ惹草 提交于 2019-12-08 17:27:35
Why is the last item blank? I only have 3 items (it's a tri-state boolean editor). Can a CCombo achieve this solid Combo look and feel? As a combo cell editor, I would prefer the regular Combo , BUT: Can this Combo be used as CellEditor , while fitting the table row height? (maybe making the Font smaller?) The default visible item count for CCombo is 5, try calling setVisibleItemCount(3) . CCombo does not support much customization. It always sets the same colors for the list and the text for example. The look of Combo varies a lot between platforms, the Mac version might look odd in a table

Is it possible to make jFace TreeViewer specific node support bold font for its LabelProvider?

穿精又带淫゛_ 提交于 2019-12-08 09:41:54
问题 I'm developing a tree based on TreeViewer and created myLabelProvider which extends LabelProvider and then use viewer.setLabelProvider(new ViewLabelProvider()); , but all the nodes are still displayed with normal plain style. Code: class ViewLabelProvider extends LabelProvider implements ITableLabelProvider, ITableFontProvider{ public String getText(Object obj) { return obj.toString(); } public Image getImage(Object obj) { return null; } public Font getFont(Object element, int columnIndex) {

Sorting of tree implemented with NatTable

不打扰是莪最后的温柔 提交于 2019-12-08 04:08:50
问题 I'm trying to implement sorting of tree implemented with NatTable but I can't really understand how it works. My problem is that after the sorting of any column other than 'tree' column child nodes can move to invalid parent. Though the order of elements is correct on all levels of hierarchy. So basically I don't understand the purpose of TreeList.Format.getComparator() and how it related to comparators registred for the columns, and I don't understand when and why node can change its parent.

How can I create a checkbox in a TableViewer of JFace?

回眸只為那壹抹淺笑 提交于 2019-12-08 02:04:29
问题 I have created a tableViewer with two columns and I want to make one of them a checkbox. To do that I have created a CheckBoxCellEditor, but I don´t know why it isn´t working. The column called tableName displays it´s values OK. The column specification is the following. String[] COLUMN_HEADINGS = {"Select", "Table name"}; TableColumnLayout tableLayout = new TableColumnLayout(); parent.setLayout(tableLayout); //Set what would display each column TableViewerColumn selectCheckBox =

ColumnViewerTooltipSupport in SWT

↘锁芯ラ 提交于 2019-12-07 19:09:21
问题 What is the exact use of ColumnViewerTooltipSupport ? I know that it provides tooltip support for ColumnViewers but does it mean that it provides tooltip for treeViewers? How can I use this feature to provide tooltip support individually different tooltips for my each tree item when the mouse hovers over each item? Do I require a MouseListener for this or does the ColumnViewerTooltipSupport class provide it by default? Can someone please help me out here as I'm relatively new to SWT concepts.

Highlight particular string in SWT Tree node

隐身守侯 提交于 2019-12-07 18:14:19
问题 I have a requirement like first of all tree will be loaded, tree contains 4 levels. There is a text field, where user can enter "filterText" and he can press search button. In tree, in any of four levels if there is a match with filter text, then that particular string only should be highlighted with yellow color but not whole node and its corresponding tree will be expanded. Unmatched tree nodes should not expand. 回答1: I assume you are using TreeViewer . You can use a StyledCellLabelProvider

Items decorations in a TreeViewer

拥有回忆 提交于 2019-12-07 08:21:50
问题 I have the following problem: I'm preparing an editor in Eclipse and one of the tab contains TreeViewer to show items in the tree. Each item has a name and a value, which is editable. The problem I need to indicate to user that value is incorrect (e.g. exceeds a given range). My idea is to decorate incorrect cells with a warning or error icon which will be shown also after editing is complete. Does anybody have an idea how to decorate items in the tree? I was experimenting with

How to always show vertical scroll bar in SWT table?

懵懂的女人 提交于 2019-12-07 08:10:37
问题 Is it possible to always show the vertical scroll bar in a SWT table even if the table is empty? By always showing a (possible disabled) vertical scroll bar one can avoid that the last column get partially hidden when the columns use ColumnWeightData for layouting. I tried to initialize the table with SWT.V_SCROLL or to use table.getVerticalBar().setVisible(true) - both without success. There is a method setAlwaysShowScrollBars in ScrollableComposite . What I am looking for is a similar

Using a ILightweightLabelDecorator decorator

坚强是说给别人听的谎言 提交于 2019-12-07 05:09:34
问题 Having implemented one of the above, can anyone say how I might wire it up directly to a viewer? None of the usual sources explain. Martin. 回答1: As far as I can tell you need an ILabelDecorator and the only easy way to get one is to use the workbench UI: viewer.setLabelProvider( new DecoratingLabelProvider(new MyPlainLabelProvider(), PlatformUI.getWorkbench().getDecoratorManager().getLabelDecorator())); You then need to add your lightweight decorator to the decorators extension point in the

JFace ErrorDialog: how do I show something in the details portion?

≯℡__Kan透↙ 提交于 2019-12-07 04:23:27
问题 ErrorDialog.openError takes arguments for dialog title, message, and status (which has a message itself). I want to show the exception's message in the main area, and the call stack in the details area. However, both of these variations show the call stack in the main area: void showException(Throwable e) { Status status = new Status(IStatus.ERROR, "SCS Admin", e.getLocalizedMessage(), e); e.printStackTrace; ErrorDialog.openError(getShell(), null, Util.getStackTrace(e), status); } void