swt

How to set a Mask to a SWT Text to only allow Decimals

六眼飞鱼酱① 提交于 2019-11-29 14:57:44
What I want is that the user can only input decimal numbers on a Text, I don't want it to allow text input as: HELLO ABC.34 34.HEY 32.3333.123 I have been trying using VerifyListener, but it only gives me the portion of the text that got inserted, so I end up having the text that I want to insert and the text before the insertion, tried also combining the text, but I got problems when you delete a key (backspace) and I end up having a String like 234[BACKSPACE]455. Is there a way to set a Mask on a Text or successfully combine VerifyEvent with the current text to obtain the "new text" before

Context menu for TreeViewer based on selected node - SWT

浪子不回头ぞ 提交于 2019-11-29 13:24:17
问题 I need to create a context menu for a TreeViewer in an Eclipse plugin project. But, the menu should not contain constant items, they should vary depending on the type of the node that is selected. For example, my treeViewer has the following hierarchy: Node A | --Node B | --Node C For node A - I want to show a menu with an action, but for nodes B and C I don't want to show anything (no menu). I managed to create the menu for node A, but then I can't get rid of it when some other type of node

SWT Browser widget: html source inside jar?

时间秒杀一切 提交于 2019-11-29 11:47:49
I want to implement a help system for my tiny SWT desktop application. I've thought about a SWT browser widget containing a single html markup page and a set of anchors to navigate (there are only very few things to explain). Everything works fine, but how do I load the html file from a jar? I know about getClass().getClassLoader().getResourceAsStream("foo"); , but what is the best practice when reading from the input stream? The answer to Load a resource contained in a jar dissuades using a FileInputStream . Thanks in advance Well, I found a rather simple solution that obviously just works:

Swing versus SWT

有些话、适合烂在心里 提交于 2019-11-29 11:09:10
What criteria should I use to choose between SWT and Swing? I assume they both provide satisfactory GUI performance and platform availability. My personal criteria currently include: layouts/layout managers; data binding; pre-built controls; ease of development. My criteria to choose between SWT and Swing: quality and availibility of documentation (docs, books, tutorials, snippets) number of custom components (both commercial and free) quality and availibility of development tools like RAD window builder, platform for automate gui testing..etc. native look and feel vs custom look and feel

Build multi-platform executable for a SWT application using maven

我只是一个虾纸丫 提交于 2019-11-29 10:58:29
My question is: How can I generate multiple executable Jar files (incl. dependencies) for a SWT application according to the target os/architecture at once using maven? I have created a SWT application, which have to run on different operating systems and architectures. The project is a Maven multi-module project including a parent POM. project-pom.xml (packaging = pom, specify SWT dependencies) `- application-module (inherit SWT dependencies) `- pom.xml (packaging = jar) `- domain-specific-module `- pom.xml (packaging = jar) `- utils-module (inherit SWT dependencies) `- pom.xml (packaging =

Tab between fields in TableViewer

回眸只為那壹抹淺笑 提交于 2019-11-29 10:46:06
What I'd like to do is be able to tab between elements in table. I currently am creating my table like this. this.tableViewer = new TableViewer(parent , SWT.FULL_SELECTION); tableViewer.setUseHashlookup(true); table = tableViewer.getTable(); GridData gridData = new GridData(GridData.FILL_BOTH); gridData.grabExcessVerticalSpace = true; table.setLayoutData(gridData); table.setLinesVisible(true); table.setHeaderVisible(true); ... /** Create the Cell Editor Array - will hold all columns **/ editors = new CellEditor[table.getColumnCount()]; /** Cell Editor Row 1 **/ /** Set the column properties **

How to add org.eclipse.swt (and other plugin dependencies) as an automatic Java9 module?

依然范特西╮ 提交于 2019-11-29 08:13:34
In order to be able to use my Eclipse plugin "treezCore" also as a Java9 module I created a module-info.java in my src folder. Furthermore, I moved the Plug-in Dependencies from the Classpath to the Modulepath. I can see a module "org.eclipse.swt.3.106.1.v20170926" in the plugin dependencies: However, I am not able to reference that module in my module-info.java. I tried require org.eclipse.swt.3.106.1.v20170926; require org.eclipse.swt; require swt; None of those options worked. The jar file \plugins\org.eclipse.swt_3.106.1.v20170926-0519.jar that is used by Eclipse does not contain a module

Problems with loading resources during execution

北战南征 提交于 2019-11-29 07:34:17
Here's the background of the underlying problem, I am collaborating with a group on a project which uses Swt libraries and I am trying to package the software for deployment. As it turns out SWT is very platform/architecture dependent. I would like to be able to package all six jar s (linux, mac, win and 32/64-bit) into the same package and use the appropriate library depending on the system. I realize that it is a tough challenge however, switching to Swing (or anything else) isn't really an option right now. I have found a number of relevant threads ( @Aaron Digulla's thread and @mchr's

Can't put content behind SWT Wizard Help Button

北慕城南 提交于 2019-11-29 07:28:49
I created a SWT based Wizard which has an own help Button by custom. Now i want to put some content behind that, so maybe a SWT browser will be openend and a predifined HTML Doc will be shown. But I don't have any clue where to access the Actions of the Help Button within my Wizard. Any idea? I am assuming that you are using the standard JFace interfaces and classes for the wizard implementation. So, in your wizard page ( extending org.eclipse.jface.wizard.WizardPage ) you just have to override the performHelp method. See the below snippet. @Override public void performHelp() { Shell shell =

How to use log4j in an Eclipse RCP?

十年热恋 提交于 2019-11-29 07:03:04
How to use log4j logging API in an Eclipse RCP project? As a workaround U tried to create a new OSGI Bundle which has a log4j jars, below is the bundle structure: I've crated a basic RCP application with a view (template) named loggingtest .I've included the bundle log4j in the dependencies tab of loggingtest project.In the Activator start method i placed the following code Logger logger = Logger.getLogger(Activator.class); logger.info("Info starting"); logger.warn("Warning starting"); logger.error("Error starting"); so everything is fine so far I'm able to use log4j API and half way through,i