swt

GUI, java, SWT and world map representation

Dear all, I'm trying to implement a small-scale strategy, taking turns game implemented in Java, GUI is made with JFace and SWT. My challenge is to write a GUI implementation of the world map, where countries will act as clickable buttons. However, countries have no fixed boundaries, no rectangular shape, and simply no way I can think...

Remember size of dialogs

In my application I've a main shell window and lots of dialogs (classes extends Dialog). I use setSize(width,height) when initializing them, but I know that users constantly resize them for their taste. What is a smarty way to get notified when the size changes so I can store/load them? (And why don't do toolkit provide such a thing ou...

Fast pixel plotting using SWT?

I'm looking for a fast and easy way to plot arbitrarily colored pixels in an SWT Canvas. So far I'm using something like that: // initialization: GC gc = new GC(canvas); // inside the drawing loop: Color cc = new Color(display, r, g, b); gc.setForeground(cc); gc.drawPoint(x, y); cc.dispose(); This is horribly horribly slow. it takes ...

SWT/JFace: remove widgets

Group group = new Group(parent, SWT.NONE); StyledText comment = new StyledText(group, SWT.BORDER_DASH); This creates a group with a text area inside. How can I later delete the text (remove it from the screen so that I can replace it with something else)? ...

fonts on org.eclipse.swt.widgets.Composite are messed up on Linux

I extend org.eclipse.swt.widgets.Composite and create many widgets on it, (labels, table, text etc). The problem I am facing is that the labels' text is getting truncated on linux while it appears fine on windows. When I change the linux's font to gothic the truncation is little less but still there. Is there way to homogenize the wind...

SWT Syntax highlighting widget

Anyone know of an SWT widget that can be a text editor with support for syntax highlighting? I'm aware of the StyledText widget but I'm hoping that somebody has already written some libraries so one can just specify the keywords that should be highlighted. ...

java SWT: how can I draw a widget to an offscreen buffer

I would like to draw the contents of a StyledText widget in to an Image; this will then provide a convenient way to stick the image into a Table cell. Any suggestions about the best way to go about this? ...

How can I disable all images for an JFace menu but leave them enabled in the toolbar

If I create a set of actions to be used in a JFace application and I assign images to those actions, those images show up in both the toolbar (where I want them) and in the menus (where I don't want them). Other than supplying two completely separate sets of actions (which eliminates part of the point of actions in the first place), how...

How to force redraw of an ex-invisible group's content in SWT?

Hi all, I'm a total noob in SWT, just getting started, but I have previously worked with GUI frameworks such as Swing. I have a Composite which contains a Group and a Button. The Group is initially set to invisible (using group.setVisible(false)), and is set to visible when clicking the button. This starts a thread which perform some c...

Java programming in SWT

HI.. i have this piece of code in java... import org.eclipse.swt.SWT; import org.eclipse.swt.custom.CTabFolder; import org.eclipse.swt.custom.CTabItem; import org.eclipse.swt.events.SelectionAdapter; import org.eclipse.swt.events.SelectionEvent; import org.eclipse.swt.layout.FillLayout; import org.eclipse.swt.layout.RowLayout; import or...

Is there a way to enable double buffering for SWT components?

In the Eclipse RCP application I'm building, I noticed that when I rebuild parts of the GUI (by adding/removing controls), the GUI gets updated and redrawn immediately upon each modification, which causes a flicker effect. Is there a way to enable double buffering, so that the GUI refresh will happen only once at the end of the event di...

How to wire up an editor to the location cursor icons?

I have built a graphical editor as an Eclipse plugin. Users may zoom into and pan about the graphical image. I would like to employ the Back and Forward arrow icons in the Eclipse icon bar to step back and forth through the graphical image, in a similar manner to what is already possible in textual editors. All of my references go quiet...

SWT: Getting notified of a system device change (USB device connection / disconnection)

I'm writing an SWT application which needs to sit in the system tray and pop up automatically whenever the user connects some USB device (the application serves as its control panel). The way to do this in the native environment (win32 in this case, but I should be platform-independent ultimately) is to listen to the WM_DEVICECHANGE eve...

How can I hide a CTabItem in a CTabFolder

I can't find any method for making a tab invisible or otherwise hidden in an SWT/JFace application --- I want a second tab to be available (or not) based on some other preferences set by the user. It shouldn't be so hard to figure this out! ...

JFace: Resizable tooltip with ColumnViewerToolTipSupport

Hi, Can anyone show me how to use org.eclipse.jface.viewers.ColumnViewerToolTipSupport to create a tooltip similar to the one shown in Eclipse IDE when you hover your mouse to any Java element? That is, I want the tooltip to be resizable, I also want to hook an F2 key to show the tooltip on demand in addition to mouse hover. I have ...

Eclipse SWT - Java Programming Dilemma

I am writing an Eclipse Plugin that opens a file and displays all the images contained within the file. This image display is part of a GUI application. Each image is rendered by associating it with an SWT Canvas widget. When I open the file I have all the information I need to determine the number of images I will have to display. I...

How Do I Utilize An SWT Horizontally Scrolled Composite Using GridLayout?

I have an plugin that displays a composite with a horizontal scrolled bar. I can't figure out how to get GridLayout() to position each widget one row, one after another. If the number of widgets exceed the composite width, you should be able to scroll right to see the rest of the widgets. The horizontal scroll bar appears, but has no ...

Eclipse SWT Virtual Composite Question

Is it possible to create a virtual composite using SWT, i.e. one could scroll horizontally or vertically beyond the maximum display area of the composite? I want the length and height of my widgets (images) to stay constant regardless what size the composite is changed to. If there are 50 images to display and only 10 can be viewed at ...

Eclipse SWT: How Can I Get My Widgets Displayed The Way I Want?

I have created a class by subclassing SWT Canvas. The class (SceneImage) contains two standard SWT Widgets: Image Label The class code follows: class SceneImage extends Canvas { private int sceneNumber; private IFrame sceneFrame; private Image sceneImage; private Label sceneLabel; /** * @param...

Eclipse RCP, SWT, JFace: How to create a dialog that is modal only to a view (not the entire shell)?

Hi there, Is there anyway to create a dialog that is modal to a view and not the entire shell (application)? So if say, I have one view called A that is overlaying another view called B, I want to open a dialog that is only modal to view A, so when I switch to view B, the dialog and the view A will be covered by view B. Is there anywa...