Author: pwang
Date: 2009-04-17 12:46:32 -0700 (Fri, 17 Apr 2009)
New Revision: 16620

Added:
   
csplugins/trunk/ucsd/pwang/cyprovision/org.eclipse.equinox.p2.ui2/src/org/eclipse/equinox/internal/provisional/p2/ui2/dialogs/UninstallDetailsPage.java
Log:
original creation

Added: 
csplugins/trunk/ucsd/pwang/cyprovision/org.eclipse.equinox.p2.ui2/src/org/eclipse/equinox/internal/provisional/p2/ui2/dialogs/UninstallDetailsPage.java
===================================================================
--- 
csplugins/trunk/ucsd/pwang/cyprovision/org.eclipse.equinox.p2.ui2/src/org/eclipse/equinox/internal/provisional/p2/ui2/dialogs/UninstallDetailsPage.java
     2009-04-17 18:57:59 UTC (rev 16619)
+++ 
csplugins/trunk/ucsd/pwang/cyprovision/org.eclipse.equinox.p2.ui2/src/org/eclipse/equinox/internal/provisional/p2/ui2/dialogs/UninstallDetailsPage.java
     2009-04-17 19:46:32 UTC (rev 16620)
@@ -0,0 +1,151 @@
+package org.eclipse.equinox.internal.provisional.p2.ui2.dialogs;
+
+import java.awt.Component;
+import java.awt.event.ComponentAdapter;
+import java.awt.event.ComponentEvent;
+import java.util.Vector;
+
+import javax.swing.tree.DefaultMutableTreeNode;
+import javax.swing.tree.DefaultTreeModel;
+
+import 
org.eclipse.equinox.internal.provisional.p2.ui2.QueryableMetadataRepositoryManager;
+import 
org.eclipse.equinox.internal.provisional.p2.ui2.model.InstalledIUElement;
+import org.eclipse.equinox.internal.provisional.p2.ui2.model.ProfileElement;
+import org.eclipse.equinox.internal.provisional.p2.ui2.policy.Policy;
+import org.netbeans.spi.wizard.WizardPage;
+
+public class UninstallDetailsPage extends WizardPage {
+
+       String profileId;
+       Vector<InstalledIUElement> ius;
+       
+       public UninstallDetailsPage(String profileId, 
Vector<InstalledIUElement> ius){
+               this.profileId = profileId;
+               this.ius = ius;
+               
+               this.putWizardData("profileId",this.profileId);
+               this.putWizardData("ius",this.ius);
+               
+               initComponents();               
+                
+               initRepoTree();
+                       
+               /*
+               //Populate the JTree when the panel show up the first time
+               ComponentAdapter componentAdapter = new ComponentAdapter(){
+                   public void componentMoved(ComponentEvent e)  {
+                       //System.out.println("component has been moved");
+                       recycle();
+                   }
+               };
+               this.addComponentListener(componentAdapter);
+               */
+       }
+
+       
+       private void initRepoTree(){
+               jTree1.setRootVisible(false);
+               jTree1.setShowsRootHandles(true);
+               
+               RepoCellRenderer r1 = new RepoCellRenderer();
+               jTree1.setCellRenderer(r1);
+               
+               DefaultTreeModel model= rebuildTreeModel();
+        jTree1.setModel(model);
+       
+       }
+
+       private DefaultTreeModel rebuildTreeModel(){
+
+               DefaultMutableTreeNode root = new 
DefaultMutableTreeNode("JTree");                
+               DefaultMutableTreeNode node;
+               
+        //Populate the tree
+        if (ius == null || ius.size() == 0){
+               return new DefaultTreeModel(null);
+        }
+        
+        for (int i=0; i< ius.size(); i++){
+                       if (ius.elementAt(i) instanceof InstalledIUElement){
+                               node = new DefaultMutableTreeNode();
+                       node.setUserObject(ius.elementAt(i));
+                       root.add(node);
+                       }
+               }
+
+               return new DefaultTreeModel(root);
+       }
+
+       
+    public static final String getDescription() {
+        return "Uninstall Details";
+    }
+    
+    protected String validateContents (Component component, Object o) {
+
+       return null;
+    }
+    
+    
+    protected  void recycle()  {
+    }
+       
+       
+       
+    /** This method is called from within the constructor to
+     * initialize the form.
+     * WARNING: Do NOT modify this code. The content of this method is
+     * always regenerated by the Form Editor.
+     */
+    // <editor-fold defaultstate="collapsed" desc=" Generated Code ">          
                
+    private void initComponents() {
+        java.awt.GridBagConstraints gridBagConstraints;
+
+        jLabel1 = new javax.swing.JLabel();
+        jScrollPane1 = new javax.swing.JScrollPane();
+        jTree1 = new javax.swing.JTree();
+        jScrollPane2 = new javax.swing.JScrollPane();
+        taDetails = new javax.swing.JTextArea();
+
+        setLayout(new java.awt.GridBagLayout());
+
+        jLabel1.setFont(new java.awt.Font("Tahoma", 1, 12));
+        jLabel1.setText("Review and confirm the items to be uninstalled.");
+        gridBagConstraints = new java.awt.GridBagConstraints();
+        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
+        gridBagConstraints.insets = new java.awt.Insets(10, 10, 20, 10);
+        add(jLabel1, gridBagConstraints);
+
+        jScrollPane1.setViewportView(jTree1);
+
+        gridBagConstraints = new java.awt.GridBagConstraints();
+        gridBagConstraints.gridy = 1;
+        gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
+        gridBagConstraints.weightx = 1.0;
+        gridBagConstraints.weighty = 0.7;
+        add(jScrollPane1, gridBagConstraints);
+
+        
jScrollPane2.setBorder(javax.swing.BorderFactory.createTitledBorder("Details"));
+        taDetails.setColumns(20);
+        taDetails.setRows(5);
+        jScrollPane2.setViewportView(taDetails);
+
+        gridBagConstraints = new java.awt.GridBagConstraints();
+        gridBagConstraints.gridy = 2;
+        gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
+        gridBagConstraints.weightx = 1.0;
+        gridBagConstraints.weighty = 0.3;
+        add(jScrollPane2, gridBagConstraints);
+
+    }// </editor-fold>                        
+    
+    
+    // Variables declaration - do not modify                     
+    private javax.swing.JLabel jLabel1;
+    private javax.swing.JScrollPane jScrollPane1;
+    private javax.swing.JScrollPane jScrollPane2;
+    private javax.swing.JTree jTree1;
+    private javax.swing.JTextArea taDetails;
+    // End of variables declaration                   
+
+}


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"cytoscape-cvs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/cytoscape-cvs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to