jface

Hiding empty parents - JFace's TreeViewer

时光毁灭记忆、已成空白 提交于 2019-12-10 18:34:41
问题 I'm creating a tree viewer in JFace and I want to achieve something. I use filter in it. The filter works well, but not perfectly. When I use filter.expandAll() method, the filter filters all of the tree's items, but there's something really annoying. Although it filters all of the tree's items, it doesn't hide item parents, that become now empty. Example: As you can see, there's only one item that matches the filter: "General/Map/New". But all of the parents are now shown although that they

Display some part of text in bold and some part in italic in SWT label

浪子不回头ぞ 提交于 2019-12-10 18:05:05
问题 I have to show some warning message to the user like "If you restore data the updated changes will be lost , So recheck once" In german language also I have to same string with bold and italic. In both languages the dialog height and width should be same public class BoldTextMessageDialog extends ZedisTrayDialog { private Composite container; private String firstSring; private String secondString; private String boldString; private Button restoreButton; private Button cancelButton; public

SWT Actions with Keyboard Shortcuts… without having to add them to the menu

女生的网名这么多〃 提交于 2019-12-10 17:42:07
问题 We currently have implemented a lot of SWT Actions, because it is a nice way to bind a single command to be added to the menubars and toolbars, and to have Keyboard Shortcuts for these commands. Now... how can I register an Action in plain SWT/JFace without having to add it to a menubar, but in a way that it still can be called by a keyboard shortcut? 回答1: I use to solve this in plain SWT by using Display.addFilter on the KeyDown event. See this question for an example. 回答2: Use the org

RAP: How to access Object in ViewPart

天大地大妈咪最大 提交于 2019-12-10 17:15:10
问题 how do I access to an Object of a View from somewhere else? (Following code is just to sketch what i want to do) public class View extends ViewPart { public static final String ID = "view"; private static List list; public View() { } @Override public void createPartControl(Composite parent) { list = new List(parent, SWT.BORDER); } @Override public void setFocus() { } public static void addToList(String string) { list.add(string); } } Now I want be able to use View.addToList("Message")

SWT - Table vs. TableViewer

天涯浪子 提交于 2019-12-10 12:58:16
问题 I am creating a new project using SWT. I will have 3 or 4 different tables in the project. I am fairly new to SWT and I find myself asking should I be using just the Table or should it be a TableViewer . I am wanting to learn some good guidelines on when to use just the Table and when a TableViewer is the best route. What is the benefit of using a TableViewer instead of a Table ? Should all the tables have a TableViewer ? If I am working with data from the table, is just the Table the best

SWT Combo and CCombo as CellEditor

好久不见. 提交于 2019-12-10 11:35:48
问题 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?) 回答1: 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

How can i open a shell without making it active?

天大地大妈咪最大 提交于 2019-12-10 11:16:32
问题 I need to know if there is any way to open a shell and not make it active, even if i click a control in it. The best way to explain what i need is to show you this little example. I need to keep the first shell active, even if i click the second one, or any widget that it contains. public class TestMeOut { public static void main(final String[] args) { final Display display = new Display(); final Shell shell = new Shell(display); shell.setLayout(new GridLayout(1, false)); final Shell shell2 =

Draggable toolbar

孤街醉人 提交于 2019-12-10 10:39:22
问题 how to make draggable/dockable toolbar with JFace/SWT like Eclipse has? Could you post a simple example of ApplicationWindow or link good source of how to make it. Thanks. 回答1: SWT has a component called CoolBar, You can create CoolBars fairly easily by using CoolBarManager, or you can manually use just them (API Doc) 回答2: In case that someone found this question I have prepared small example. My problem was in incorrect use of add method. You have to use add(IToolBarManager toolBarManager)

JFace libraries stand-alone download (not picked from Eclipse plug-ins)

天涯浪子 提交于 2019-12-10 10:12:01
问题 I would like to use all of the JFace functionality but include in my project only the very minimum in terms of external jar s. Is it possible to download the typical .jar s required to build an SWT/JFace app without having to download Eclipse first and then to pick the right files out of the plugins directory? e.g. these files.. org.eclipse.core.commands_.jar org.eclipse.equinox.common_.jar org.eclipse.jface_.jar org.eclipse.osgi_.jar org.eclipse.ui.workbench_.jar ... Is it even possible to

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

ε祈祈猫儿з 提交于 2019-12-09 16:07:42
问题 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