OwnerDrawLabelProvider is in the org.eclipse.jface plugin. The org.eclipse.rap.xxxx plugins you reference are part of Eclipse RAP not the core Eclipse JFace/SWT code....
eclipse,eclipse-plugin,eclipse-rcp,jface
Couple of changes solved the problem : When you are updating your view from a Non UI thread use : Display.getDefault().asyncExec(new Runnable() { public void run() { IWorkbenchWindow iw = PlatformUI.getWorkbench().getActiveWorkbenchWindow(); try { view = (BrowserView) iw.getActivePage().showView( "com.he.reportLayer.views.BrowserView"); view.getBrowserInstance().setUrl(url); } catch (PartInitException e) { e.printStackTrace(); } // System.out.println("View >>" +...
The readLine method of BufferedReader does not include the line endings in the text it returns. So you need to add a new line when you add the text to StyledText: editor.append(str); editor.append('\n'); ...
Override the configureShell method and set the minimum size there: @Override protected void configureShell(Shell newShell) { super.configureShell(newShell); newShell.setMinimumSize(100, 100); } ...
java,user-interface,checkbox,swt,jface
The shell.pack() call recomputes the size of the shell to make it fit the contents. To restrict the size of the table you need to specify a height hint on the table: GridData gridData = new GridData(SWT.FILL, SWT.TOP, true, false, 3, 1); gridData.heightHint = 400; // Vertical size you want...
Some menu items such as Copy and Paste you have to write yourself as Eclipse does not know how you want to copy your view objects. The 'Run As' menu item should appear at the IWorkbenchActionConstants.MB_ADDITIONS position in the menu, but only if the view item enablement is correct. For...
The CheckboxTableViewer uses a separate ICheckStateProvider to set the check boxes. Set with viewer.setCheckStateProvider(checkStateProvider); The provider has two methods isChecked and isGrayed. The values passed to these methods are the objects from your content provider. Alternatively CheckboxTableViewer has setChecked, setAllChecked, ... methods. ...
java,eclipse-plugin,eclipse-rcp,jface
All the source code for this TreeViewer example is available in the link given in the 'Source Code' section at the start of the article. The link is http://www.eclipse.org/articles/Article-TreeViewer/cbg.article.treeviewer.zip...
ColumnViewerToolTipSupport adds support for individual tooltips to TableViewer and TreeViewer (and other ColumnViewers), you enable this using: ColumnViewerToolTipSupport.enableFor(viewer); The support expects that the label provider(s) for the viewer are based on CellLabelProvider (or one of its subclasses). CellLabelProvider has getToolTipImage, getToolTipText, getToolTipBackgroundColor, getToolTipForegroundColor, getToolTipFont and getToolTipShift methods that you can...
we can extend eclipse decoration extension point to provide custom label. <extension point="org.eclipse.ui.decorators"> <decorator id="YourDecorator" label="Decorator Label" state="false" class="YourDecorator.class" objectClass="org.eclipse.core.resources.IResource" adaptable="true"> </decorator> </extension> for more info visit the following link : :https://eclipse.org/articles/Article-Decorators/decorators.html ...
java,model-view-controller,jface
Each row in a table uses a single object provided by your content provider. So if you need values from different objects you will need return a composite class containing those objects from the content provider....
Eclipse 4 (e4) applications are completely different from traditional Eclipse 3.x style applications. In an e4 application you cannot use a lot of things that are used in a Eclipse 3.x application - so you need to check which style the example you are using is based on. The e4...
eclipse,swt,eclipse-rcp,jface,eclipse-pde
You could use the Display.addFilter method to listen for all SWT.Activate events which will tell you about all Shells (and other things) being activated. You can then detect the shells you want to close. Something like: Display.getDefault().addFilter(SWT.Activate, new Listener() { @Override public void handleEvent(final Event event) { // Is this...
I've managed to solve this issue by going back to square one and re-implementing in the most generic fashion I could find documented. I.e.: I've added a proper LabelProvider (and got rid of the ColumnLabelProvider), set a simple GridData layout data object to the table (and otherwise haven't messed with...
You can use DecoratingStyledCellLabelProvider which takes an IStyledLabelProvider and an ILabelDecorator as parameters: new DecoratingStyledCellLabelProvider(styledLabelProvider, PlatformUI.getWorkbench().getDecoratorManager() .getLabelDecorator(), null); ...
java,swt,jface,rcp,tableviewer
That is how ComboBoxCellEditor is designed to work. The internal method applyEditorValueAndDeactivate is only called on Tab, Enter, and focus lost. None of this behavior looks easy to modify other than by writing your own version of the class (which is not large)....
table,eclipse-plugin,swt,text-editor,jface
The IDocument used by the TextEditor gives you access to the document contents. Get this with something like: IDocumentProvider provider = editor.getDocumentProvider(); IEditorInput input = editor.getEditorInput(); IDocument document = provider.getDocument(input); IDocument has many methods for accessing lines such as: int getLineOffset(int line); int getLineLength(int line); and methods for modify the...
I can observe the issue that you describe on Windows 7. This something that expands/collapses an item is most likely native code. While I think this is a bug in SWT or the Win32 tree control that should be reported and fixed or worked around in SWT, I found a...
This has nothing to do with dialogs. You simply create your TabFolder control on top of the dialog's dialogArea, and that's pretty much everything to it. See this example on how to create a SWT Tab Control...
You can make the dialog 'modeless' so that it does not block the application (like the Find/Replace dialog in Eclipse). Call setShellStyle(getShellStyle() ^ SWT.APPLICATION_MODAL | SWT.MODELESS); setBlockOnOpen(false); in the constructor for the Dialog to do this....
java,eclipse,jface,tableviewer
ITableLabelProvider uses one label provider to provide the labels for all the columns. ColumnLabelProvider uses a separate label provider for each column. It is intended to be used with TableViewerColumn: TableViewer viewer = new TableViewer(.....); TableViewerColumn col1 = new TableViewerColumn(viewer, SWT.LEAD); col1.setLabelProvider(column label provider for col 1); col1.setEditingSupport(editing support for...
I solved it! was using a CTabItem instead of a TabItem.
java,eclipse,eclipse-plugin,tooltip,jface
You can use the IBindingService to get the text for the key binding for a command: TriggerSequence activeBinding = bindingService.getBestActiveBindingFor("command id"); if (activeBinding != null && !activeBinding.isEmpty()) { String acceleratorText = activeBinding.format(); } In a view or editor this will get the binding service: IBindingService service = (IBindingService)getSite().getService(IBindingService.class); elsewhere you...
If you get the current selection from the table rather than the selection change event that does not seem to change when the selection event is for clicking the check box. So it will be empty or the previously selected element and will not match the selection you get from...
When the help button is pressed TrayDialog looks for a control with a SWT.Help listener. It starts at the currently focused control and moves up through the control's parents until it finds a control with the listener (or runs out of controls). You can set up a help listener that...
If you want to expand the tree to a node that may not have been shown yet you can use TreePath to tell the viewer about the full path to the node. Something like: List<Object> path = new ArrayList<>(); path.add(root element); ... path.add(intermediate elements in tree); path.add(node element); TreePath treePath...
ToolBarManager has a getControl() method which returns you the underlying SWT ToolBar control (note this method is only in ToolBarManager not the IToolBarManager interface). ToolBar has the usual SWT setForeground, setBackground, setFont methods. Note: depending on how the ToolBarManager is constructed the ToolBar may not be created until ToolBarManager.createControl is...
You could use the org.eclipse.core.contenttype.contentTypes to define new content types for your file. Use the describer argument of the content type definition to specify a 'content describer' class which can check that the XML file meets your requirements. There is already an XMLContentDescriber class that you can use as a...
To use a comparator you must also use a Content Provider (TableViewer.setContentProvider) and a Label Provider or Column Label Provider. Creating the TableItems yourself means that the TableViewer will not work at all. When using a TableViewer you should not be creating or accessing TableItem objects at all - the...
You need to use TableLayout and TableViewerColumn to define a column so you can set the header text. The minimum code would be: TableLayout layout = new TableLayout(); TableViewerColumn col = new TableViewerColumn(tableViewer, SWT.LEAD); col.getColumn().setText("Text"); layout.addColumnData(new ColumnWeightData(100)); table.setLayout(layout); ...
Notifying the control's listeners of a selection event might be enough: Event event = new Event(); event.widget = penaltyPercent; event.display = penaltyPercent.getDisplay(); event.type = SWT.Selection; penaltyPercent.notifyListeners(SWT.Selection, event); You might need to fill in more fields in the Event....
java,eclipse-plugin,swt,eclipse-rcp,jface
By the looks of it, the drawn rectangle is as big as the cell, and therefore, it does not fit inside it. I would try drawing in the following way: gc.drawRectangle(rect.x, rect.y, rect.width-1, rect.height-1);...
eclipse,user-interface,eclipse-plugin,swt,jface
There is FilteredResourcesSelectionDialog that is a popup displaying any resource wanted, eventually with pre-loaded regexp, allowing to search for file, and you give him a root directory : You call getResult() to retrieve selection as Object[]. If you want to do just a wizard that does that, then I would...
I solved your issue by entirely removing the scrollBarListener and fixing your layout a bit. The showErrorComposite(...) method now looks like this: private void showErrorComposite(String topMessage, String bottomMessage, List<IStatus> statusList) { final Composite errorComposite = new Composite(stackComposite, SWT.BORDER); final GridLayout layout = new GridLayout(); layout.verticalSpacing = 20; errorComposite.setLayout(layout); errorComposite.setLayoutData(new GridData(SWT.FILL,...
java,swt,jface,tablecelleditor
Looks like you can call setActivationStyle on the ComboBoxCellEditor to set what happens on activation: cellEditor.setActivationStyle(ComboBoxCellEditor.DROP_DOWN_ON_KEY_ACTIVATION | ComboBoxCellEditor.DROP_DOWN_ON_MOUSE_ACTIVATION); ...
Don't try and wait for the next button to be clicked. Use addModifyListener to add a modify listener to each text control and save the value in a string whenever the text is modified. You can also use JFace 'data binding' for this sort of thing....
This is almost certainly platform dependent (Mac, Linux, Windows...). Not all platforms support not having a close button and the best that can be done is to disable it.
If you create a subclass of PreferenceDialog you can override the createTreeViewer method and set the auto expand level: @Override protected TreeViewer createTreeViewer(final Composite parent) { TreeViewer viewer = super.createTreeViewer(parent); viewer.setAutoExpandLevel(AbstractTreeViewer.ALL_LEVELS); return viewer; } ...
To display styled text in SWT you can use the Browser widget or StyledText widget. In both cases you likely need to change the default appearance and behavior to be label-like (i.e. background color, read-only) Browser Widget Browser browser = new Browser( parent, SWT.NONE ); browser.setText( "If you restore data...
TableViewer (and other viewers) uses the item.setData(object) method itself to associate your data model object with the item. Setting the data value to something else will break the viewer. Also the viewer does not guarantee to use the same item for a particular row for the life time of the...
PopupDialog extends the JFace Window class so you can call: setBlockOnOpen(true); to ask for blocking. Do this before calling the open() method....
canFinish is called by the WizardDialog whenever it needs to update the buttons on the button bar (the Back, Next and Finish button). There will be calls when the wizard is first shown and when you move between pages. Individual wizards can also call IWizardContainer.updateButtons whenever they want the button...
I just changed my eventType to SWT.Resize, instead of SWT.RESIZE, and now the listener is working fine.
You can extend the ErrorDialog class so that you can override the createButtonsForButtonBar method. For example this is from the Eclipse p2 install plugin: public class OkCancelErrorDialog extends ErrorDialog { public OkCancelErrorDialog(Shell parentShell, String dialogTitle, String message, IStatus status, int displayMask) { super(parentShell, dialogTitle, message, status, displayMask); } @Override protected...
You could write your own implementation of ISelectionProvider which returns the checked elements instead of using the default provider implemented by TableViewer which returns the selected elements.
WizardDialog contains one or more WizardPage s. Wizards are part of JFace API not SWT. Different WizardPages can slide back and forth on the same WizardDialog by clicking Back and Next button. Clicking on Finish button will close the WizardDialog and clicking on Cancel button will abort the operation. Check...
Don't call setSize on the Shell you are overriding the size calculated by the layout and causing the buttons to be outside of the dialog. To control the size of the table set height and width hints on the table grid data: GridData data = new GridData(SWT.FILL, SWT.FILL, true, true);...
java,eclipse-plugin,eclipse-rcp,jface
setSorter is an obsolete method which has been replaced by setComparator. The ViewerSorter class used by setSorter only supported the use of a Collator for sorting. The ViewerComparator class used by setComparator supports any Comparator class. The IElementComparer class set by the setComparer method is used when the viewer is...
The TreeViewer public void update(Object element, String[] properties) method is the lightest weight way to update a row. You can use the 'properties' argument to tell the label providers which column is being updated. The label providers should override public boolean isLabelProperty(Object element, String property) to tell the viewer which...
drag-and-drop,swt,jface,e4,treeviewer
When using JFace Viewers you can use the JFace ViewDropAdapter class rather than DropTargetListener. This class does more work for you and has a getCurrentTarget() method to return the current target element. More details on this here...
java,eclipse,swt,jface,inline-editing
The ComboBoxCellEditor uses a CCombo widget for editing. With CCombo#setVisibleItemCount() the number of visible items can be controlled. Depending on when you know how many items should be visble you can configure the combo box. For example through overriding createControl ComboBoxCellEditor editor = new ComboBoxCellEditor() { @Override protected Control createControl(...
eclipse,eclipse-plugin,swt,eclipse-rcp,jface
The path is shown when there are multiple entries with the same name. This is to allow you to distinguish the entries. If you create a class derived from FilteredResourcesSelectionDialog (or anything based on FilteredItemsSelectionDialog) you can override the isDuplicateElement method to control this, for example: @Override public boolean isDuplicateElement(Object...
Markup can only be applied to TableItems. Table columns currently don't support markup. If you think you have a valid use case, you may want to open an enhancement request here: https://eclipse.org/rap/bugs/...
No matter what I try ,not able to reproduce your issue.Its working perfectly fine for me even for big multi line string.Attached is the screen shot I guess there is some problem with the layout or size of the shell Object that you are passing Shell parentShell try sending null...
Use IFileEditorMapping[] mapping = PlatformUI.getWorkbench().getEditorRegistry().getFileEditorMappings(); to get the mappings between file types and their supported editors. Look at this javadoc to see everything you could ever want to know about the mappings...
Try this, don't forget to call: createContextMenu(viewer); /** * Creates the context menu * * @param viewer */ protected void createContextMenu(Viewer viewer) { MenuManager contextMenu = new MenuManager("#ViewerMenu"); //$NON-NLS-1$ contextMenu.setRemoveAllWhenShown(true); contextMenu.addMenuListener(new IMenuListener() { @Override public void menuAboutToShow(IMenuManager mgr) { fillContextMenu(mgr); } }); Menu menu = contextMenu.createContextMenu(viewer.getControl()); viewer.getControl().setMenu(menu); } /** *...
java,eclipse-plugin,swt,eclipse-rcp,jface
The perspectiveActivated listener is fired by the WorkbenchPage, the page seems not expect the listener to call the page showView method in the listener and gets confused if it does. Use Display.asyncExec to run the showView call. This will run the code after the WorkbenchPage has finished the work it...