Is there a possibility to set the relative position of a view in eclipse programmatically?
I know, that there is the function
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().showView("org.eclipse.ease.ui.view.ModulesExplorerView");
But I want to specify the relative position of this view, or move this view in a specified Position.
thanks in advance
The position of the view is determined by any placeholder for the view in the current perspective. There is no other way to control where it is displayed.
There is some more information about this is the Eclipse Wiki FAQ Why can't I control when, where, and how my view is presented?
You can do it with Eclipse e4 - but this is a big design change and doesn't support all Eclipse 3.x code.
Related
I have a singular view residing in a view container, and I wish to have one title encompassing them. For instance, this view's default position is in the panel, but when moved to the activity bar in another view container, the title is displayed as [view container title]:[view title]. While this makes sense, it would be nice to display my view as [view or view container title], without a colon expecting a second part. The VSCode standard views like Problems, Output, Debug Console exhibit the wanted behavior. They just display as "Output" or "Problems" when placed in another container, rather than something like "Panel:Output". Is it possible to have a single title with no colon/second part? Thanks.
You may try to use the contextualTitle property of the view. Based on its documentation when launched, it should fit your needs:
https://code.visualstudio.com/updates/v1_46#_flexible-layout
For extension authors contributing views or view containers
When views are moved around the workbench, they sometimes need to be presented differently, either with an icon or extra context if they aren't in their default location. When contributing a view, authors may now provide an icon property and a contextualTitle. If not provided, these will default to the icon and title of the view container to which they are contributed.
I'm not sure they updated the API or updated the behavior since then but, if not, you will probably face the same issue I had while trying to use it. I even opened an issue to the VS Code team (https://github.com/microsoft/vscode/issues/102447), but they marked the issue as designed and I gave up on using it.
Hope this helps
I have implemented Eclipse RCP product in 4.5 (Mars) version. There is a part with toolbar. I want to show the part toolbar always in full span (covering the entire width of the part) and not on the part stack (on right side of the part tab).
I tried to add Part-Toolbar-FullSpan tag to the Part and also to the part toolbar but it is not helping.
I also tried to create a custom toolbar but that approach did not work out.
Do you know how I can show the part toolbar in full span?
Thank you.
Part-Toolbar-FullSpan appears to be for the e(fx)clipse JavaFX stack renderer only so it won't work with SWT.
The SWT stack renderer org.eclipse.e4.ui.workbench.renderers.swt.StackRenderer uses the setTopRight method of CTabFolder to manage the toolbar. This will only push the toolbar on to a separate row when there not enough space for it on the tab row.
So it looks like the only way to do this would be to define a custom renderer factory and override the stack renderer. Unfortunately for what you want this would be a substantial change to the renderer.
I have a GEF editor with draggable figures. I have overriden the createChangeConstraintCommand of the main EditPart's XYLayoutEditPolicy.
This allows me to easily move (drag and drop) the figures.
The problem is, that if I drag one of them outside of the current view, although the scroll appears and the figure is moved, the view does not automatically scrolls to the dropped object.
Any idea how to implement this "auto-scroll" functionality? (It would be even nicer to have the "selected" (dragged/dropped) figure always visible in the view.)
Given the editpart object that has been dropped, you should use EditPartViewer#reveal(EditPart) method. Do this for example:
editpart.getViewer().reveal(editpart)
I'm working on Xcode version 4.4. Couldn't find the way how to change element's(UIView) size more precisely in storyboard. I can drag anchors of element, but It's difficult when elements are small.
Is there any way to change width and height of element by one pixel?
EDIT: Development environment is iOS(not Mac OS).
You can edit a view's position and size in the Size Inspector. Select the view you want to modify, then from the menu bar choose View > Utilities > Size Inspector.
In Interface Builder, you should be able to use the inspector to edit the object's properties.
Check out this link, specifically point 7: http://developer.apple.com/library/ios/#documentation/IDEs/Conceptual/xcode_quick_start/020-Tutorial_Designing_a_User_Interface_with_Interface_Builder/interface_builder_tutorial.html
I do know how to register a View in the Fast views bar within a RCP Eclipse application (using plugin.xml). It opens in Vertical orientation. Does anybody know how to tell this view to open in Horizontal orientation per default?
Thanks a lot for your help.
Not sure if it is available.
Already in 2004, it was mentioned in bug 55830:
We have no plans to expose the "horizontal/vertical" fastview option as API (since this concept might be removed in the future in favor of 2 resize sashes).
And the 2005 question about the same feature went unanswered!
I currently add a fast view to my perspective...
layout.addFastView(IConsoleConstants.ID_CONSOLE_VIEW, 0.35f);
How can I programmatically set this view to default to a horizontal orientation?
I assume this is not possible to do through the API?
THe current IPageLayout doesn't seem to have any parameter for the orientation.