jface

How do you utilize SWT's Hi-DPI support for icons?

£可爱£侵袭症+ 提交于 2019-12-23 01:38:10
问题 According to Eclipse Project Neon - New and Noteworthy, SWT supports auto-scaling for Hi-DPI monitors. Does SWT only support "auto-scaling", or does it provide additional features such as defining different images for various DPIs or zoom levels? If so, what are the classes I need to be looking into? 回答1: SWT's Image has a new constructor that accepts an ImageDataProvider in order to provide image data for different zoom levels. if the application is moved to a monitor with different DPI or

Non resizable window with JFace

喜你入骨 提交于 2019-12-22 12:15:38
问题 I how it's possible to setup non resizable window with JFace API. Consider code below that creates application window. I can't find any methods to setup window as not resizable on shell object or application window parent. Is there something I'm missing? public class Application extends ApplicationWindow { public Application() { super(null); } protected Control createContents(Composite parent) { prepareShell(); return parent; } protected void prepareShell() { Shell shell = getShell(); shell

JFace ColumnWeigthData causes parent to grow

空扰寡人 提交于 2019-12-22 09:45:42
问题 I got an Eclipse RCP app and want to use dynamic column size in a TableViewer using ColumnWeigthData as ColumnLayoutData . Problem is that the parent form ( ScrolledForm in example code) grows a few pixels whenever I layout the table. To reproduce you can run the example and open/close the Section a few times. On every close the section gets wider. Why does it do this and how can I make it stop? package com.test; import org.eclipse.jface.layout.TableColumnLayout; import org.eclipse.jface

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

拥有回忆 提交于 2019-12-21 07:48:06
问题 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. 回答1: 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

SWT Tree - Lowering the native expand icon possible?

我的未来我决定 提交于 2019-12-20 05:14:15
问题 I have a JFace TreeViewer with a SWT Tree underlaying and I am painting my cells for multiple row support for myself. Currently, it looks like this: I want both the expand icon and the label to be lowered like this: This is no problem for the label because I am extending from StyledCellLabelProvider and am overwriting paint() and measure() - the problem is that I have no clue if its possible to set the Y Coordinate for the Expand Icon. I'm afraid it isn't.. If so, I would like to paint a

SWT event propagation

泪湿孤枕 提交于 2019-12-19 17:39:09
问题 I'm trying to detect click events on a Composite control that contains a number of other composites. I tried: topComposite.addMouseListener(new MouseListener() { ... @Override public void mouseUp(MouseEvent arg0) { logger.info("HERE"); }); }); But the event never fires. I assumed that when a mouse event occurred on a child it would propagate up the chain but that doesn't happen. How do I do this? 回答1: In SWT, the general rule is that events do not propagate. The main exception to this, is the

how to add tooltip on the entries and NOT on the combo in JFace ComboViewer

泄露秘密 提交于 2019-12-19 10:05:09
问题 I am loading my ComboViewer with over one thousand elements. Some elements are longer than the width of underlying combo . I want to add tooltip on the entries and NOT on the combo . I want it in such a way that, when the list drops down and the user places the mouse pointer over one of the value, the entire text should be displayable via tooltip similar to the tooltip shown for a JFace TableViewer . 回答1: If you are using a ComboViewer and you provide your own CCombo instance, you can get

how to add tooltip on the entries and NOT on the combo in JFace ComboViewer

不羁岁月 提交于 2019-12-19 10:04:03
问题 I am loading my ComboViewer with over one thousand elements. Some elements are longer than the width of underlying combo . I want to add tooltip on the entries and NOT on the combo . I want it in such a way that, when the list drops down and the user places the mouse pointer over one of the value, the entire text should be displayable via tooltip similar to the tooltip shown for a JFace TableViewer . 回答1: If you are using a ComboViewer and you provide your own CCombo instance, you can get

Non-Modal JFace Dialog?

一曲冷凌霜 提交于 2019-12-19 05:30:15
问题 Simply put: Is there any way to create non-modal JFace dialog? I've tried calling setShellStyle to no avail. If I remember right this isn't a problem in swing - is this a shortcoming of SWT, or am I just misusing the widget? TIA 回答1: Using setShellStyle(SWT.CLOSE | SWT.MODELESS | SWT.BORDER | SWT.TITLE); setBlockOnOpen(false); seems to be the practice. This doesn't work for you? 回答2: @Override protected void setShellStyle(int newShellStyle) { super.setShellStyle(SWT.CLOSE | SWT.MODELESS| SWT

Eclipse RCP - ILazyTreeContentProvider implementation is unexpectedly eager

前提是你 提交于 2019-12-18 16:52:40
问题 I am developing an Eclipse RCP application, and am trying to use a ILazyTreeContentProvider implementation in order to show only the visible items at a certain time. The code: Inside the class extending ViewPart: public void createPartControl(Composite parent) { viewer = new TreeViewer(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.VIRTUAL); drillDownAdapter = new DrillDownAdapter(viewer); viewer.setContentProvider(new ViewContentProvider()); viewer.setLabelProvider(new