jface

Align an image in a SWT TableViewer

旧街凉风 提交于 2019-12-12 14:22:11
问题 I just found out, that its somehow impossible to align an image in a swt tableviewer. Creating a TableColumn with SWT.RIGHT (for instance) has no effect on that column if its labelprovider returns an image for it. Question: Is there any other way to align an image instead of modifiying the image file itself and put some extra pixel into it? 回答1: I believe that you're running into a limitation of the underlying platform (or something to that effect). You can have total control over what goes

Moving an image of a TitleAreaDialog to the left

≡放荡痞女 提交于 2019-12-12 12:07:44
问题 I'm working on a SWT/Jface project based on Java SE, i want to move the image of a TitleAreaDialog to the left. is it possible ? if not is there anyway ? Thanks, 回答1: You can modify the layout data of the image label as follows: TitleAreaDialog tad = new TitleAreaDialog(getShell()) { @Override protected Control createContents(Composite parent) { Control control = super.createContents(parent); Label label = getTitleImageLabel(); FormData data = (FormData) label.getLayoutData(); data.left = new

How to set custom text on buttons in JFace Wizard (Java)

▼魔方 西西 提交于 2019-12-12 10:22:53
问题 I am using JFace Wizard and I want to set my own text on buttons Next, Back, Finish and Cancel. I found only very old advices which are completely useless today. I also found some solution with external jar files, but I really don't want to add whole library to project only for setting text on 4 buttons... Is there any reasonable solution? Thanks in advance 回答1: After massive finding and trying, I have to say there is no such way. There are some brutal solutions, but compared with them,

restrict the ElementTreeSelectionDialog

我的未来我决定 提交于 2019-12-12 05:12:39
问题 I wanna to implement Workspace Browse . I write the below code. ElementTreeSelectionDialog dialog = new ElementTreeSelectionDialog( Display.getDefault().getActiveShell(), new WorkbenchLabelProvider(), new BaseWorkbenchContentProvider()); dialog.setInput(ResourcesPlugin.getWorkspace().getRoot()); dialog.open(); How can I change the code to only root elements (projects or folders) that contains ".ecore" file shown? And when the user collapse any root elements only .ecore files shown? 回答1: You

How to search for required elements in list using jface

浪尽此生 提交于 2019-12-12 04:54:04
问题 I have created a list using swt which displays a list of animals ex:cat,dog,camel,elephant. and now i need to search for a specific animal ex dog in search coloumn and only that animal has to be displayed in the list .So how can this be done using jface.I am new to jface,Please help me to search the list. 回答1: All JFace Viewer s support ViewerFilter s. Here is a good tutorial about them. Here's a very basic example that should show you how you can use ViewerFilter s: public static void main

How to expand an object in a Treeviewer?

笑着哭i 提交于 2019-12-12 04:47:01
问题 I am trying to understand java treeviews. I created a Treeviewer with the following tutorial: http://www.eclipse.org/articles/Article-TreeViewer/TreeViewerArticle.htm Now I have a problem that I can´t solve :/ I want to expand the book-objects with another object. For example: + BookTitleX BookAuthorX etc otherobjectname etc etc etc How can I add an object to an object ? Thank u so much This is the code: Content Provider: import java.util.Iterator; import org.eclipse.jface.viewers

JFace/Eclipse databinding trigger multivalidator in ChangeListener of AggregateValidationStatus

跟風遠走 提交于 2019-12-12 04:35:56
问题 I have an AggregateValidationStatus with an IChangeListener . The listener is called every time I select/change and component which is what I need. The only problem I have is that I have to trigger the validate() method of my MultiValidator in the beginning of the ChangeListener . Sadly there is very low documentation and what I found didn't help me. My ChangeListener final AggregateValidationStatus aggregateValidationStatus = new AggregateValidationStatus( dataBindingContext.getBindings(),

Vertical align 2 jface TreeViewers to specific element

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-12 02:28:35
问题 I have two TreeViewer objects on a page (2 columns, one TreeViewer in each column), and I want to vertically align a tree when the other is scrolled or selected. import org.eclipse.jface.viewers.TreeViewer; import org.eclipse.swt.widgets.Tree; I think the solution should look something like treeViewer.addSelectionChangedListener(new ISelectionChangedListener() { @Override public void selectionChanged(SelectionChangedEvent arg0) { TreeViewer mirrorTree = (treeViewer == treeVwrSource ?

How to display an custom editor inside a form page?

删除回忆录丶 提交于 2019-12-12 01:52:16
问题 Is it possible to display or embed a custom editor inside a form page(form toolkit)? I have created a eclipse plugin where i need to embed a custom editor inside a multi - page form editor. Is it possible? If possible, How? Am a newbie in eclipse plugin, This question may look easy for you people. Please help with this. I have searched a lot in internet but i couldn't find any perfect solution. Updated : 来源: https://stackoverflow.com/questions/27242139/how-to-display-an-custom-editor-inside-a

Can you disable the cancel button in a jface wizard?

爱⌒轻易说出口 提交于 2019-12-11 22:35:35
问题 When the user presses the 'next' button in my jface wizard, it will be communicating with my server asynchronouly. However this operation cannnot be cancelled, so I want to basically disable the 'Cancel' button temporarily in my jface wizard and also if possible the 'close' button in the title bar. Is this possible? 回答1: How are you communicating with the server? Are you running it inside IWizardContainer.run()? you can pass cancellable = false. 回答2: pass your long-running code wrapped by