001: /*
002: * Copyright (c) 1998-2008 Caucho Technology -- all rights reserved
003: *
004: * This file is part of Resin(R) Open Source
005: *
006: * Each copy or derived work must preserve the copyright notice and this
007: * notice unmodified.
008: *
009: * Resin Open Source is free software; you can redistribute it and/or modify
010: * it under the terms of the GNU General Public License as published by
011: * the Free Software Foundation; either version 2 of the License, or
012: * (at your option) any later version.
013: *
014: * Resin Open Source is distributed in the hope that it will be useful,
015: * but WITHOUT ANY WARRANTY; without even the implied warranty of
016: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, or any warranty
017: * of NON-INFRINGEMENT. See the GNU General Public License for more
018: * details.
019: *
020: * You should have received a copy of the GNU General Public License
021: * along with Resin Open Source; if not, write to the
022: *
023: * Free Software Foundation, Inc.
024: * 59 Temple Place, Suite 330
025: * Boston, MA 02111-1307 USA
026: *
027: * @author Sam
028: */
029:
030: package com.caucho.netbeans.nodes;
031:
032: import com.caucho.netbeans.ResinDeploymentManager;
033: import com.caucho.netbeans.nodes.actions.AdminConsoleAction;
034: import com.caucho.netbeans.nodes.actions.ServerLogAction;
035:
036: import org.openide.nodes.AbstractNode;
037: import org.openide.nodes.Children;
038: import org.openide.nodes.Node;
039: import org.openide.util.Lookup;
040: import org.openide.util.actions.SystemAction;
041:
042: import java.awt.*;
043: import java.util.logging.*;
044:
045: /**
046: * The main server node representing the server instance.
047: */
048: public class ResinManagerNode extends AbstractNode implements
049: Node.Cookie {
050: private static final Logger log = Logger
051: .getLogger(ResinManagerNode.class.getName());
052:
053: private Lookup _lookup;
054: private ResinDeploymentManager _manager;
055:
056: public ResinManagerNode(Children children, Lookup lookup) {
057: super (children);
058:
059: log.info("ResinManagerNode: " + lookup);
060:
061: _lookup = lookup;
062:
063: getCookieSet().add(this );
064:
065: /*
066: setIconBaseWithExtension("com/caucho/netbeans/resources/resin.png"); // NOI18N
067: */
068: }
069:
070: @Override
071: public String getShortDescription() {
072: return "Resin";
073:
074: // return _manager.getResinConfiguration().getDisplayName();
075: }
076:
077: @Override
078: public String getDisplayName() {
079: return "Resin InstanceNode";
080: }
081:
082: /*
083: @Override
084: public javax.swing.Action[] getActions(boolean context)
085: {
086: return new javax.swing.Action[]{
087: null,
088: SystemAction.get(AdminConsoleAction.class),
089: SystemAction.get(ServerLogAction.class),
090: };
091: }
092:
093: @Override
094: public boolean hasCustomizer()
095: {
096: // XXX: return true and implement getCustomizer to enable a
097: // "Properties" menu item for a Resin server entry
098: return false;
099: }
100:
101:
102: public Component getCustomizer()
103: {
104: return super.getCustomizer();
105: }
106: */
107:
108: public ResinDeploymentManager getManger() {
109: if (_manager == null) {
110: _manager = (ResinDeploymentManager) _lookup
111: .lookup(ResinDeploymentManager.class);
112: }
113:
114: return _manager;
115: }
116: }
|