當前位置: 首頁>>代碼示例>>Java>>正文


Java Node.Handle方法代碼示例

本文整理匯總了Java中org.openide.nodes.Node.Handle方法的典型用法代碼示例。如果您正苦於以下問題:Java Node.Handle方法的具體用法?Java Node.Handle怎麽用?Java Node.Handle使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.openide.nodes.Node的用法示例。


在下文中一共展示了Node.Handle方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: writeExternal

import org.openide.nodes.Node; //導入方法依賴的package包/類
/** Serialize this property sheet */
@Override
public void writeExternal (ObjectOutput out)
throws IOException {
    super.writeExternal(out);

    if (global) {
        // write dummy array
        out.writeObject (null);
    } else {
        Node.Handle[] arr = NodeOp.toHandles (nodes);
        out.writeObject(arr);
    }

    out.writeBoolean(global);
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:17,代碼來源:NbSheet.java

示例2: Pair

import org.openide.nodes.Node; //導入方法依賴的package包/類
/** @param t the type of the event
* @param h the listener's handle
* @exception IOException if handle is null
*/
public Pair (ConnectionCookie.Type t, Node.Handle h) throws IOException {

    if (h == null) throw new IOException ();

    type = t;
    value = h;
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:12,代碼來源:ConnectionSupport.java

示例3: writeExternal

import org.openide.nodes.Node; //導入方法依賴的package包/類
/** Serialize this top component.
* Subclasses wishing to store state must call the super method, then write to the stream.
* @param out the stream to serialize to
*/
public void writeExternal(ObjectOutput out) throws IOException {
    out.writeObject(new Short(serialVersion));
    out.writeInt(closeOperation);
    out.writeObject(getName());
    out.writeObject(getToolTipText());

    if (getDisplayName() != null) {
        out.writeObject(getDisplayName());
    }

    Node n = (nodeName == null) ? null : nodeName.getNode();
    Node.Handle h = (n == null) ? null : n.getHandle();
    out.writeObject(h);
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:19,代碼來源:TopComponent.java

示例4: getHandle

import org.openide.nodes.Node; //導入方法依賴的package包/類
@Override
public Node.Handle getHandle() {        
    return new Handle(type);
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:5,代碼來源:ProjectsRootNode.java

示例5: getHandle

import org.openide.nodes.Node; //導入方法依賴的package包/類
public Node.Handle getHandle () {
    return new H ();
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:4,代碼來源:ExplorerActionsTest.java

示例6: readExternal

import org.openide.nodes.Node; //導入方法依賴的package包/類
/** Deserialize this property sheet. */
@Override
public void readExternal (ObjectInput in)
throws IOException, ClassNotFoundException {
    try {
        super.readExternal(in);
    } catch (SafeException se) {
        // ignore--we really do not care about the explorer manager that much
        //System.err.println("ignoring a SafeException: " + se.getLocalizedMessage ());
    }
    Object obj = in.readObject ();

    if (obj instanceof NbMarshalledObject || obj instanceof ExplorerManager) {
        // old version read the Boolean
        global = ((Boolean)in.readObject()).booleanValue();
    } else {
        Node[] ns;

        if (obj == null) {
            // handles can also be null for global 
            // property sheet
            ns = TopComponent.getRegistry().getActivatedNodes();
        } else {
            // new version, first read the nodes and then the global boolean
            Node.Handle[] arr = (Node.Handle[])obj;

            try {
                ns = NodeOp.fromHandles (arr);
            } catch (IOException ex) {
                Exceptions.attachLocalizedMessage(ex,
                                                  NbBundle.getBundle(NbSheet.class).getString("EXC_CannotLoadNodes"));
                Logger.getLogger(NbSheet.class.getName()).log(Level.WARNING, null, ex);
                ns = new Node[0];
            }
        }

        global = in.readBoolean ();

        setNodes(ns, true, "readExternal"); // NOI18N
    }

    /*
          if (obj instanceof Boolean) {
            global = (Boolean)in.readObject ()

          global = ((Boolean)in.readObject()).booleanValue();
    /*
          // start global listening if needed, but wait until
          // deserialization is done (ExplorerManager is uses
          // post-deserialization validating too, so we are forced
          // to use it)
          ((ObjectInputStream)in).registerValidation(
            new ObjectInputValidation () {
              public void validateObject () {
                updateGlobalListening(false);
              }
            }, 0
          );
    */
    // JST: I guess we are not and moreover the type casting is really ugly
    //      updateGlobalListening (global);
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:63,代碼來源:NbSheet.java

示例7: readExternal

import org.openide.nodes.Node; //導入方法依賴的package包/類
/** Deserialize this top component.
* Subclasses wishing to store state must call the super method, then read from the stream.
* @param in the stream to deserialize from
*/
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
    Object firstObject = in.readObject();

    if (firstObject instanceof Integer) {
        // backward compatibility read
        serialVersion = 0;

        closeOperation = ((Integer) firstObject).intValue();

        // BCR: this is backward compatibility read and is likely not needed
        // BCR: anymore. So let's just ignore the read of the data object
        // BCR:     DataObject obj = (DataObject)in.readObject();
        in.readObject();

        super.setName((String) in.readObject());
        setToolTipText((String) in.readObject());

        // initialize the connection to a data object

        /* BCR: Remove this as we ignore the DataObject
                    if (obj != null) {
                        nodeName = new NodeName (this);
                        nodeName.attach (obj.getNodeDelegate ());
                    }
        */
    } else {
        // new serialization
        serialVersion = ((Short) firstObject).shortValue();

        closeOperation = in.readInt();
        super.setName((String) in.readObject());
        setToolTipText((String) in.readObject());

        Object obj = in.readObject();

        if (obj instanceof String) {
            setDisplayName((String) obj);
            obj = in.readObject();
        }

        Node.Handle h = (Node.Handle) obj;

        if (h != null) {
            Node n = h.getNode();
            NodeName.connect(this, n);
        }
    }

    if ((closeOperation != CLOSE_EACH) && (closeOperation != CLOSE_LAST)) {
        throw new IOException("invalid closeOperation: " + closeOperation); // NOI18N
    }
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:57,代碼來源:TopComponent.java

示例8: getHandle

import org.openide.nodes.Node; //導入方法依賴的package包/類
public Node.Handle getHandle () {
    return new EnvironmentHandle (filter);
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:4,代碼來源:EnvironmentNode.java

示例9: getHandle

import org.openide.nodes.Node; //導入方法依賴的package包/類
public Node.Handle getHandle() { 
    return null; 
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:4,代碼來源:EditActionTest.java


注:本文中的org.openide.nodes.Node.Handle方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。