jface

How to limit ModifyListener for user interaction only

穿精又带淫゛_ 提交于 2019-12-11 07:37:41
问题 I have a textbox with attached ModifyListener. In implemented modifyText(ModifyEvent e) I execute desired functionality. The problem with that, that this event is triggered on every text change. I don't want it to trigger if text was altered programmaticly (by setting text via code). I want it to trigger only when user changes the code (I can't use keylistener because it will be triggered also when user click on arrow buttons and etc, it also won't detect if user copy&paste text) 回答1: You

Why does calling TreeViewer.refresh() not call the contentProvider's getChildren(Object) method?

帅比萌擦擦* 提交于 2019-12-11 07:14:51
问题 Amongst other places, I've looked here and here, but I've not found an answer to my question. A little background: I'm implementing a view that represents a subset of the resources in an eclipse project. The project nodes in the tree will check whether the project is open to see if they should contain children. Effectively, the Project node's hasChildren() method returns IProject.isOpen() . The eclipse view subscribes to resourceChangeEvents, and in the case that any change occurs, it calls

Updating Eclipse JFace Treeviewer when model changes?

ぃ、小莉子 提交于 2019-12-11 06:16:15
问题 I am developing a RCP application with a TreeViewer . While there are good number of articles to explain how to add editing support to the Viewer (and how changes in view are updated in the model), I don't find much for updating the Treeview when the underlaying model changes. my question in short: TreeView ----> Model updation ------ there are lots of examples Model ----> Treeview updation ----- this is my question Edit: This is what I tried and it works. comments please viewer.getTree()

TableViewer shrinks to a single row with a scroll bar when new input is set

只谈情不闲聊 提交于 2019-12-11 03:28:35
问题 I am implementing a plug-in in eclipse, which reads a set of values from a database and displays it in a TableViewer inside a ViewPart . The TableViewer uses an ArrayContentProvider as shown viewer = new TableViewer(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.FULL_SELECTION | SWT.BORDER); ... viewer.setContentProvider(new ArrayContentProvider()); I also have a handler which has access to the TableViewer instance for importing data from an XML file. When the importer imports data, I

Gap between search menu and its previous menu on addition of search plugin

会有一股神秘感。 提交于 2019-12-11 03:06:27
问题 I added the Search Plugin to my RCP application. On addition of this plugin it adds the search menu in main menu bar. I observed that there is some pixels gap between search menu and its previous menu. Please see the image. Does anyone know how this is coming and how I can remove it? 回答1: I fixed this issue by modifying postWindowCreate method of ApplicationWorkbenchWindowAdvisor class of RCP application. IWorkbenchPage page = this.getWindowConfigurer().getWindow().getActivePage();

How to align two composites in a parent composite without using widthHint and heightHint

℡╲_俬逩灬. 提交于 2019-12-11 02:43:14
问题 I want two composites (one below the other) inside a parent component. This is how my code looks like: Composite composite = (Composite) super.createDialogArea(parent); Composite rowComposite = new Composite(composite, SWT.NONE); rowComposite.setLayout(new GridLayout(2, false)); GridData gd1 = new GridData(SWT.LEFT, SWT.CENTER, false, false); gd1.widthHint = 760; gd1.heightHint = 240; rowComposite.setLayoutData(gd1); Composite columnComposite = new Composite(composite, SWT.NONE);

How to select an element in the ListViewer

↘锁芯ラ 提交于 2019-12-11 02:23:44
问题 I'm trying to find and select an element in the ListViewer , I compare a string with every element in the ListViewer . I can get the index of the element but I don't know how to select it in the Listviewer . String pattern = elementText.gettext(); String[] listViewerValues = mListViewer.getList().getItems(); List<String> valuesList = Arrays.asList(listViewerValues); int index = -1; for(int i=0; i < valuesList.size(); i++) { valuesList.set(i, valuesList.get(i).toLowerCase()); } index =

treeviewer does not deselect the tree item

倾然丶 夕夏残阳落幕 提交于 2019-12-11 02:22:10
问题 I wanted to create dynamic tree struture in my application. There my requirement is When the user selects any tree node and click insert the child should be inserted below the selected parent. That is working fine. Now the problem is i am unable to deselect the currently selected tree item in order to change tree item . I clicked the background of the view and tried to insert a new tree item, but still it goes to the previously selected tree node as still it highlight as the selected one. How

How can I get the ordered elements of a JFace's TableViewer?

寵の児 提交于 2019-12-11 01:43:44
问题 I have implemented the JFace's TableViewer sorting according to Vogella's instructions (reproduced below). It happens that the sorting is made in the graphical interface only (it is not reflected in the original data structure) and I need o get the elements in the order they are displayed in the GUI. Alternatively, an implementation which reflects the sorting in the original data structure would fit too. package de.vogella.jface.tableviewer.sorter; import org.eclipse.jface.viewers.Viewer;

How to scroll lock a Jface tableviewer?

被刻印的时光 ゝ 提交于 2019-12-10 23:41:00
问题 I have a table viewer which is updated very quickly and I want to scroll lock my table viewer as in the eclipse console view. I tried to plug-in spy the console view in eclipse but I didn't find what I was looking for Any tips to do that? 回答1: I found out the answer, thanks to someone on another forum. You only need to use the method refresh(object, true, false) to do that 来源: https://stackoverflow.com/questions/12163085/how-to-scroll-lock-a-jface-tableviewer