swt

error at building libjingle on Mac OS X 10.7.2 like “error: string.h: No such file or directory”

烈酒焚心 提交于 2019-12-20 06:09:42
问题 I failed to build libjingle on Mac OS X 10.7.2. The output was the following when I run $path_to_swtoolkit/hammer.sh according to the README of libjingle. MBP17:talk rei25$ ~/Desktop/swtoolkit/hammer.sh scons: Reading SConscript files ... scons: warning: The build_dir keyword has been deprecated; use the variant_dir keyword instead. File "/Users/rei25/Desktop/swtoolkit/site_scons/site_init.py", line 203, in BuildEnvironmentSConscripts scons: done reading SConscript files. scons: Building

JFreeChart: Add and sync a srollbar when zooming a chart (Eclipse plugin / SWT)

不问归期 提交于 2019-12-20 05:35:18
问题 I am using JFreeChart library to plot something in an Eclipse view and currently my code for view initialization looks as follows: @Override public void createPartControl(Composite parent) { JFreeChart chart = null; // Created via different object chart = graph.createLineChart("Test Graph", "x", "y"); ChartComposite frame = new ChartComposite(parent, SWT.NONE, chart, true); frame.setRangeZoomable(false); parent.layout(true); } I wanted to add scrolling to my graph when the user zooms in, but

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

How to be notified that a composite's child received/lost focus?

跟風遠走 提交于 2019-12-20 02:34:10
问题 I have an SWT Composite that I need to pass to some other code which will add children to it at will. Is there any way to be notified that a child of the composite received and lost focus? Just to make sure it's clear, I cannot add listeners to each child, because I'm not in charge of creating those controls. A child could be added at any time. 回答1: As noted by Favonius, you can hook layout events like SWT.Resize to determine when you're being painted and recompute your child hierarchy,

SWT ScrolledComposite cutting off information.

若如初见. 提交于 2019-12-20 01:45:50
问题 I'm making an application that has many lines of data coming back from a Database stub(which will become an Oracle database), and for some reason the scroll bar stops at about the 500th element. I'm wondering if there's anyway to have all the elements show within the scroll bar. 回答1: I'm assuming here that you're using Windows, because there is a fairly general problem with scrollbars on Windows: the maximum value is a short int, 32,768. Therefore, if the height of the inner composite of a

Automatically generate IDs on SWT-Widgets

梦想与她 提交于 2019-12-19 21:23:22
问题 Is there a way to automatically generate IDs on SWT-Widgets so UI-Tests can reference them? I know i can manually set an id using seData but I want to implement this feature for an existing application in a somewhat generic fashion. 回答1: You can recursively assign IDs for all your shells in your application using Display.getCurrent().getShells(); and Widget.setData(); . Setting the IDs Shell []shells = Display.getCurrent().getShells(); for(Shell obj : shells) { setIds(obj); } You have access

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

Fatal error running an SWT application from OpenOffice

孤街浪徒 提交于 2019-12-19 11:29:07
问题 I have an OpenOffice Java addon application. I'm calling SWT from an XActionListener . Loading of SWT is done dynamically using a special class loader. The SWT window displays well, but when I hit the close button of an SWT window I get an error. I'm attaching the error file generated by this error. What is the meaning of this error? My SWT code final Display display = Display.getDefault(); final Shell shell = new Shell(); shell.setLayout(new FillLayout(SWT.VERTICAL)); shell.setSize(500, 375)

Java Observer/Observable pattern does not Notify

ε祈祈猫儿з 提交于 2019-12-19 10:49:14
问题 I am trying to build a simple Java application with SWT using the MVC pattern. I would like to be able to automatically update the view when something happens in the background so I am trying to use the Observer/Observable pattern, but it looks like my Observer is never notified when my Observable changes. Here is the code: Launcher.java (main class) public class Launcher { public static void main(String[] args) { Application app = new Application(); PenguinView v = new PenguinView(app);

SWT Global KeyListener Button Focus Problem

北城以北 提交于 2019-12-19 09:59:09
问题 for my app I need the space key to call a function independent from the focused widget, everywhere in the app but only if the according tab is opend. I found that one can add a filter to the display, like this: getShell().getDisplay().addFilter(SWT.KeyDown, new Listener() { public void handleEvent(Event arg0) { if( arg0.character == 32 ) { /**SPACE*/ if( mainTabs.getSelection().equals(analyseSoundFilesTab)) { soundController.playButtonClickHandler(); } } } }); That works fine most of the time