I need to open multiple view from a same view class with different data.
For more detail. I have TreeViewer with six TreeParent. Now, when I select one parent my application will show a view and if I click other one that will not show anymore. Now I want show view for each tree item I clicked.
Any suggestion?
My current code:
viewer.addSelectionChangedListener(new ISelectionChangedListener() {
@Override
public void selectionChanged(SelectionChangedEvent event) {
// TODO Auto-generated method stub
ITreeSelection iTreeSelection = (ITreeSelection) viewer
.getSelection();
Object firstElement = iTreeSelection.getFirstElement();
try {
IWorkbenchWindow iWorkbenchWindow = PlatformUI
.getWorkbench().getActiveWorkbenchWindow();
View.setTree(firstElement);
iWorkbenchWindow.getActivePage().showView(View.ID);
} catch (Exception e) {
// TODO: handle exception
}
}
});`