rcp

which is the best way to externalize a database configuration on a desktop app?

我的未来我决定 提交于 2019-12-02 09:31:34
I'm working in a desktop app, and we're using Eclipse RCP with EclipseLink. All my database configuration is inside a class, but I'll need these thing (database URL, password, username) configurable. Which is the best way to do that? Easiest way would be to use some simple property file and java.util.Properties to read it. You can read the file from classpath, e.g: Class.getResourceAsStream ("resource.properties"); The standard way is to have a properties (either java.util.Properties or XML) file in which is stored the database details. This can be writeable by the user of course, and

How to load image to view in RCP?

≡放荡痞女 提交于 2019-12-02 05:45:36
I am developing an RCP plugin project that includes certain views.First view take employee details like name , address etc.There is an option to upload employee image using browse button.Second view shows the details that have entered in the first view.All details except photo is displaying fine. It shows a red square in the place of photo label. My code for setting photo is shown like this : Label photoLabel = new Label(parent, SWT.NONE); photoLabel.setBounds(420, 233, 100, 106); photoLabel.setImage(SWTResourceManager.getImage(FormDataViewClass.class,photoUploadPath)); where photoUploadPath

JFace DialogCellEditor: how to make buttons always appear?

本秂侑毒 提交于 2019-12-02 02:05:44
I use JFace DialogCellEditor to show a button in a cell of a row of my JFace TableViewer which triggers a dialog when activated. This behaviour works well with the following code but the button only appears when the cell of the table hosting the button is explicitly selected. public class CompareDialogCellEditor extends DialogCellEditor { public CompareDialogCellEditor(Composite parent) { super(parent); } @Override protected Button createButton(Composite parent) { Button button = super.createButton(parent); button.setText(""); button.setImage(AbstractUIPlugin.imageDescriptorFromPlugin

Why does my application requires admin priviliges when placed in C:\\Program Files on windows 10 but not on windows 7?

自古美人都是妖i 提交于 2019-12-02 01:37:26
My Java RCP application ( App.exe ) was recently converted from 32-bit to 64-bit . Since it is a 64-bit application i have used NSIS to create an installer which will dump all the required files along with App.exe in C:\Program Files. When the App.exe is run, i am getting a security exception(Access denied) when the application tries to open files (in C:\Program Files) in edit mode to dump the results/logs. When i run App.exe as administrator it works fine. It also works fine in windows 7 64-bit machine even when run in non-admin mode. Any idea, as what to do to run App.exe in non-admin mode ?

Eclipse RCP MessageConsole: How to allow user to input and handle this listener?

只愿长相守 提交于 2019-12-02 01:21:06
I'm writing an eclipse-plugin which creating a new Console. Please see my source code: IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage(); IConsoleView consoleView = (IConsoleView) page.showView(IConsoleConstants.ID_CONSOLE_VIEW); MessageConsole myConsole = new MessageConsole("CLI", null); ConsolePlugin.getDefault().getConsoleManager().addConsoles(new IConsole[] { myConsole }); consoleView.display(myConsole); MessageConsoleStream stream = myConsole.newMessageStream(); stream.println("Hello World"); The Console "CLI" appeared, but it is not editable by

How to position a Handled Tool Item to the right

你离开我真会死。 提交于 2019-12-02 00:44:11
I've an application built on eclipse e4 framework. I want to position a Handled Tool Item to the far right end. How can I achieve it? You need to use two 'Toolbar' entries with a 'Tool Control' between them: so something like: In the Tags for the Tool Control add the word stretch this will make the trim bar manager stretch out the control to use all available space pushing everything after it to the right: The class for the control can something simple like: public class SpacerControl { @PostConstruct public void postConstruct(Composite parent) { Composite body = new Composite(parent, SWT.NONE

Use org.eclipse cut/copy/paste in custom RCP application

谁说我不能喝 提交于 2019-12-01 20:53:49
问题 I am developing a RCP application and I need cut/copy/paste in this app. As there are already commands which are delivered by eclipse (org.eclipse.ui.edit.copy, ...) I want to use them (I already added them to the toolbar, e.g.) in an editor. I played around a little, but I don't get it how I can react to the copy/paste command. E.g. how do I get informed in an editor if something was copied or pasted? Is there an easy way to use the commands like the Save Command. There I just have to

Xuggle and java library path

隐身守侯 提交于 2019-12-01 12:37:43
I'm writing a screencast application in Java. I decided to use Xuggle to do it and I followed up the installation instructions on the xuggle wiki. I set up the PATH environment with %XUGGLE_HOME%\bin and %XUGGLE_HOME%\lib. Everything seems OK. I made this application as a RCP plugin. I tried it on the "RCP-mail" template and the plugin is working and the video is generated correctly. But when I decided to use it on a "real" application, the plug-in crashed with a strange error message: Starting Capture 2011-11-10 08:08:45,438 [Thread-5] WARN com.xuggle.ferry.JNILibraryLoader - Failure: library

How to set the Caret of the IOConsole

做~自己de王妃 提交于 2019-12-01 09:32:01
I'm writing an eclipse-plugin which creating a new Console. Please see my source code: CliConsoleFactory.java import java.io.IOException; import org.eclipse.jface.text.DocumentEvent; import org.eclipse.jface.text.IDocument; import org.eclipse.jface.text.IDocumentListener; import org.eclipse.ui.IWorkbenchPage; import org.eclipse.ui.PartInitException; import org.eclipse.ui.PlatformUI; import org.eclipse.ui.console.ConsolePlugin; import org.eclipse.ui.console.IConsole; import org.eclipse.ui.console.IConsoleConstants; import org.eclipse.ui.console.IConsoleFactory; import org.eclipse.ui.console

How to make an eclipse partstack not disappear when the last part is closed?

不打扰是莪最后的温柔 提交于 2019-12-01 08:10:30
I'm working on a project with a main window consisting of a mpartstack where I add parts dynamically from another part. The problem is that when the last part gets closed the mpartstack disappears and the other part takes up all the space. When I try to add new parts nothing happens. I've tried fiddling around with the preDestroy function in the parts that are added to the stack by trying to add a new part. The preDestroy works occasionally but far from satisfactory. I've looked far and wide to try to find any clue on what to do but I've found nothing except for some bug reports on the matter.