diff options
| author | Andrew Branson <andrew.branson@cern.ch> | 2014-05-07 17:33:57 +0200 |
|---|---|---|
| committer | Andrew Branson <andrew.branson@cern.ch> | 2014-05-07 17:33:57 +0200 |
| commit | 21230edbafdd30fcf0c43d1dc64ccbf4ca5e06a8 (patch) | |
| tree | b2908dbea534ca8d96a81ab922501769d4b70c4d /src/main/java/com/c2kernel/gui/tree/NodeEntity.java | |
| parent | 75bf1278296d33a7d9b6c01660a2f21e2d40d995 (diff) | |
Agent now extends Item, so they can have workflows. All traces of the
old 'Entity' superclasses should be removed, including proxies and
paths. Very large change, breaks API compatibility with CRISTAL 2.x.
Diffstat (limited to 'src/main/java/com/c2kernel/gui/tree/NodeEntity.java')
| -rw-r--r-- | src/main/java/com/c2kernel/gui/tree/NodeEntity.java | 94 |
1 files changed, 0 insertions, 94 deletions
diff --git a/src/main/java/com/c2kernel/gui/tree/NodeEntity.java b/src/main/java/com/c2kernel/gui/tree/NodeEntity.java deleted file mode 100644 index aa425d6..0000000 --- a/src/main/java/com/c2kernel/gui/tree/NodeEntity.java +++ /dev/null @@ -1,94 +0,0 @@ -package com.c2kernel.gui.tree;
-
-
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.util.ArrayList;
-
-import javax.swing.JMenuItem;
-import javax.swing.JPopupMenu;
-
-import com.c2kernel.common.ObjectNotFoundException;
-import com.c2kernel.entity.proxy.EntityProxy;
-import com.c2kernel.gui.EntityTabManager;
-import com.c2kernel.lookup.Path;
-import com.c2kernel.process.Gateway;
-import com.c2kernel.utils.Language;
-import com.c2kernel.utils.Logger;
-
-/**
- * Structure for Item presence on the tree and ItemDetails boxes. Created by NodeFactory.
- * @author $Author: abranson $
- * @version $Version$
- */
-public abstract class NodeEntity extends Node {
-
- protected EntityProxy myEntity = null;
-
- public NodeEntity(Path path, EntityTabManager desktop) {
- super(path, desktop);
- Logger.msg(2,"NodeEntity.<init> - Creating item for '"+path.toString()+"'.");
-
- // if an item - resolve the item and get its properties
- try {
- myEntity = Gateway.getProxyManager().getProxy(path);
- this.sysKey = path.getSysKey();
- Logger.msg(2,"NodeEntity.<init> - System key is "+this.sysKey);
-
- // Name should be the alias if present
- String alias = myEntity.getName();
- if (alias != null) this.name = alias;
-
- try {
- this.type = myEntity.getProperty("Type");
- } catch (ObjectNotFoundException e) {
- this.type = "";
- }
- String iconString = this.type;
- if (type.equals("ActivityDesc"))
- try {
- iconString = myEntity.getProperty("Complexity")+iconString;
- } catch (ObjectNotFoundException e) {
- iconString = "error";
- }
- iconString = iconString.toLowerCase();
- this.setIcon(iconString);
- } catch (ObjectNotFoundException e1) {
- this.sysKey = -1;
- this.type="Error";
- this.name="Entity not found";
- this.setIcon("error");
- }
- createTreeNode();
- }
-
- public EntityProxy getEntity() {
- return myEntity;
- }
- /**
- *
- */
- @Override
- public JPopupMenu getPopupMenu() {
- JPopupMenu popup = super.getPopupMenu();
- JMenuItem openItem = new JMenuItem(Language.translate("Open"));
- openItem.addActionListener(new ActionListener() {
- @Override
- public void actionPerformed(ActionEvent e) {
- openItem();
- }
- });
- popup.addSeparator();
- popup.add(openItem);
- return popup;
- }
-
- public void openItem() {
- desktop.add(this);
- }
-
- public ArrayList<String> getTabs() {
- ArrayList<String> requiredTabs = new ArrayList<String>();
- return requiredTabs;
- }
-}
|
