jface

SWT/JFace or Eclipse RCP?

不羁岁月 提交于 2019-12-04 15:55:46
问题 Which are the reasons to choose the Eclipse Rich Client Platform as the base of my application, instead of just using SWT/JFace? 回答1: Eclipse RCP is not just a GUI (SWT/JFace), but an OSGi -based platform. So, you would choose the RCP framework in order to: have a better definition of your different modules manage their lifecycles, and versions compatibility isolate classloader issues. If your application is just one monolithic GUI font-end, RCP might be a bit overkill. 回答2: In additions to

Background color of widgets in JFace PopupDialog

巧了我就是萌 提交于 2019-12-04 15:53:17
I want to use the JFace PopupDialog as lightweight dialog for user input. But I have some problems with the background color of text widgets. As you can see below in 1 , a SWT.MULTI text widget has no background and border, a SWT.SINGLE text widget has no background. I tried to override the background color with: Text comment = new Text(composite, SWT.MULTI|SWT.BORDER); comment.setFocus(); comment.setBackground(new Color(Display.getDefault(), new RGB(000, 000, 000))); // method of PopupDialog applyBackgroundColor(new Color(Display.getDefault(), new RGB(000, 000, 000)), comment); Does anybody

SWT Table with variable row height: Working on Linux, but not Mac/Windows

烂漫一生 提交于 2019-12-04 13:27:44
问题 Problem: I need an SWT Table (JFace TableViewer) with variable row height. In fact, I solved this on my development machine (running Ubuntu 10.10). Unfortunately, this doesn't work on Windows nor on Mac. Initially, I thought I didn't use the libraries correctly. But by now I fear that what I want to do is simply not possible on Windows. I hope someone here convinces me otherwise. To reproduce: rather than providing my code here, I built a minimal program to reproduce the problem. I started

JFace dialog button translation

☆樱花仙子☆ 提交于 2019-12-04 10:31:16
I am creating a standalone SWT/JFace application. I used to use plain old SWT MessageBox: int style = SWT.APPLICATION_MODAL | SWT.YES | SWT.NO; MessageBox messageBox = new MessageBox (getShell(), style); messageBox.setText ("Question"); messageBox.setMessage ("So?"); boolean result = messageBox.open() == SWT.YES; I try to switch to JFace MessageDialog boolean result = MessageDialog.openQuestion(getShell(), "Question", "So?"); The problem I have is that in SWT, the Yes and No button labels are translated in my language, while in JFace it is not the case. Any idea? My referenced jars are swt 3.8

How do I change the background selection color for a jface table

这一生的挚爱 提交于 2019-12-04 09:46:07
In a elipse-rcp application I am setting the background color for a row in a jface table but I don't want the selection to change this color. I want to be able to specify the color change for a selected row. VonC According to this thread , for JFace Viewers ( ListViewer , Table , Tree ) by means of using EraseItem and MeasureItem events General principle detailed in the article " Custom Drawing Table and Tree Items " SWT.EraseItem : allows a client to custom draw a cell's background and/or selection, and to influence whether the cell's foreground should be drawn ks. table.addListener(SWT

org.eclipse.swt.SWTException: “Widget is disposed” from table refresh

别来无恙 提交于 2019-12-04 04:27:51
The app is an Eclipse 3.6 based RCP (so jface version 3.5.2) running on windows 7. I have a custom View class that contains a TableViewer and calls refresh() on it. Sometimes, but not very often it results in the stack trace below. It's called from within the UI thread. I suspected the problem was with other code that changes the backing list to the table, but that any code that does this is also run in either a syncExec or asyncExec method so I don't understand how it could be a synchronisation issue between the changing of table items and the refresh of the viewer. Any ideas what i can do to

multiline feature or wrap text feature in jface tableviewer

╄→гoц情女王★ 提交于 2019-12-04 04:27:26
问题 i have a jface tableviewer table where in the data in the columns just come in one single line even if it is the long text. I would want a wrap text feature or a multiple line feature for table, if text exceeding a certain limit. Could anybody help me with this. 回答1: See this SWT snippet draw multiple lines of text in a table item and this JFace SnippetSnippet006TableMultiLineCells 来源: https://stackoverflow.com/questions/8355693/multiline-feature-or-wrap-text-feature-in-jface-tableviewer

Looking for a Combo(Viewer) in SWT/JFace which supports autocomplete

馋奶兔 提交于 2019-12-04 01:56:31
I'm looking for a Combo(Viewer) in SWT/JFace which supports autocomplete / type-ahead, i.e. the user can enter a couple of characters and the drop down list should show all matching elements. You can also check out the org.eclipse.jface.fieldassist.AutoCompleteField class. It's not a combo, just a text field, but it adds auto complete functionality as if it were a combo very easily. You can do something as simple as this: Text textField = new Text(parentComposite, SWT.BORDER); new AutoCompleteField(textField, new TextContentAdapter(), new String[] {"autocomplete option 1", "autocomplete option

File Explorer using Java - how to go about it?

守給你的承諾、 提交于 2019-12-04 01:13:50
问题 I am set to create a file explorer using Java. The aim is to emulate the behavior of the default explorer as closely as possible, whatever may be the underlying OS. I have done NO GUI programming in Java. I have looked-up Swing, SWT and JFace, and I am beginning my project with this tutorial: http://www.ibm.com/developerworks/opensource/library/os-ecgui1/ I would like to know your opinions about the best approach to tackle this problem. If you could comment on complexity of coding,

Enumerating all my Eclipse editors?

怎甘沉沦 提交于 2019-12-03 16:29:22
I have built a simple Eclipse plugin where a user may use a TableViewer of database resources to open an editor on any of those resources. Users may therefore have zero upwards instances of the editor running. Is there an API available to get a list of those editor instances? You can get references to all open editors with: PlatformUI.getWorkbench().getActiveWorkbenchWindow() .getActivePage().getEditorReferences(); And then check these to select the ones that reference instances of your editor type. According to the javadoc for the API a workbench can have several windows, and a window can