summaryrefslogtreecommitdiff
path: root/source/com/c2kernel/lifecycle/instance/gui/view/FindActDefPanel.java
diff options
context:
space:
mode:
Diffstat (limited to 'source/com/c2kernel/lifecycle/instance/gui/view/FindActDefPanel.java')
-rwxr-xr-xsource/com/c2kernel/lifecycle/instance/gui/view/FindActDefPanel.java69
1 files changed, 69 insertions, 0 deletions
diff --git a/source/com/c2kernel/lifecycle/instance/gui/view/FindActDefPanel.java b/source/com/c2kernel/lifecycle/instance/gui/view/FindActDefPanel.java
new file mode 100755
index 0000000..5cb00bf
--- /dev/null
+++ b/source/com/c2kernel/lifecycle/instance/gui/view/FindActDefPanel.java
@@ -0,0 +1,69 @@
+package com.c2kernel.lifecycle.instance.gui.view;
+
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+
+import javax.swing.JButton;
+
+import com.c2kernel.common.ObjectNotFoundException;
+import com.c2kernel.graph.model.Vertex;
+import com.c2kernel.graph.view.SelectedVertexPanel;
+import com.c2kernel.gui.MainFrame;
+import com.c2kernel.lifecycle.ActivitySlotDef;
+import com.c2kernel.lookup.DomainPath;
+
+/**************************************************************************
+ *
+ * $Revision: 1.3 $
+ * $Date: 2005/12/01 14:23:15 $
+ *
+ * Copyright (C) 2003 CERN - European Organization for Nuclear Research
+ * All rights reserved.
+ **************************************************************************/
+
+public class FindActDefPanel extends SelectedVertexPanel {
+
+ JButton findButton;
+ ActivitySlotDef currentAct;
+
+ public FindActDefPanel() {
+ super();
+ findButton = new JButton("Open Definition");
+ findButton.setEnabled(false);
+ add(findButton);
+ findButton.addActionListener(new ActionListener()
+ {
+ public void actionPerformed(ActionEvent e)
+ {
+ try {
+ DomainPath actPath = (DomainPath)new DomainPath("/desc/ActivityDesc/").find(currentAct.getActivityDef());
+ MainFrame.treeBrowser.push(actPath);
+ } catch (ObjectNotFoundException e1) { }
+ }
+ });
+ }
+
+ /**
+ *
+ */
+
+ public void select(Vertex vert) {
+ if (vert instanceof ActivitySlotDef) {
+ findButton.setEnabled(true);
+ currentAct = (ActivitySlotDef)vert;
+ }
+ else
+ clear();
+
+ }
+
+ /**
+ *
+ */
+
+ public void clear() {
+ findButton.setEnabled(false);
+ currentAct = null;
+ }
+
+}