Package com.dbxml.db.admin.nodes

Examples of com.dbxml.db.admin.nodes.HasStorage


      return false;
   }

   private boolean storeNewDocument() {
      AdminNode[] nodes = null;
      HasStorage store = null;
      AdminNode refresh = null;

      TreePath path = browser.getSelectionPath();
      Object[] components = null;
      if ( path != null ) {
         components = path.getPath();
         java.util.List list = new ArrayList();
         for ( int i = 0; i < components.length; i++ ) {
            DefaultMutableTreeNode n = (DefaultMutableTreeNode)components[i];
            list.add(n.getUserObject());
         }
         nodes = (AdminNode[])list.toArray(EmptyAdminNodes);

         for ( int i = nodes.length-1; store == null && i >= 0; i-- ) {
            if ( nodes[i] instanceof HasStorage ) {
               store = (HasStorage)nodes[i];
               refresh = store.getRefreshTarget();
            }
         }
      }

      if ( store == null ) {
         StringBuffer sb = new StringBuffer();
         sb.append("There is currently no container selected.\n");
         sb.append("Please select a container to save the Document.");

         JOptionPane.showMessageDialog(this, sb.toString(), "Save Document", JOptionPane.OK_OPTION);
         return false;
      }

      StringBuffer sb = new StringBuffer();
      sb.append("Please type a name for your new Document.");
      String name = JOptionPane.showInputDialog(this, sb.toString(), "New Document", JOptionPane.OK_CANCEL_OPTION);
      if ( name != null && name.length() > 0 )
         doc.setName(name);
      else
         return false;

      Stopwatch sw = new Stopwatch("Document Storage", true);
      TabbedNodeEditor ne = (TabbedNodeEditor)paneEdit.getSelectedComponent();
      if ( ne.deactivate() ) {
         store.storeDocWrapper(doc);
         ne.activate(readOnly);
         nodeEditor = ne;
      }
      sw.stop();
      statusBar.setText(sw.toString());
View Full Code Here

TOP

Related Classes of com.dbxml.db.admin.nodes.HasStorage

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.