eclipse-rcp

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

How to add Swing component to SWT?

不想你离开。 提交于 2019-12-10 13:25:46
问题 I want to add a Swing component ( JTree ) to my code which employs SWT. Is there any way by which we can accomplish this? I know that we have TreeViewer component in SWT/Jface, but i have got an already developed Jtree implemenatation and would like to add that, instead of rewriting using TreeViewer. 回答1: You can use the SWT/AWT Bridge. Composite composite = new Composite(parent, SWT.EMBEDDED | SWT.NO_BACKGROUND); Frame frame = SWT_AWT.new_Frame(composite); The SWT_AWT.newFrame(Compisite)

RCP Command with object argument

自闭症网瘾萝莉.ら 提交于 2019-12-10 13:24:43
问题 I want to call an RCP command in code, like this: IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow(); IHandlerService handlerService = (IHandlerService)window.getService(IHandlerService.class); handlerService.executeCommand(cmdID, null); With considerably more code, I can call the command with a string argument by assembling a Parameterization object then building a ParameterizedCommand and so forth but Paramaterization only allows for string values, and can't be

Why do I need to escape unicode in java source files?

二次信任 提交于 2019-12-10 12:34:14
问题 Please note that I'm not asking how but why. And I don't know if it's a RCP specific problem or if it's something inherent to java. My java source files are encoded in UTF-8. If I define my literal strings like this : new Language("fr", "Français"), new Language("zh", "中文") It works as I expect when I use the string in the application by launching it from Eclipse as an Eclipse application : But if fails when I launch the .exe built by the "Eclipse Product Export Wizard" : The solution I use

Horizontal Scrollbar is not working under composite inside a CTabItem

两盒软妹~` 提交于 2019-12-10 12:17:05
问题 I have CtabItem inside which, there is a Composite widget. Then, I have added a few components inside it. The code goes like this - Composite composite = new Composite(tabFolder, SWT.H_SCROLL); tabItem.setControl(composite); Label lblName = new Label(composite, SWT.NONE); lblName.setBounds(10, 28, 55, 15); lblName.setText("Name"); textName = new StyledText(composite, SWT.BORDER); String myText = tree.getSelection()[0].getText(); textName.setText(myText); Point textNamesize = textName

Why adding org.slf4j.api to dependencies causes Application not found in the registry error?

点点圈 提交于 2019-12-10 12:02:14
问题 I am absolutely don't understand if there is any logic in RCP behavior. I am experimenting with logging inside views. My application was running fine until I added dependency on org.slf4j.api Nothing else was changed in the code. But this dependency change caused that absurdic error !ENTRY org.eclipse.osgi 4 0 2014-01-10 17:25:08.072 !MESSAGE Application error !STACK 1 java.lang.RuntimeException: Application "Try_EclipseRCPView_03.application" could not be found in the registry. The

Embed Jetty in Eclipse RCP

久未见 提交于 2019-12-10 11:49:23
问题 I am building a RCP application , where I need to monitor http traffic and show it to user. For that I require use of Embeded Jetty as transparent proxy. I tried everything , followed this Tutorial But things just don't work. I get build exception. I tried adding Jetty jar as external dependency , but still no use. Would appreciate any help. Also please let me know if there are any other ways of achieving this without use of jetty. (I tried Socks but it conflicts with RCP UI thread) Thank You

How to check access level of user on any system

孤街醉人 提交于 2019-12-10 11:44:29
问题 In our RCP application we have newly added a menu as command under menu contributions. Now that we want to enable or disable this new menu depending the user who has logged on to the system. Basically we want to enable the menu only for the Administrator login and not for any other user. How can this be accomplished? Thanks in advance !! 回答1: You can retrieve the logged in user's name as : String user=System.getProperty("user.name"); You can retrieve the logged in user detail as described in

get ITextViewer from IEDitorPart (Eclipse)

﹥>﹥吖頭↗ 提交于 2019-12-10 11:35:17
问题 Eclipse RCP question I open file with: IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage(); IEditorPart editorPart = IDE.openEditor(page, file); I also get document with: IDocument doc = ((ITextEditor)editorPart).getDocumentProvider().getDocument(editorPart.getEditorInput()); I need to get to text viewer of that document (for creating LinkedModeUI), is there any way to do this? 回答1: The following worked for me: IEditorPart editorPart = getSite().getPage(

How can i open a shell without making it active?

天大地大妈咪最大 提交于 2019-12-10 11:16:32
问题 I need to know if there is any way to open a shell and not make it active, even if i click a control in it. The best way to explain what i need is to show you this little example. I need to keep the first shell active, even if i click the second one, or any widget that it contains. public class TestMeOut { public static void main(final String[] args) { final Display display = new Display(); final Shell shell = new Shell(display); shell.setLayout(new GridLayout(1, false)); final Shell shell2 =