Using Eclipse RCP to build an application. I would like the toolbar to be vertical and on the left hand side of the window. So far I managed to make it vertical in the ApplicationActionBarAdvisor.
#Override
protected void fillCoolBar(ICoolBarManager coolBar) {
ToolBarManager toolbar = new ToolBarManager(coolBar.getStyle()
| SWT.HORIZONTAL);
coolBar.add(toolbar);
}
However, it is still on top of the editors and view. I cannot find any way to move it to the left. Does anybody know if it is possible at all and how to do that?
Thanks,
Martin
You can use the extension point o.e.ui.menu, and use the locationURIs "toolbar:org.eclipse.ui.trim.vertical1" for left trim and "toolbar:org.eclipse.ui.trim.vertical2" for the right trim. You can your tool items there.
Also see the contribution examples plugin for more samples: http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.ui.examples.contributions/
Related
Is it possible to set the resize control of an com.smartgwt.client.widgets.Window not only to the bottom and the right but also to the top and the left?
The window Instance is created as follows:
Window window = new Window();
window.setAutoSize(true);
window.setTitle(title);
window.setCanDragReposition(true);
window.setCanDragResize(true);
SmartGWT 6 is in use.
With help of the Isomorphic guys, the solution is as simple as follows:
// https://www.smartclient.com/smartgwt/javadoc/com/smartgwt/client/types/EdgeName.html
window.setResizeFrom(EdgeName.L, EdgeName.T);
Default way to scroll chart is to drag mouse holding right button. I need to scroll with mouse wheel. I haven't found any API to enable/disable mouse wheel scrolling.
I also tried to add MouseWheelListener to the chart itself, but it never gets called.
Is it possible to use mouse wheel in TeeChart lib?
My application is Eclipse RCP using SWT.
The following code works fine for me with TeeChart Java SWT in Eclipse:
Bar bar1 = new Bar(tChart1.getChart());
bar1.fillSampleValues();
tChart1.addMouseWheelListener(new MouseWheelListener() {
#Override
public void mouseScrolled(MouseEvent arg0) {
Axis tmpA = tChart1.getAxes().getLeft();
double tmpInc = tmpA.getRange()/10;
if (arg0.count>0)
tmpA.setMinMax(tmpA.getMinimum()+tmpInc, tmpA.getMaximum()+tmpInc);
else
tmpA.setMinMax(tmpA.getMinimum()-tmpInc, tmpA.getMaximum()-tmpInc);
}
});
I've just started playing with Eclipse RCP.
A few things that I would like to accomplish:
How do I maximize the initial size of the application?
I would like to create a sidebar type view on my left and would like to fix the size of that view and remove any title bar, minimize/ maximize/ close from that side-bar.
Can anyone help me please?
Thank you.
First, some tutorials like Vogella's are a must read ;)
RCP Tutorial
JFace Tutorial
For 1/, this has to do with the IWorkbenchWindowConfigurer, like:
configurer.getWindow().getShell().setMaximized( true );
on postWindowOpen( IWorkbenchWindowConfigurer configurer ) of your WorkbenchAdvisor.
This thread has other alternatives.
For 2/, you can do it declaratively or by program, like this thread shows:
You can do it in plugin.xml, by providing extension to point org.eclipse.ui.perspectiveExtensions by specifying showTitle="false" on the view element.
or You can do it programmatically in Your PerspectiveFactory implementation:
public void createInitialLayout(IPageLayout layout) {
...
layout.addStandaloneView(View.ID, false,
IPageLayout.LEFT, 1.0f, editorArea);
...
}
Sidebar can be create via using viewpart and adjust in perspective using IPerspective in right or left side and given window size.
HI,
I am facing some problem.. I want to hide the menu when eclipse workbench starts.
But the problem is menu is not hiding when the eclipse workbench starts. It is hiding only
when some refresh is happened. for example: when I change the default perspective to some other perspective, I am getting the desired out put. That means menu is hiding.
But when the eclipse workbench is loaded it is not hiding the menu. Below is my code.
PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() {
public void run() {
try {
IWorkbenchWindow window = Workbench.getInstance().getActiveWorkbenchWindow()
if(window instanceof WorkbenchWindow) {
MenuManager menuManager = ((WorkbenchWindow)window).getMenuManager();
IContributionItem[] items = menuManager.getItems();
for(IContributionItem item:items){
System.out.println("item.getId()::: "+item.getId());
menuManager.remove("org.eclipse.ui.run");
menuManager.remove("help");
menuManager.remove("project");
}
}
}`
}
};
Given that you are looking to hide some features, I don't think that this is the best approach. (Not I am using the term feature here in the colloquial way, not as an Eclipse feature.
I would recommend one of two avenues:
Perspectives: See the extension point org.eclipse.ui.perspectives. This allows you to create a new perspective like the debug perspective or the Java perspective. Using a perspective, you can select exactly what menu items and views are shown and which ones are hidden.
Capabilities (aka activites): See the extension point org.eclipse.ui.activities. This allows you to have some fairly fine-grained control over what features are available in the workspace. See more info here: http://wiki.eclipse.org/Galileo_Capabilities
Put Your code in org.eclipse.ui.startup extention point. Make a Startup class after implementing the interface IStartup. For Details follow this link:-
Eclipse plugin : disable/enable dynamically an action from main menubar
I don't know RCP very well yet, but I've been reading a lot of the docs. I don't know if my question makes sense; I apologize if not and beg that you try to work out what I mean and come up with some kind of answer.
I have a tree view element, which has a double click listener on it. In another part of the window there is a layout folder which contains views that are supposed to be inspectors for the items double-clicked on.
The only way I know to make another inspector appear is:
getActivePage().showView(Inspector.ID).
showView() doesn't give any opportunity to pass extra information to the view, so can it know which element to inspect?
Pointers in different directions appreciated. The Vogel tutorial doesn't seem to cover this, or I don't understand it.
You could check if the article "Link to Editor" can help you here.
That is, instead of trying to access the right view, define a Listener for the Editors:
private IPartListener2 partListener2 = new IPartListener2() {
public void partActivated(IWorkbenchPartReference ref) {
if (ref.getPart(true) instanceof IEditorPart)
editorActivated(getViewSite().getPage().getActiveEditor());
}
That way, you can get back the right Editor, and ask that Editor all you need for your View to update accordingly.
You can use the SelectionService. The Inspector view should register as a SelectionListener. And the other view with the tree should register a SelectionProvider. This view should listen for the double click in the tree and then update the selection