Author: pwang
Date: 2009-04-15 16:10:34 -0700 (Wed, 15 Apr 2009)
New Revision: 16592
Added:
csplugins/trunk/ucsd/pwang/cyprovision/org.eclipse.equinox.p2.ui2/src/org/eclipse/equinox/internal/provisional/p2/ui2/dialogs/InstallationInformationDialog.java
Log:
original creation
Added:
csplugins/trunk/ucsd/pwang/cyprovision/org.eclipse.equinox.p2.ui2/src/org/eclipse/equinox/internal/provisional/p2/ui2/dialogs/InstallationInformationDialog.java
===================================================================
---
csplugins/trunk/ucsd/pwang/cyprovision/org.eclipse.equinox.p2.ui2/src/org/eclipse/equinox/internal/provisional/p2/ui2/dialogs/InstallationInformationDialog.java
2009-04-15 22:40:33 UTC (rev 16591)
+++
csplugins/trunk/ucsd/pwang/cyprovision/org.eclipse.equinox.p2.ui2/src/org/eclipse/equinox/internal/provisional/p2/ui2/dialogs/InstallationInformationDialog.java
2009-04-15 23:10:34 UTC (rev 16592)
@@ -0,0 +1,205 @@
+package org.eclipse.equinox.internal.provisional.p2.ui2.dialogs;
+
+import javax.swing.JDialog;
+import javax.swing.event.ChangeListener;
+import javax.swing.event.ChangeEvent;
+import javax.swing.JTabbedPane;
+import javax.swing.JPanel;
+import javax.swing.JButton;
+import java.awt.event.ActionListener;
+import java.awt.event.ActionEvent;
+
+public class InstallationInformationDialog extends JDialog implements
ChangeListener, ActionListener {
+
+
+
+ /** Creates new form InstallationInformationDialog */
+ public InstallationInformationDialog(boolean modal) {
+ //super(modal);
+ this.setModal(modal);
+ initComponents();
+ this.setTitle("Installation Information");
+
+ pnlRevertButtons.setVisible(false);
+
+ // register a change listener
+ jTabbedPane1.addChangeListener(this);
+
+ btnOK.addActionListener(this);
+ btnOK_revertpanel.addActionListener(this);
+ btnUpdate.addActionListener(this);
+ btnUninstall.addActionListener(this);
+ btnProperties.addActionListener(this);
+ btnRevert.addActionListener(this);
+ }
+
+
+ // change listener
+ public void stateChanged(ChangeEvent e) {
+ JTabbedPane pane = (JTabbedPane) e.getSource();
+
+ // get current tab
+ int sel = pane.getSelectedIndex();
+
+ if (sel == 0){
+ pnlUpdateButtons.setVisible(true);
+ pnlRevertButtons.setVisible(false);
+ }
+ else if (sel == 1){
+ pnlUpdateButtons.setVisible(false);
+ pnlRevertButtons.setVisible(true);
+ }
+
+ }
+
+
+ // Action listener
+ public void actionPerformed(ActionEvent e){
+
+ if (!(e.getSource() instanceof JButton)) {
+ return;
+ }
+ JButton btn = (JButton) e.getSource();
+ if (btn == btnOK || btn == btnOK_revertpanel){
+ this.dispose();
+ }
+ else if (btn == btnUpdate){
+ System.out.println("btnUpdate is clicked");
+ }
+ else if (btn == btnUninstall){
+ System.out.println("btnUninstall is clicked");
+
+ }
+ else if (btn == btnProperties){
+ System.out.println("btnProperties is clicked");
+
+ }
+ else if (btn == btnRevert){
+ System.out.println("btnRevert is clicked");
+
+ }
+
+
+ }
+
+
+ /** 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;
+
+ jTabbedPane1 = new javax.swing.JTabbedPane();
+ pnlInstalledSoftware = new javax.swing.JPanel();
+ jScrollPane1 = new javax.swing.JScrollPane();
+ jTree1 = new javax.swing.JTree();
+ jScrollPane2 = new javax.swing.JScrollPane();
+ pnlInstallationHistory = new javax.swing.JPanel();
+ jSplitPane1 = new javax.swing.JSplitPane();
+ pnlUpdateButtons = new javax.swing.JPanel();
+ btnUpdate = new javax.swing.JButton();
+ btnUninstall = new javax.swing.JButton();
+ btnProperties = new javax.swing.JButton();
+ btnOK = new javax.swing.JButton();
+ pnlRevertButtons = new javax.swing.JPanel();
+ btnRevert = new javax.swing.JButton();
+ btnOK_revertpanel = new javax.swing.JButton();
+
+ getContentPane().setLayout(new java.awt.GridBagLayout());
+
+ setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
+ pnlInstalledSoftware.setLayout(new java.awt.GridBagLayout());
+
+ jScrollPane1.setViewportView(jTree1);
+
+ gridBagConstraints = new java.awt.GridBagConstraints();
+ gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
+ gridBagConstraints.weightx = 1.0;
+ gridBagConstraints.weighty = 0.7;
+ pnlInstalledSoftware.add(jScrollPane1, gridBagConstraints);
+
+
jScrollPane2.setBorder(javax.swing.BorderFactory.createTitledBorder("Details"));
+ gridBagConstraints = new java.awt.GridBagConstraints();
+ gridBagConstraints.gridy = 1;
+ gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
+ gridBagConstraints.weightx = 1.0;
+ gridBagConstraints.weighty = 0.3;
+ pnlInstalledSoftware.add(jScrollPane2, gridBagConstraints);
+
+ jTabbedPane1.addTab("Installed Software", pnlInstalledSoftware);
+
+ pnlInstallationHistory.setLayout(new java.awt.GridBagLayout());
+
+ jSplitPane1.setOrientation(javax.swing.JSplitPane.VERTICAL_SPLIT);
+ gridBagConstraints = new java.awt.GridBagConstraints();
+ gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
+ gridBagConstraints.weightx = 1.0;
+ gridBagConstraints.weighty = 1.0;
+ pnlInstallationHistory.add(jSplitPane1, gridBagConstraints);
+
+ jTabbedPane1.addTab("Installation History", pnlInstallationHistory);
+
+ gridBagConstraints = new java.awt.GridBagConstraints();
+ gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
+ gridBagConstraints.weightx = 1.0;
+ gridBagConstraints.weighty = 1.0;
+ gridBagConstraints.insets = new java.awt.Insets(20, 10, 10, 10);
+ getContentPane().add(jTabbedPane1, gridBagConstraints);
+
+ btnUpdate.setText("Update...");
+ pnlUpdateButtons.add(btnUpdate);
+
+ btnUninstall.setText("Uninstall...");
+ pnlUpdateButtons.add(btnUninstall);
+
+ btnProperties.setText("Properties");
+ pnlUpdateButtons.add(btnProperties);
+
+ btnOK.setText("OK");
+ pnlUpdateButtons.add(btnOK);
+
+ gridBagConstraints = new java.awt.GridBagConstraints();
+ gridBagConstraints.gridy = 1;
+ gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
+ gridBagConstraints.insets = new java.awt.Insets(10, 10, 10, 10);
+ getContentPane().add(pnlUpdateButtons, gridBagConstraints);
+
+ btnRevert.setText("Revert");
+ pnlRevertButtons.add(btnRevert);
+
+ btnOK_revertpanel.setText("OK");
+ pnlRevertButtons.add(btnOK_revertpanel);
+
+ gridBagConstraints = new java.awt.GridBagConstraints();
+ gridBagConstraints.gridy = 2;
+ gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
+ gridBagConstraints.insets = new java.awt.Insets(10, 10, 10, 10);
+ getContentPane().add(pnlRevertButtons, gridBagConstraints);
+
+ pack();
+ }// </editor-fold>
+
+
+ // Variables declaration - do not modify
+ private javax.swing.JButton btnOK;
+ private javax.swing.JButton btnOK_revertpanel;
+ private javax.swing.JButton btnProperties;
+ private javax.swing.JButton btnRevert;
+ private javax.swing.JButton btnUninstall;
+ private javax.swing.JButton btnUpdate;
+ private javax.swing.JScrollPane jScrollPane1;
+ private javax.swing.JScrollPane jScrollPane2;
+ private javax.swing.JSplitPane jSplitPane1;
+ private javax.swing.JTabbedPane jTabbedPane1;
+ private javax.swing.JTree jTree1;
+ private javax.swing.JPanel pnlInstallationHistory;
+ private javax.swing.JPanel pnlInstalledSoftware;
+ private javax.swing.JPanel pnlRevertButtons;
+ private javax.swing.JPanel pnlUpdateButtons;
+ // 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
-~----------~----~----~----~------~----~------~--~---