Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [pde-ui-dev] How to open a view programmatically

Rishi,

Your question is not specifically related to PDE - it is a generic platform
UI question. You would be better off posting it on platform-ui-dev mailing
list.

Regards,

Dejan Glozic, Ph.D.
Manager, Eclipse Platform Components
D2/MY7/8200/MKM
IBM Canada Ltd.
Tel. 905 413-2745  T/L 969-2745
Fax. 905 413-4854



                                                                                                                                   
                      Rishi.Sahni@snste                                                                                            
                      ch.com                   To:       pde-ui-dev@xxxxxxxxxxx                                                    
                      Sent by:                 cc:                                                                                 
                      pde-ui-dev-admin@        Subject:  [pde-ui-dev] How to open a view programmatically                          
                      eclipse.org                                                                                                  
                                                                                                                                   
                                                                                                                                   
                      01/09/2003 07:50                                                                                             
                      AM                                                                                                           
                      Please respond to                                                                                            
                      pde-ui-dev                                                                                                   
                                                                                                                                   
                                                                                                                                   



Can any body tell me how to open a view programmatically?
I have already used showView()
written following lines of code to open a view

IWorkbenchWindow dw = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
IWorkbenchPage page = dw.getActivePage();
try{
      page.showView("test.PackageView");
}catch (PartInitException e){
      DialogUtil.openError(dw.getShell(), ResourceMessages.getString(
"DataFileResource.errorMessage"),e.getMessage(),e);
}

now in Package View i want to populate a tree the information of tree
Elements is passed in the constructor as shown below

if (page != null){
      PackageView pv = new PackageView(htableListFile);
      pv.createPartControl(parent);
      IViewPart part =(IViewPart) pv.getViewSite() ;
      page.activate(part) ;
}





and in createPartControl method of PackageView am populating the Tree View
as




if(table != null){
      Enumeration enum= table.keys();
      while(enum.hasMoreElements()){
            String Key = enum.nextElement().toString();
            TreeParent p31 = new TreeParent(Key);
            ArrayList tempalist =(ArrayList) table.get(Key);
            for(int i = 0;i<tempalist.size();i++){
                  System.out.println("Key--"+Key+" >> "
+tempalist.get(i).toString());
            }
            root.addChild(p31);
      }
}else{
      System.out.println("table is Null");
}






the Code is adding Childs in tree but its not showing up Childs ,may be its
not updating the view

Help required

Thanks in advance



Rishi Sahni








_______________________________________________
pde-ui-dev mailing list
pde-ui-dev@xxxxxxxxxxx
http://dev.eclipse.org/mailman/listinfo/pde-ui-dev





Back to the top