[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[news.eclipse.tools.gef] Add new resource to navigator

Hi All,
The kind of feature that I am looking for is this - I am inside an EditPart's performRequest() method. From here I would like to create a new Resource in the navigator view. Somwhow I cannot find any handle to create a new resource. My current code looks like this:


------------------------------------------------------------------------------
public void performRequest(Request req) {
if(req.getType().equals(REQ_OPEN)){
setSelected(SELECTED_NONE);
try{
IWorkbenchPage page = ((DefaultEditDomain)getViewer().getEditDomain()).getEditorPart().getSite().getPage();
IFile newFile = EditorUtils.createNewFile(((Shape)this.getModel()).hashCode()+".eci");
IViewPart navView = (ResourceNavigator)page.findView(IPageLayout.ID_RES_NAV);
deactivate();
AppEditor editorPart = (AppEditor)IDE.openEditor(page,newFile,"appedit",true);
editorPart.addPageSequence((PageSequence)getModel());

}catch(Exception we){
we.printStackTrace();
}
}
}
------------------------------------------------------------------------------


I have got the handle to the navigator but cannot find a way to add a new resource to the navigator. Please help.

Appreciate any help in this regard,
Prashanto Chatterjee