e4

Opening a new Window with Java RCP and SWT

末鹿安然 提交于 2019-12-11 09:26:38
问题 I'm currently developing an app, and for this, I'm using Java RCP with SWT. What I want : I have a window, and when I click on a Button, i need a whole window to be opened. The window works perfectly and looks like this : Window1 When I press it, a new window opens. It looks like this : Window2 (Yup, the middle pic has its importance) How it's currently done : The Window 1 is a TrimmedWindow done with the Application.e4xmi, with some Parts in. The button is included in one of these parts.

How do I set the height or width of TrimBar?

萝らか妹 提交于 2019-12-11 09:07:44
问题 I have a TrimBar which configured as below How can I change the TrimBar width or height ? 回答1: The TrimBar adjust to accomodate its contents. You can add margins around the contents using CSS like: .MTrimBar ToolBar { margin-left: 8px; margin-right: 8px; margin-top: 5px; margin-bottom: 5px; } 来源: https://stackoverflow.com/questions/29838167/how-do-i-set-the-height-or-width-of-trimbar

How to reset perspective programmatically in Eclipse RCP E4 not E3

寵の児 提交于 2019-12-11 09:03:22
问题 I just added 2 perspectives in my RCP App. I can switch from one to another without problems. But I didn't find a way to reset perspective, for example if I close a Part excidently I need to reset my perspective. PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().resetPerspective(); this didn't work because I use E4. -clearPersistedState -persistState false is not a solution cause I need to reset without restart my App. 回答1: Use the resetPerspective method of EModelService :

Eclipse e4 RCP SourceViewer syntax coloring

我怕爱的太早我们不能终老 提交于 2019-12-11 05:18:03
问题 To implement syntax coloring in an eclipse e4 RCP application, I have created a basic plugin project with a Part including a SourceViewer control. public class SyntaxColoringTest { /** The SourceViewer control to create the editor. */ public SourceViewer sv = null; @Inject public SyntaxColoringTest() { } @PostConstruct public void postConstruct(Composite parent) { IVerticalRuler verticalRuler = new VerticalRuler(10); OverviewRuler overviewRuler = new OverviewRuler(null, 20, null); sv = new

Editors with many widgets have horrible performance

心已入冬 提交于 2019-12-11 04:55:19
问题 We switched to e4 target platform. One editor has became horrible slow with rendering (about 20 seconds to layout). When a modal dialog is opened from the editor-menu, the application flickers like having an epileptical fit. When we turn off css, by ... DefaultScope.INSTANCE.getNode("org.eclipse.e4.ui.workbench.renderers.swt") .put("themeEnabled", "false"); in the plugin, the rendering is very fast (<10ms), like it used to be under the previous target platform. this is the control that i have

What is the right way to update a table view in a Part in a Eclipse RCP project?

半城伤御伤魂 提交于 2019-12-11 04:21:46
问题 Say I have a ItemListPart class in my RCP project, and there is a table to be displayed in it as following: import java.util.List; import javax.annotation.PostConstruct; import org.eclipse.e4.ui.di.Focus; import org.eclipse.swt.SWT; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Table; import org.eclipse.swt.widgets.TableColumn; import org.eclipse.swt.widgets.TableItem; public class

Eclipse e4 tool Control in trimbars

你说的曾经没有我的故事 提交于 2019-12-11 03:02:05
问题 I want to create combobox in trimbars. So I started with adding a text box. I created TrimBars->WindowTrim->Toolbar->Tool Control I mentioned Class URI also public class SearchToolItem { @PostConstruct public void createControls(Composite parent) { parent.setLayout(new GridLayout()); final Composite comp = new Composite(parent, SWT.NONE); comp.setLayout(new GridLayout()); Text text = new Text(comp, SWT.BORDER); text.setMessage("Search"); text.setToolTipText("search"); System.out.println("i am

How to implement IWindowCloseHandler in Eclipse (e4) RCP?

喜夏-厌秋 提交于 2019-12-11 01:56:35
问题 How can I implement IWindowCloseHandler in order to display a MessageDialog before closing the application ? Here is my code : EDIT public class LifeCycle { @PostContextCreate public void postContextCreate() { // TODO start up code here System.out.println("open"); } @ProcessAdditions void processAdditions(MApplication app, EModelService modelService) { WindowCloseHandler closeHandler=new WindowCloseHandler(); MWindow window = (MWindow)modelService.find("uploadcenter.source.trimmedwindow.0",

Opening multiple instances of an MTrimmedWindow complete with perspectives etc

橙三吉。 提交于 2019-12-10 18:58:29
问题 I have defined a "main window" for my RCP app as MTrimmedWindow with perspectives, parts etc., as usual, within the Application.e4xmi. Is it possible to open additional instances of this main window programmatically? Similar to the creation of parts from MPartDescriptors? Unfortunately only parts seem to have descriptors. I would need something like an MTrimmedWindowDescriptor (complete with content descriptors, e.g. MPerspectiveStackDescriptor) to create the model from. It is not known in

Updating UI contributions on Handler switch in e4 application model

喜你入骨 提交于 2019-12-10 13:28:35
问题 I have defined a command global to my e4 application, namely the add command. So, as you can see in the command is to used throughout the application (1) and to the repsective handler to be activated on context switch to the resp. parts in (2) and (3). Now what I am missing, is the possibility to update all UI contributions like (4) allocated to command (1) with the information such as in (2) add contact, and when switching to (3) add account. What is the general recommended way to update all