View visible across perspectives - eclipse

I have an Eclipse RCP application that defines multiple perspectives. The default perspective allows opening views (through the showView method) that are not defined in the IPerspectiveLayout class.
When switching to another perspective, these views disappear as they belong to the default one.
Is there a way of making these views persistable through perspective changes?

AFAIK there is no way to do that in RCP other than to declare a view as "sticky". But the sticky views have their limitations, use it with great care.
http://help.eclipse.org/indigo/index.jsp?topic=%2Forg.eclipse.platform.doc.isv%2Freference%2Fextension-points%2Forg_eclipse_ui_views.html
A sticky view is a view that will appear by default across all
perspectives in a window once it is opened. Its initial placement is
governemed by the location attribute, but nothing prevents it from
being moved or closed by the user. Use of this element will only cause
a placeholder for the view to be created, it will not show the view.
Please note that usage of this element should be done with great care
and should only be applied to views that truely have a need to live
across perspectives.

The view won't appear in the perspective, unless you define, that the view belongs to this perspective, while creating perspective layout or unless user opens it in the, using some action. So, you have to consider adding view placeholders to the perspective layout, see org.eclipse.ui.IFolderLayout.addPlaceholder(String viewId) method.

Related

Tabless NSTabViewController

I am trying to learn some programming for Mac and therefore I am trying to program a small single window application with a navigation located in a sidebar. Via this sidebar buttons I want to change the view that is presented in the Container View. I uploaded my current storyboard below so that you can get an overview of the description above.
Overview:
Since I am currently trying to implement exchanging the views inside the Container View I stumbled over the NSTabViewController class that seemed to provide a convenient way to achieve this. The problem with it is that it doesn't seem possible(couldn't find any hints) to remove the given tab control via the tabstyle attribute like in the NSTabView class.
Questions:
Is it possible to get rid of the default tab control so that it is tabless?
Is there an easier more modern approach of achieving my described 'application'
You can set the style of the tab view to tabless in Interface Builder:
Then your items on the left could control which tab should be selected.

How to get the present object in an Eclipse RCP view?

I'm starting with the coding of an Eclipse RCP and be relatively new to the RCP-World.
Currently i have one perspective with two views. One is a list with a tableViewer which shows a few names of workers.
The second view is a "single view" with a few textboxes. I use the ISelectionListener to notify when i have selected another entry in the list, so i can set the text boxes in the "single view" wiht the current selected worker objetc.
I didn't wrote the code on my own, and i used this page (Vogella) to learn all the stuff behind RCP.
My question is: How can i get the current Object showed by the active view? I mean, i have it
because of the SelectionListener, but i want to click on my own "save"
button to update changes to the object.
I want the object in the single view, so do i need another change listener, or is the object stored in the view and can i get it with the ISelection Interface?
Can someone tell me in one or two sentences how it works? Or is it
just too simple, because i couldn't find anything elsewhere.
This can be done, but is not very easy, because the behaviour is not very standard. You are treating the two views as one usually deals with linked controls of a dialog or window. That's not necessarily wrong, but i smells bad (I cannot recall an example in the Eclipse IDE). Are you sure you are not confusing the roles of Views and Viewers? A View, in Eclipse, is a "Part" of a Workbench (you have basically Views and Editors), each view shows information and/or performs actions, but they are typically quite decoupled, you should be able open and close freely and independently each View, they rarely interact with each other directly (they typically display information or modify objects in the workspace). Further, you should not have a "Save" button in a View (again, look at the Eclipse IDE as an example), changes done throught a view should be direct.
It is very doubtful for me that your design here in sound, perhaps you should instead use a single View, or a dialog. I suggest you to read more about Views.

rcp application how to forbid the lazy loading of view in a folder layout

I have a perspective containing a top view and a folder with two stacked views:
The views in the folder all need to update when a selection is made in the top view. This is accomplished by adding a selection listener. However, only the view that is actually shown reacts on the selection. When I select another view, it is still empty.
The code that adds the selection listener is placed in the view's init() method and apparently this is only called for the first view in the folder when the perspective is loaded.
Is there a way to switch off this "lazy loading" so that all views are created (and their init() method called) when the perspective is created?
Thanks in advance for any help,
This is not a bug, it is a feature.
Eclipse greatly benefits from this behaviour as not all plugins/views/etc. are loaded as long as they are not really needed. This is the reason why your listeners are that lately registered (as soon as the view content is really created).
But back to your problem:
You could try to create/activate all of them manually.
Simply call
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().showView(<ViewID>)
for every one of them.
If they are not activated and brought to front (but shown in the backround of the stack) then take a look at the overloaded showView() method with secID (can be null) and an additional specific mode flag.

Programmatically select menu item for mvvm prism application using Telerik RadMenu

Hello I have a prism/mvvm style application and am using the RadMenu control. I also have a view/view model pair in one project and another view/view model pair for my RadMenu control in another project. Basically I would like to use the event aggregator to send an event to the view model for the RadMenu (the view model that is paired with the view that the RadMenu sits inside of). So that the RadMenu's view model can notify the RadMenu to switch to a different RadMenuItem programmatically. I think I can use a blend behavior to contain the behavior I'm looking to reproduce, but I cannot find a method in the RadMenu that will allow me to programmatically select a specific menu item.
If the control does not support this now, is there a work around? Thanks.
I believe this is a missunderstanding. As far as I know there is no selection on the RadMenu. You can only Check or Uncheck Items in your Menus. Are you trying to emulate a user clicking on a specific item just to trigger the functionality behind the menu-item? If that's the case I would propose another way and directly handle the EA-Message in the ViewModel. You can trigger the code from there then. If you're doing MVVM the logic behind the menu-items is implented in your VM anyways. :)

In Xcode 4 which is the better app Window based or view based?

I am very new to iOS development. I am going to start a new project which is mostly related to to the database. Can you suggest what should I start from Window or view based app?
A view-based app only have one view, and includes a nib. However, window based app don't include a nib or a view, it's for add your own view.
I would chose view-based
1.There is no such difference in both
In View Based app you will get a default view controller in window.
In Window Based app you will not get anything by default already added in window, you have to add your own view.
They're used for different things. Neither is better than the other.
If you're a total rookie, I'd go with View based. It comes wired up with more stuff for you by default, and lets you work on your app's functionality rather than the details of getting stuff on the screen. It also limits you in ways that Window based doesn't, but for your level that's probably a good thing.
Anyway you have to make ViewController if you make project using window based.
Make your project using window based and View based. and compare both. So you can find what is different.
and iOS can have many view on only one window.