Package org.eclipse.swt.widgets

Examples of org.eclipse.swt.widgets.TreeItem


    }
  }
 
  public void updateFont() {
    if(tree.getSelectionCount() > 0) {      
      TreeItem item = tree.getSelection()[0];
      updateFont(item);
    }
  }
View Full Code Here


 
  //hasRuntimeChild = false, wenn der Runtime ELement Attribute wie schedule oder runtime_function hat
  public void updateRunTime() {
   
    if(tree.getSelectionCount()> 0) {
      TreeItem item = tree.getSelection()[0];
      item.removeAll();
      TreeData data = (TreeData)item.getData();     
      listener.treeFillRunTimes(item, data.getElement(), !Utils.isElementEnabled("job", dom, data.getElement()), "run_time");
    }
   
  }
View Full Code Here

  }


  public void setChangedTreeItemText(String key1) {
    if (tree.getSelectionCount() > 0) {
      TreeItem item = tree.getSelection()[0];   
      /*TreeData data = (TreeData) item.getData();
      FontData fontDatas[] = item.getFont().getFontData();
      FontData fdata = fontDatas[0];
      Font font = new Font(Display.getCurrent(), fdata.getName(), fdata.getHeight(), SWT.ITALIC);
      item.setFont(font);
      */
      if(!dom.isDirectory())
        return;
      
      //TreeData data = (TreeData) item.getData();
        /*Element elem = Utils.getHotFolderParentElement(data.getElement());
        String key1 = "";
       
        if(elem.getName().equals("order") || elem.getName().equals("add_order"))
          key1 = elem.getName()+ "_" + Utils.getAttributeValue("job_chain",elem)+ "," +Utils.getAttributeValue("id",elem);
        else
          key1 = elem.getName() + "_" + Utils.getAttributeValue("name", elem);
      */
     
     
      if(!dom.getChangedJob().containsKey(key1))
        return;
     
     
     
      if(item.getText().endsWith(SchedulerListener.LOCKS) ||
          item.getText().endsWith(SchedulerListener.PROCESS_CLASSES)) {
        if(!item.getText().startsWith("*")) {
          item.setText("*" + item.getText());         
        }
        return;
      }
     
      if(dom.getChangedJob().get(key1).equals(SchedulerDom.NEW) &&
          !key1.startsWith("process_class")) {
        int i = item.getItemCount() -1;
        if(i < 0) i = 0;
        item = item.getItem(i);
        if(!item.getText().startsWith("*")) {
          //item.getItem(item.getItemCount()-1);
          item.setText("*" + item.getText());         
        }
        return;
      }
     
      while(item != null && item.getParentItem() != null ) {
        String sParent = item.getParentItem().getText();
        if(sParent.equals(SchedulerListener.JOBS) ||
            sParent.equals(SchedulerListener.ORDERS) ||
            sParent.equals(SchedulerListener.JOB_CHAINS) ||
            sParent.equals(SchedulerListener.SCHEDULES) ||
            item.getText().equals(SchedulerListener.LOCKS) ||
            item.getText().equals(SchedulerListener.PROCESS_CLASSES)) {
          if(!item.getText().startsWith("*")) {
            item.setText("*" + item.getText());
           
          }
          item = null;
        } else {
          item = item.getParentItem();
          //item.setFont(font);
        }
      }

    }
View Full Code Here

        Element settings = getSettings();
        _profiles.removeAll();
        if (settings != null) {
            for (Iterator it = settings.getChildren("profile", _dom.getNamespace()).iterator(); it.hasNext();) {
                Element element = (Element) it.next();
                TreeItem item = new TreeItem(_profiles, SWT.NONE);
                String name = Utils.getAttributeValue("name", element);
                item.setText("Sections [Profile: " + (name != null ? name : ProfilesListener.defaultName) + "]");
                item.setData(new TreeData(Editor.DOC_SECTIONS, element, Options.getDocHelpURL("sections")));
                _profiles.setExpanded(true);
                fillSections(item, element, false);
            }
        }
    }
View Full Code Here

        Element settings = getSettings();
        _connections.removeAll();
        if (settings != null) {
            for (Iterator it = settings.getChildren("connection", _dom.getNamespace()).iterator(); it.hasNext();) {
                Element element = (Element) it.next();
                TreeItem item = new TreeItem(_connections, SWT.NONE);
                String name = Utils.getAttributeValue("name", element);
                item.setText("Applications [Connection: " + (name != null ? name : ConnectionsListener.defaultName) + "]");
                item.setData(new TreeData(Editor.DOC_APPLICATIONS, element, Options.getDocHelpURL("applications")));
                _connections.setExpanded(true);
                fillApplications(item, element, false);
            }
        }
    }
View Full Code Here

 


  public void setReChangedTreeItemText() {
    for(int i = 0; i < tree.getItemCount(); i++) {
      TreeItem item = tree.getItem(i);
      setChangedItemText(item);
    }
  } 
View Full Code Here

    public void fillApplications(TreeItem parent, Element element, boolean expand) {
        parent.removeAll();
        for (Iterator it = element.getChildren("application", _dom.getNamespace()).iterator(); it.hasNext();) {
            Element section = (Element) it.next();
            TreeItem item = new TreeItem(parent, SWT.NONE);
            item.setText("Sections [Appl.: " + Utils.getAttributeValue("name", section) + "]");
            item.setData(new TreeData(Editor.DOC_SECTIONS, section, Options.getDocHelpURL("sections")));
            parent.setExpanded(expand);
            fillSections(item, section, false);
        }
    }
View Full Code Here

  private void setChangedItemText(TreeItem item ) {
    if(item.getText().startsWith("*")) {
      item.setText(item.getText().substring(1));     
    }
    for(int j = 0; j < item.getItemCount(); j++) {
      TreeItem cItem = item.getItem(j);
      setChangedItemText(cItem);         
    }     
  }
View Full Code Here

    public void fillSections(TreeItem parent, Element element, boolean expand) {
        parent.removeAll();
        for (Iterator it = element.getChildren("section", _dom.getNamespace()).iterator(); it.hasNext();) {
            Element section = (Element) it.next();
            TreeItem item = new TreeItem(parent, SWT.NONE);
            item.setText("Settings [Section: " + Utils.getAttributeValue("name", section) + "]");
            item.setData(new TreeData(Editor.DOC_SECTION_SETTINGS, section, Options.getDocHelpURL("setting")));
            parent.setExpanded(expand);
        }
    }
View Full Code Here

                    if (!Utils.applyFormChanges(children[i]))
                        return false;
                    children[i].dispose();
                }

                TreeItem item = tree.getSelection()[0];
                TreeData data = (TreeData) item.getData();

                _dom.setInit(true);

                switch (data.getType()) {
                    case Editor.DOC_JOB:
                        new JobForm(c, SWT.NONE, _dom, data.getElement());
                        break;
                    case Editor.DOC_PROCESS:
                        new ProcessForm(c, SWT.NONE, _dom, data.getElement());
                        break;
                    case Editor.DOC_SCRIPT:
                        new JobScriptForm(c, SWT.NONE, _dom, data.getElement());
                        break;
                    case Editor.DOC_MONITOR:
                        ScriptForm form = new ScriptForm(c, SWT.NONE);
                        form.setTitle("Monitor");
                        form.setParams(_dom, data.getElement(), Editor.DOC_MONITOR);
                        form.init(true, true);
                        break;
                    case Editor.DOC_RELEASES:
                        new ReleasesForm(c, SWT.NONE, _dom, data.getElement(), _gui);
                        break;
                    case Editor.DOC_RELEASE:
                        new ReleaseForm(c, SWT.NONE, _dom, data.getElement());
                        break;
                       
                    case Editor.DOC_RELEASE_AUTHOR:
                        new AuthorsForm(c, SWT.NONE, _dom, data.getElement());
                        break;                                           
                    case Editor.DOC_RESOURCES:
                        new ResourcesForm(c, SWT.NONE, _dom, data.getElement());
                        break;
                    case Editor.DOC_DATABASES:
                        new DatabasesForm(c, SWT.NONE, _dom, data.getElement(), _gui);
                        break;
                    case Editor.DOC_DATABASES_RESOURCE:
                        new DatabaseResourcesForm(c, SWT.NONE, _dom, data.getElement());
                        break;
                    case Editor.DOC_FILES:
                        new FilesForm(c, SWT.NONE, _dom, data.getElement());
                        break;
                    case Editor.DOC_DOCUMENTATION:
                        NoteForm doc = new NoteForm(c, SWT.NONE, Editor.DOC_DOCUMENTATION);
                        doc.setTitle("Note");
                         doc.setParams(_dom, data.getElement(), "documentation", false);
                        break;
                    case Editor.DOC_CONFIGURATION:
                        NoteForm note = new NoteForm(c, SWT.NONE, Editor.DOC_CONFIGURATION);
                        note.setTitle("Configuration Note");
                        note.setParams(_dom, data.getElement(), "note", true);
                        break;
                    case Editor.DOC_PARAMS:
                        new ParamsForm(c, SWT.NONE, _dom, data.getElement());
                        break;
                    case Editor.DOC_PAYLOAD:
                        new PayloadForm(c, SWT.NONE, _dom, data.getElement());
                        break;
                    case Editor.DOC_SETTINGS:
                        SettingsListener listener = new SettingsListener(_dom, data.getElement());
                        listener.setSettings();
                        NoteForm settings = new NoteForm(c, SWT.NONE, Editor.DOC_SETTINGS);
                        settings.setSettingsListener(listener);
                        settings.setTitle("Settings Note");
                        settings.setParams(_dom, listener.getSettingsElement(), "note", true);
                        break;
                    case Editor.DOC_PROFILES:
                        new ProfilesForm(c, SWT.NONE, _dom, data.getElement(), this);
                        break;
                    case Editor.DOC_SECTIONS:
                        new SectionsForm(c, SWT.NONE, _dom, data.getElement(), this, item);
                        break;
                    case Editor.DOC_SECTION_SETTINGS:
                        new SettingForm(c, SWT.NONE, _dom, data.getElement());
                        break;
                    case Editor.DOC_CONNECTIONS:
                        new ConnectionsForm(c, SWT.NONE, _dom, data.getElement(), this);
                        break;
                    case Editor.DOC_APPLICATIONS:
                        new ApplicationsForm(c, SWT.NONE, _dom, data.getElement(), this, item);
                        break;
                    default:
                        System.out.println("no form found for " + item.getText());
                }

                c.layout();

            }
View Full Code Here

TOP

Related Classes of org.eclipse.swt.widgets.TreeItem

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.