Package clips.delegate.directory.complex

Examples of clips.delegate.directory.complex.DirectoryServicesGroupItem


    DirectoryServicesGroup dirGroup =
                (DirectoryServicesGroup) DirectoryLocator.getDirectory(DirectoryServicesGroup.class, false);
        DirectoryService dirService =
                (DirectoryService) DirectoryLocator.getDirectory(DirectoryService.class, false);
       
        DirectoryServicesGroupItem parent = null;
        DirectoryServicesGroupItem group = null;
        DirectoryServiceItem service = null;
       
        String line = input.readLine();
        while (line != null) {
            if (!line.trim().isEmpty()) {
                int pos = line.indexOf('|');
                if (pos > -1) {
                    String code = line.substring(0, pos);
                    String title = line.substring(pos + 1);
                    if (code.length() == 2) {
                        ServiceGroupDetails parDetails = new ServiceGroupDetails();
                        parDetails.code = code;
                        parDetails.parentItem = 0;
                        parDetails.title = title;
                       
                        parent = new DirectoryServicesGroupItem(parDetails);
                        dirGroup.getItems().append(parent);
                       
                        System.out.println(code + " " + title);
                    }
                    else if (code.length() == 6) {
                        code = code.substring(3, 6);
                       
                        ServiceGroupDetails grDetails = new ServiceGroupDetails();
                        grDetails.code = code;
                        grDetails.parentItem = parent.getID();
                        grDetails.title = title;
                       
                        group = new DirectoryServicesGroupItem(grDetails);
                        dirGroup.getItems().append(group);
                       
                        System.out.println("   " +code + " " + title);
                    }
                    else if (code.length() == 9) {
                        code = code.substring(7);
                       
                        ServiceDetails servDetails = new ServiceDetails();
                        servDetails.checkupType = 0;
                        servDetails.code = code;
                        servDetails.defaultDuration = 0;
                        servDetails.description = "";
                        servDetails.serviceClass = 1;
                        servDetails.serviceGroup = group.getID();
                        servDetails.title = title;
                       
                        service = new DirectoryServiceItem(servDetails);
                        dirService.getItems().append(service);
                       
View Full Code Here


    resizeColumn();
    StateSaver.attachTo(this);
    }

    private void reloadTable() throws ClipsException {
        DirectoryServicesGroupItem serviceGroup;
        if (jTree1.getLastSelectedPathComponent() instanceof DirectoryServicesGroupItem) {
            serviceGroup = (DirectoryServicesGroupItem) jTree1.getLastSelectedPathComponent();
        } else {
            serviceGroup = null;
        }
View Full Code Here

    }//GEN-LAST:event_jTree1ValueChanged

    private void jTree1MousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jTree1MousePressed
        TreePath path = jTree1.getPathForLocation(evt.getX(), evt.getY());
        if (path != null && path.getLastPathComponent() instanceof DirectoryServicesGroupItem) {
            DirectoryServicesGroupItem item = (DirectoryServicesGroupItem) path.getLastPathComponent();
            Rectangle rect = jTree1.getPathBounds(path);
            if (rect != null) {
                int dx = evt.getX() - rect.x;
                int dy = evt.getY() - rect.y;
                if (dx <= ICON_SEL_ALL.getIconWidth()) {
View Full Code Here

    public int getChildCount(Object parent) {
        //try {
            if(parent instanceof DefaultMutableTreeNode) {
                return items.size();
            } else {
                DirectoryServicesGroupItem item = (DirectoryServicesGroupItem)parent;
                return item.getItems().size();
            }
    /*    } catch (ClipsException ex) {
            ex.printStackTrace();
        }
        return 0;*/
 
View Full Code Here

    public Object getChild(Object parent, int index) {
      //  try {
            if(parent instanceof DefaultMutableTreeNode) {
              return items.get(index);
            } else {
                DirectoryServicesGroupItem item = (DirectoryServicesGroupItem)parent;
                return item.getItems().get(index);
            }
      /*  } catch (ClipsException ex) {
            ex.printStackTrace();
        }
        return null;*/
 
View Full Code Here

    //Изменение текста группы услуг
    @Override
    public void valueForPathChanged(TreePath path, Object newValue) {
        try {
            DirectoryServicesGroupItem item = (DirectoryServicesGroupItem) path.getLastPathComponent();
            item.setTitle(newValue.toString());
        } catch (ClipsException ex) {
            MessageBox.showException(ex);
        }
    }
View Full Code Here

    @Override
    public Component getTreeCellRendererComponent(JTree tree, Object value, boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus) {
        super.getTreeCellRendererComponent(tree, value, selected, expanded, leaf, row, hasFocus);
        try {
            if (value instanceof DirectoryServicesGroupItem) {
                DirectoryServicesGroupItem item = (DirectoryServicesGroupItem) value;
                switch (contract.getSelectedStatus(item)) {
                    case ContractLocal.SEL_STATUS_ALL:
                        setIcon(ICON_SEL_ALL);
                        break;
                    case ContractLocal.SEL_STATUS_SOME:
View Full Code Here

}//GEN-LAST:event_btDelServiceActionPerformed

private void btAddServiceGroupActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btAddServiceGroupActionPerformed
    try {
        Object value = treeServiceGroup.getLastSelectedPathComponent();
        DirectoryServicesGroupItem newItem = null;
        if (value instanceof DirectoryServicesGroupItem) {
            DirectoryServicesGroupItem selected = (DirectoryServicesGroupItem) value;
            tfGroupCodePref.setText(selected.getFullCode());
            tfName.setText("");
            tfGroupCode.setText("");
            int res = JOptionPane.showOptionDialog(this, pnlNewNode, "Заполните поля", JOptionPane.OK_CANCEL_OPTION,
                            JOptionPane.PLAIN_MESSAGE, null, a, -1);
            if (res == JOptionPane.OK_OPTION) {
                if (tfName.getText().isEmpty() || tfGroupCode.getText().isEmpty()) {
                    MessageBox.showWarning(MessageBox.W_INCORRECT_DATA);
                    return;
                } else {
                    ServiceGroupDetails details = new ServiceGroupDetails();
                    details.title = tfName.getText();
                    details.code = tfGroupCode.getText();
                    details.parentItem = selected.getID();
                    newItem = new DirectoryServicesGroupItem(details);
                    selected.getItems().append(newItem);
                    treeServiceGroup.updateUI();
                    treeServiceGroup.expandPath(treeServiceGroup.getSelectionPath());
                }
            }
        } else {
            tfGroupCodePref.setText("");
            tfName.setText("");
            tfGroupCode.setText("");
            int res = JOptionPane.showOptionDialog(this, pnlNewNode, "Заполните поля", JOptionPane.OK_CANCEL_OPTION,
                            JOptionPane.PLAIN_MESSAGE, null, a, -1);
            if (res == JOptionPane.OK_OPTION) {
                if (tfName.getText().isEmpty() || tfGroupCode.getText().isEmpty()) {
                    MessageBox.showWarning(MessageBox.W_INCORRECT_DATA);
                    return;
                } else {
                    ServiceGroupDetails details = new ServiceGroupDetails();
                    details.title = tfName.getText();
                    details.code = tfGroupCode.getText();
                    newItem = new DirectoryServicesGroupItem(details);
                    DirectoryServicesGroup svc = (DirectoryServicesGroup)
                        DirectoryLocator.getDirectory(DirectoryServicesGroup.class);
                    svc.getItems().append(newItem);
                    treeServiceGroup.updateUI();
                    treeServiceGroup.expandPath(treeServiceGroup.getSelectionPath());
View Full Code Here

    try {
        if (treeServiceGroup.getLastSelectedPathComponent() == treeServiceGroup.getModel().getRoot() || treeServiceGroup.getLastSelectedPathComponent() == null) {
            return;
        }
       
        DirectoryServicesGroupItem item = (DirectoryServicesGroupItem) treeServiceGroup.getLastSelectedPathComponent();
       
        deleteServiceGroup(item);
        setTree();
        DirectoryLocator.getDirectory(DirectoryService.class);
    } catch (ClipsException clipsException) {
View Full Code Here

        System.out.println("service: " + service.getTitle());
    }

    SelectorEditableExceptional<DirectoryServicesGroupItem> iie = serGroup.getItems();       
    for (int i = iie.size() - 1; i > -1; i--) {
        DirectoryServicesGroupItem item = iie.get(i);
        deleteServiceGroup(item);
    }
   
   
    DirectoryServicesGroupItem parent = serGroup.getParent();
   
    if (parent == null) {
        iie = grps.getItems();
    }
    else {
        iie = parent.getItems();
    }
   
    iie.remove(serGroup);
   
   
View Full Code Here

TOP

Related Classes of clips.delegate.directory.complex.DirectoryServicesGroupItem

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.