jface

How to make SWT/JFace dialogs which show similar behaviour(layouts) under all window resolutions

帅比萌擦擦* 提交于 2019-12-18 04:27:11
问题 The JFace Dialogs I have created show difference in layouts under different resolutions.How to create dialog in JFace or SWT which show same layout under all resolutions just like the dialogs used in Eclipse. i mean that on changing the screen resolution to 800x600 pixels and choosing extra large fonts the layout of the dialog gets disturbed which is not the case with Eclipse IDE dialogs.Just check out the screenshot of my dialog. 回答1: Ok, based on the discussion in chat, it seems like the

Putting an image in to a JFace table Cell is causing gap for image to appear in first column

泄露秘密 提交于 2019-12-17 19:47:26
问题 So I have a problem, when I add an image to any column of a JFace table the first column also behaves like it has an image in and the text is indented by the size of that image. Here's a screenshot illustrating my point with the code needed to produce it. Is there anyway to stop this from happening because it's really getting on my wick? Regards, Glen x package widgets; import java.util.ArrayList; import java.util.List; import org.eclipse.jface.viewers.ArrayContentProvider; import org.eclipse

How to get cursor position in an eclipse TextEditor

纵饮孤独 提交于 2019-12-17 16:39:19
问题 I have been trying to get the line number and column number of the cursor position in a jface TextEditor. I tried the function getCursorPosition(). But on printing this it shows just a "?". Please note that I need the line number and column number within an editor and not with respect to the screen. I saw that there is a function JTextArea.getCaretPosition. But I dont know how to convert a text editor to JTextArea. Also, is it possible to read the word where the cursor is placed? Thanks 回答1:

TreeViewer selections and the Clipboard

≡放荡痞女 提交于 2019-12-14 03:54:42
问题 Is it possible to place more than one object (which represent TreeViewer selections) into the clipboard? Here's my Cut code. static public void Cut(EssentialData dataInst) { IStructuredSelection selection = (IStructuredSelection)dataInst.getTreeViewer().getSelection(); if(selection == null) { System.err.println("selection received was null"); return; } Object[] objects = selection.toArray(); //because setContents requires a Transfer object for every object sent List<Transfer> typesList = new

Jface dialog with ScrolledComposite

╄→尐↘猪︶ㄣ 提交于 2019-12-13 18:35:55
问题 I am trying to display scrollable composite in my dialog window. But it do not get the scrollbars. I also don't get the "OK" "Cancel" buttons. How to fix it? public class MyDialog extends Dialog { public MyDialog (Shell parentShell) { super(parentShell); } protected void configureShell(Shell newShell) { super.configureShell(newShell); newShell.setText("test"); newShell.setSize(200, 100); } protected Control createDialogArea(Composite parent) { ScrolledComposite sc = new ScrolledComposite

Eclipse RCP Jface/SWT TreeViewer on Windows 10

大憨熊 提交于 2019-12-13 07:32:54
问题 I have a RCP application. I recently moved the application to 64 bit. It is based on Eclipse 3.7.0. I noticed something weird. There is a discrepancy between TreeViewer expand/collapse icons on 32 and 64 bit builds on Windows 10. From what I understand it goes down to the OS which determines the theme and what to use for the icon. On 32 bit builds TreeViewer expand/collapse looks like: On 64 bit builds TreeViewer expand/collapse looks like: Why are 64 bit builds only using + -? This only

Using newline in JFace ErrorDialog

橙三吉。 提交于 2019-12-13 06:34:32
问题 Has anybody managed to show a detail error message in the JFace ErrorDialog using newline (\n, \r) character? I'm trying to display the StackTrace as a detail message, but it is only shown in one line StringBuffer sbStackTrace = new StringBuffer(); for (StackTraceElement ste : throwable.getStackTrace()) { sbStackTrace.append(ste.toString()).append('\n'); } final IStatus status = new Status(IStatus.ERROR, pluginId, statusMsg, new Throwable(sbStackTrace.toString(), throwable)); ErrorDialog

Add icon button beside tree item in eclipse tree

蓝咒 提交于 2019-12-13 02:35:47
问题 I wonder how to add an icon that acts as a button in the right side of a tree item the selection of this icon should have different action than selecting the tree item itself. How can I do that? Example: consider this is the main tree http://www.eclipse.org/articles/Article-TreeViewer/images/main.gif and I want to add icons to the right side of some tree items' label like http://store2.up-00.com/June12/8QI59630.gif just as when I click on the black star icon, I make a different action than

What are wrong with this code on Activating/Deactivating IHandlerActivation of Command Eclipse Plugin Development

烈酒焚心 提交于 2019-12-13 00:09:49
问题 So, I have 2 commands, which are identified by PLAY_COMMAND_ID and STOP_COMMAND_ID . Each of command have each handler, respectively playHandler and stopHandler (these are extending AbstractHandler class). These commands are contributed to my view's toolbar in Button style. Basically what I want is initially the PLAY_COMMAND is active but the STOP_COMMAND not. When the PLAY_COMMAND is clicked, then it will activate the STOP_COMMAND then deactivate itself( PLAY_COMMAND ). And vice versa when

How to resize a scroll composite to always fit its contents horizontally?

倾然丶 夕夏残阳落幕 提交于 2019-12-12 15:02:07
问题 I have a scrolled composite ,it contains a tableViewer. My requirement is that if the table is increased in width,the scroll composite should not show horizontal scroll ,but it should expand to fit table's size. The only reason I have used a scrolled composite here is I want to show vertical scroll bar. 回答1: If you want to control the scrollbars of a Table in SWT - which is a sub-class of Scrollable - simply add one or more of the following styles in the constructor. If you construct a Viewer