swt

What am I doing wrong regarding this SWT Layout?

浪子不回头ぞ 提交于 2019-12-25 00:57:08
问题 I'm trying to show a simple window in SWT. I want to divide the window into two equal parts, in the left area the user will provide his input, and the right area will show the result of the output. Specifically, the user will type in some characters in the left area (in a textbox), these will be reflected in a label below the textbox. When the user clicks a 'Process' button, a screenshot of just the label control will be taken using Awt.Robot.createScreenCapture . I want to display this

changing the logo of wizards of special plugin

懵懂的女人 提交于 2019-12-25 00:53:23
问题 When I set the logo for my java plugin, the logo of other windows of eclipse are changed. I have a class which extends Wizard and implements IObjectActionDelegate . Then, I have override the run function and write the below code in it. wizard = new StartWizard(); dialog = new WizardDialog(Display.getDefault().getActiveShell(), wizard); Bundle bundle = Platform.getBundle("Plugin"); URL url = FileLocator.find(bundle, new Path("icon/Logo.png"), null); ImageDescriptor desc = ImageDescriptor

Set the checkbox of a CheckboxTableViewer when the row is clicked

百般思念 提交于 2019-12-24 22:17:46
问题 I am very new to SWT. Started working on it today actually. I have a table of type CheckboxTableViewer. What i want to be able to do is whenever the user selects the row (i.e clicks anywhere on the row) I want the check box to be checked (ticked). Currently I have a listener on the CheckboxTableViewer as follows: diagnosesTableViewer.addCheckStateListener(new ICheckStateListener() { @Override public void checkStateChanged(CheckStateChangedEvent event) { Nomenclature changedStateNomenclature =

SWT: Table lost selection

被刻印的时光 ゝ 提交于 2019-12-24 19:47:15
问题 I have a Table like below, but when table lost focus (click some button for example), selection lost too. How to avoid this ? Table table = new Table(group, SWT.BORDER | SWT.FULL_SELECTION); table.setLinesVisible(true); table.setHeaderVisible(true); table.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent arg0) { onSelection(); } }); row selected: selection lost: 回答1: Ahh, so your table does not show the selected row when the table does not have

SWT on Mac OS X: Change dock program name

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-24 19:33:57
问题 I have a Java SWT program on Mac OS X that always shows 'java' when the mouse hovers over the dock icon. Is there a way to change 'java' to a more suitable program name? 回答1: This is controlled by a system property: -Xdock:name=AppName 来源: https://stackoverflow.com/questions/7947595/swt-on-mac-os-x-change-dock-program-name

How to enable scroll when CheckboxTableViewer inside a ScrolledComposite is disabled?

喜欢而已 提交于 2019-12-24 19:14:09
问题 I have got a CheckboxTableViewer inside a ScrolledComposite. I have to enable or disable all the tableItems based upon the another checkBox button. To do this, I am using CheckboxTableViewer.getTable().setEnabled(false). In the above case, the ScrolledComposite is also disabling along with the table. But I want the scroll behaviour to work as-usual even when CheckboxTableViewer is disabled (all the items in the able are disabled). 回答1: It's not possible to make the table control show

GWT + OSX = SWT issues

天涯浪子 提交于 2019-12-24 17:22:46
问题 I'm new to GWT development and I'm putting myself through the paces with Google's tutorial but I'm getting errors: java[10574:80f] [Java CocoaComponent compatibility mode]: Enabled 2009-11-06 15:27:38.769 java[10574:80f] [Java CocoaComponent compatibility mode]: Setting timeout for SWT to 0.100000 I checked my Java prefs and I have Java SE6 (64 bit) as the preferred JVM. I'm really not sure how to clear this up. 回答1: I think gwt hosted mode only works in a 32 bit environment, as of gwt

Showing NatTable context menu

南笙酒味 提交于 2019-12-24 17:22:36
问题 I use NatTable. How to show context menu item on certain condition depending on the content of the cell? And how to select cell over which context menu was called? I bind menu with the following code uiBindingRegistry.registerMouseDownBinding( new MouseEventMatcher(SWT.NONE, null, MouseEventMatcher.RIGHT_BUTTON), new PopupMenuAction(menu)); UPD: I create menu like this, but 'Test' item is visible in spite of isActive always return false . What's wrong with it? menu = new PopupMenuBuilder

SWT - get actual screen position of an image

别说谁变了你拦得住时间么 提交于 2019-12-24 15:55:54
问题 I have drawn an image on a Composite using the following code imageCanvas = new Composite(shell, SWT.BORDER); //adding paintListener to the canvas imageCanvas.addPaintListener(new PaintListener() { @Override public void paintControl(PaintEvent e) { if (sourceImage != null) { // draw the image e.gc.drawImage(sourceImage, 120, 150); //check the bounds of the image using the getBounds function Rectangle newrec = sourceImage.getBounds(); System.out.println("X: " +newrec.x + " Y: "+newrec.y ); //

Is it possible to embed a SWT Composite into a JavaFX scene?

拟墨画扇 提交于 2019-12-24 15:12:47
问题 I know that JavaFX 2.2 provides FXCanvas for embedding new JavaFX components into existing SWT Composites. Is it possible to do it the other way around? My motivation for trying this, is that there are currently some components missing in JavaFX. For example a TreeTable. I want to implement my application in JavaFX, use SWT as a fallback for missing components, and migrate those to JavaFX as soon they are ready. 回答1: no - you can not embedd heavy weight (=SWT) into a lightweight container (