Package com.dbxml.db.admin

Examples of com.dbxml.db.admin.Admin


   public void setStylesheet(String name, DocWrapper styleSheet) {
      this.styleSheet = styleSheet;
      lblXSLTBrowse.setText(name);
      if ( doc != null ) {
         if ( active ) {
            Admin admin = Admin.getInstance();
            admin.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
            text = transform(doc.getNode());
            setXSLTText(text);
            admin.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
         }
         else
            reset = true;
      }
   }
View Full Code Here


   }

   public void activate(boolean readOnly) {
      active = true;
      if ( styleSheet != null && reset ) {
         Admin admin = Admin.getInstance();
         admin.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
         text = transform(doc.getNode());
         setXSLTText(text);
         admin.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
      }
   }
View Full Code Here

   public boolean isEnabled() {
      return textEdit.isEnabled();
   }

   public void activate(boolean readOnly) {
      Admin admin = Admin.getInstance();
      admin.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
      try {
         if ( readOnly == textEdit.isEditable() || reset ) {
            value = doc.getText();
            textEdit.setText(value);
            textEdit.setCaretPosition(0);
            textEdit.setEditable(!readOnly);
         }
      }
      finally {
         admin.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
      }
   }
View Full Code Here

   public boolean isBeautifyEnabled() {
      return value.length() > 0 && textEdit.getLanguage() == SyntaxTextArea.LANG_XML;
   }

   public void beautify() {
      Admin admin = Admin.getInstance();
      admin.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
      try {
         String text = textEdit.getText();
         Document d = DOMHelper.parseText(text);
         String newText = TextWriter.toPrettyString(d).trim();
         textEdit.setText(newText);
         if ( !textEdit.isEditable() )
            value = newText;
         textEdit.setCaretPosition(0);
      }
      catch ( Exception e ) {
      }
      finally {
         admin.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
      }
   }
View Full Code Here

      return doc;
   }

   public void activate(boolean readOnly) {
      if ( readOnly != isReadOnly() || reset ) {
         Admin admin = Admin.getInstance();
         admin.setCursor(Cursor.WAIT_CURSOR);
         setReadOnly(readOnly);
         super.setNode(doc.getNode());
         setModified(false);
         admin.setCursor(Cursor.DEFAULT_CURSOR);
      }
   }
View Full Code Here

         hide();
      }
   }

   void btnBrowse_actionPerformed(ActionEvent e) {
      Admin admin = Admin.getInstance();
      JFileChooser fc = new JFileChooser();
      fc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
      fc.setMultiSelectionEnabled(false);
      int result = fc.showDialog(admin, "Select");
      if ( result == JFileChooser.APPROVE_OPTION ) {
View Full Code Here

      }
   }

   void btnAttach_actionPerformed(ActionEvent e) {
      try {
         Admin admin = Admin.getInstance();

         String label = txtLabel.getText();
         String path = txtDirectory.getText();

         admin.browser.addFileSystem(path, label);
         admin.addFileSystem(path, label);

         hide();
      }
      catch ( Exception ex ) {
         Admin.getInstance().addMessage(ex.getMessage());
View Full Code Here

   public MenuItem[] getMenu() {
      return Menu;
   }

   public int menuAction(int action) {
      Admin admin = Admin.getInstance();

      switch ( action ) {
         case ACTION_ADD: {
            CollectionDialog cd = new CollectionDialog(admin, col);
            cd.show();
View Full Code Here

   public MenuItem[] getMenu() {
      return Menu;
   }

   public int menuAction(int action) {
      Admin admin = Admin.getInstance();

      switch ( action ) {
         case ACTION_ADD: {
            IndexDialog id = new IndexDialog(admin, col);
            id.show();
View Full Code Here

   public MenuItem[] getMenu() {
      return Menu;
   }

   public int menuAction(int action) {
      Admin admin = Admin.getInstance();

      switch ( action ) {
         case ACTION_DELETE:
            try {
               String title = "Delete File";
               String message = "Are you sure you want to delete the\n"
                              + "File '"+file.getName()+"'?";
               int res = JOptionPane.showConfirmDialog(Admin.getInstance(), message, title, JOptionPane.YES_NO_OPTION);
               if ( res == JOptionPane.YES_OPTION ) {
                  file.delete();
                  return REMOVE_SELF;
               }
            }
            catch ( Exception e ) {
               Admin.getInstance().addMessage(e.getMessage());
            }
            break;

         case ACTION_EDIT:
            admin.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
            Stopwatch sw = new Stopwatch("Document Retrieval", true);
            DocWrapper dw = getDocWrapper();
            sw.stop();
            admin.setStatus(sw.toString());
            admin.editDocument(dw);
            admin.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
            break;

         case ACTION_XSLT:
            String name = file.getAbsolutePath();
            admin.xsltViewer.setStylesheet(name, getDocWrapper());
View Full Code Here

TOP

Related Classes of com.dbxml.db.admin.Admin

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.