Package org.nasutekds.guitools.controlpanel.ui.nodes

Examples of org.nasutekds.guitools.controlpanel.ui.nodes.BasicNode


          duplicateEntryPanel);
      Utilities.centerGoldenMean(duplicateEntryDlg,
          Utilities.getParentDialog(this));
    }
    TreePath[] paths = treePane.getTree().getSelectionPaths();
    BasicNode node = null;
    if ((paths != null) && (paths.length == 1))
    {
      TreePath path = paths[0];
      node = (BasicNode)path.getLastPathComponent();
    }
View Full Code Here


    if (paths != null)
    {
      StringBuilder sb = new StringBuilder();
      for (TreePath path : paths)
      {
        BasicNode node = (BasicNode)path.getLastPathComponent();
        if (sb.length() > 0)
        {
          sb.append("\n");
        }
        sb.append(node.getDN());
      }
      StringSelection stringSelection = new StringSelection(sb.toString());
      clipboard.setContents(stringSelection, owner);
    }
  }
View Full Code Here

    if (paths != null)
    {
      LinkedHashSet<DN> dns = new LinkedHashSet<DN>();
      for (TreePath path : paths)
      {
        BasicNode node = (BasicNode)path.getLastPathComponent();
        try
        {
          dns.add(DN.decode(node.getDN()));
        }
        catch (OpenDsException ode)
        {
          throw new RuntimeException(
              "Unexpected error decoding dn. Details: "+ode.getMessageObject(),
View Full Code Here

            // Consider it a suffix
            controller.addSuffix(s, null);
          }
          else
          {
            BasicNode rootNode =
              (BasicNode)controller.getTree().getModel().getRoot();
            if (controller.findChildNode(rootNode, s) == -1)
            {
              controller.addNodeUnderRoot(s);
            }
View Full Code Here

      }
      if (!errorOccurred)
      {
        treePane.getTree().setRootVisible(displayAll);
        treePane.getTree().setShowsRootHandles(!displayAll);
        BasicNode rootNode =
          (BasicNode)controller.getTree().getModel().getRoot();
        boolean isSubordinate = false;
        for (BackendDescriptor backend : ev.getBackends())
        {
          for (BaseDNDescriptor baseDN : backend.getBaseDns())
          {
            boolean isBaseDN = false;
            if ((theDN != null) && baseDN.getDn().equals(theDN))
            {
              isBaseDN = true;
            }
            else if ((theDN != null) && baseDN.getDn().isAncestorOf(theDN))
            {
              isSubordinate = true;
            }
            String dn = Utilities.unescapeUtf8(baseDN.getDn().toString());
            if (displayAll || isBaseDN)
            {
              try
              {
                if (!controller.hasSuffix(dn))
                {
                  controller.addSuffix(dn, null);
                }
                else
                {
                  int index = controller.findChildNode(rootNode, dn);
                  if (index >= 0)
                  {
                    TreeNode node = rootNode.getChildAt(index);
                    if (node != null)
                    {
                      TreePath path = new TreePath(
                          controller.getTreeModel().getPathToRoot(node));
                      controller.startRefresh(
View Full Code Here

                  }
                }
              }
              if (!added && !displayAll)
              {
                BasicNode rootNode =
                  (BasicNode)controller.getTree().getModel().getRoot();
                if (controller.findChildNode(rootNode, s) == -1)
                {
                  controller.addNodeUnderRoot(s);
                }
View Full Code Here

    state = State.RUNNING;
    lastException = null;

    try
    {
      BasicNode node = (BasicNode)treePath.getLastPathComponent();
      InitialLdapContext ctx = controller.findConnectionForDisplayedEntry(node);
      useAdminCtx = controller.isConfigurationNode(node);
      if (!mustRename)
      {
        if (modifications.size() > 0) {
View Full Code Here

    SortedSet<DN> entries = new TreeSet<DN>();
    boolean canPrecalculateNumberOfEntries = true;
    nToDelete = paths.length;
    for (TreePath path : paths)
    {
      BasicNode node = (BasicNode)path.getLastPathComponent();
      try
      {
        DN dn = DN.decode(node.getDN());
        entries.add(dn);
      }
      catch (DirectoryException de)
      {
        throw new RuntimeException("Unexpected error parsing dn: "+
            node.getDN(), de);
      }
    }
    for (BackendDescriptor backend : info.getServerDescriptor().getBackends())
    {
      for (BaseDNDescriptor baseDN : backend.getBaseDns())
View Full Code Here

    ArrayList<BrowserNodeInfo> toNotify = new ArrayList<BrowserNodeInfo>();
    try
    {
      for (TreePath path : paths)
      {
        BasicNode node = (BasicNode)path.getLastPathComponent();
        try
        {
          DN dn = DN.decode(node.getDN());
          boolean isDnDeleted = false;
          for (DN deletedDn : alreadyDeleted)
          {
            if (dn.isDescendantOf(deletedDn))
            {
              isDnDeleted = true;
              break;
            }
          }
          if (!isDnDeleted)
          {
            InitialLdapContext ctx =
              controller.findConnectionForDisplayedEntry(node);
            useAdminCtx = controller.isConfigurationNode(node);
            if (node.hasSubOrdinates())
            {
              deleteSubtreeWithControl(ctx, dn, path, toNotify);
            }
            else
            {
              deleteSubtreeRecursively(ctx, dn, path, toNotify);
            }
            alreadyDeleted.add(dn);
          }
        }
        catch (DirectoryException de)
        {
          throw new RuntimeException("Unexpected error parsing dn: "+
              node.getDN(), de);
        }
      }
      if (toNotify.size() > 0)
      {
        final List<BrowserNodeInfo> fToNotify =
View Full Code Here

              entryInserted = true;
            }
          }
          if (!entryInserted)
          {
            BasicNode root = (BasicNode)controller.getTreeModel().getRoot();
            BasicNode realParentNode = findParentNode(newEntry.getDN(), root);
            if (realParentNode != null)
            {
              insertNode(realParentNode, newEntry.getDN(), false);
            }
            else
View Full Code Here

TOP

Related Classes of org.nasutekds.guitools.controlpanel.ui.nodes.BasicNode

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.