Quick view in eclipse rcp application

How to add a quick view of my eclipse rcp application?

+3
source share
2 answers

You can add the right button, as in this thread :

what can be done by adding a button for the quick view pane and opening the standard view in the button event

Button Button = new Window Button ((Composite) ((Window WorkbenchWindow)). GetFastViewBar (). GetControl (), SWT.PUSH);

To avoid overlapping button events, first create a folder layout for this view with a link to the initial view, and then call an action to add the view.

IFolderLayout ViewLayout1 = layout.createFolder ( "ViewLayout1",
                                                  IPageLayout.BOTTOM,
                                                  0.50f, initalView.ID);
OpenViewAction ov = new OpenViewAction (window, "label", secondview.ID);
ov.run ();

"org.eclipse.ui.views.showView" "org.eclipse.ui.views.showView.makeFast".

. Eclipse RCP: org.eclipse.ui.handlers.ShowViewHandler:

Eclipse org.eclipse.ui.views.showView, .
- org.eclipse.ui.handlers.ShowViewHandler. - , . :

  • ID org.eclipse.ui.views.showView.viewId , ,
  • ID org.eclipse.ui.views.showView.makeFast , .

, .

.

: " ". . :

<command
     name="%command.showView.name"
     description="%command.showView.description"
     categoryId="org.eclipse.ui.category.views"
     id="org.eclipse.ui.views.showView"
     defaultHandler="org.eclipse.ui.handlers.ShowViewHandler">
  <commandParameter
         id="org.eclipse.ui.views.showView.viewId"
         name="%command.showView.viewIdParameter"
         values="org.eclipse.ui.internal.registry.ViewParameterValues" />
  <commandParameter
     id="org.eclipse.ui.views.showView.makeFast"
     name="%command.showView.makeFastParameter"
     optional="true"/>
</command>

ViewParameterValues. .


: ( )

RCP , WorkbenchWindowConfigurer.setShowFastViewBar(false) WorkbenchAdvisor preWindowOpen().
, " " .

+2

RCP- Eclipse . xml ( fast.view) .

<view
    closable="true"
    id="fast.view"
    minimized="true"
    ratio=".30f"
    relationship="fast" <--- This attribute tells the view to be a fast view.
    relative="other.view"
</view>

. ApplicationWorkbenhWindowAdvisor ( , ), preWindowOpen():

IWorkbenchWindowConfigurer configurer = getWindowConfigurer();
configurer.setShowFastViewBars(true);

IWorkbenchWindowsConfigurer, . , , , .

Eclipse Papercuts, : http://www.vogella.de/blog/2009/09/15/fastview-eclipse-rcp/

+2

Source: https://habr.com/ru/post/1743473/


All Articles