Package sos.scheduler.editor.actions.forms

Examples of sos.scheduler.editor.actions.forms.ActionsForm


      currdom = (DocumentationDom)form.getDom();
    } else if(MainWindow.getContainer().getCurrentEditor() instanceof JobChainConfigurationForm) {
      JobChainConfigurationForm form =(JobChainConfigurationForm)MainWindow.getContainer().getCurrentEditor();
      currdom = (DetailDom)form.getDom();
    }else if(MainWindow.getContainer().getCurrentEditor() instanceof ActionsForm) {
      ActionsForm form =(ActionsForm)MainWindow.getContainer().getCurrentEditor();
      currdom = (ActionsDom)form.getDom();
    } else {
      MainWindow.message("Could not save FTP File. <unspecified type>  ", SWT.ICON_WARNING);
    }
    return currdom;
  }
View Full Code Here


                } else if (container.getCurrentEditor() instanceof DocumentationForm) {
                  DocumentationForm form =(DocumentationForm)container.getCurrentEditor();
                  form.updateTree("main");
                  form.update();
                } else if (container.getCurrentEditor() instanceof ActionsForm) {
                  ActionsForm form =(ActionsForm)container.getCurrentEditor();
                  form.updateTree("main");
                  form.update();
                }
                //dom.setFileLastModified(f.lastModified());

                //System.out.println("neu= " + f.lastModified());
                //System.out.println("neu= " + dom.getFileLastModified());
View Full Code Here

 
  private              Button           butApply                      = null;

  public SaveEventsDialogForm() {
    try {
    ActionsForm f = (ActionsForm)MainWindow.getContainer().getCurrentEditor();
    dom = f.getDom();   
    sosString = new SOSString();
    showForm();
    init();
   
    while (!_shell.isDisposed()) {
View Full Code Here


        XPath x3 = XPath.newInstance("//action[@name='"+ name + "']");        
        List listOfElement_3 = x3.selectNodes(_dom.getDoc());
        if(!listOfElement_3.isEmpty()) {         
          ActionsForm f = (ActionsForm)(sos.scheduler.editor.app.MainWindow.getContainer().getCurrentEditor());
          if(f == null)
            return;
          Tree tree = f.getTree();
          for(int i = 0; i < tree.getItemCount(); i++) {           
            TreeItem item = tree.getItem(i);
            if(item.getText().equals("Actions")){
              TreeItem[] jobsItem = item.getItems();
              for(int j = 0; j < jobsItem.length; j++) {
                TreeItem jItem = jobsItem[j];
                //if(jItem.getText().equals("Job Chain: "+ name)){
                if(jItem.getText().endsWith(sos.scheduler.editor.actions.listeners.ActionsListener.ACTION_PREFIX + name)){
                  tree.setSelection(new TreeItem [] {jItem});
                  f.updateTreeItem(jItem.getText());
                  f.updateTree("");
                  break;
                }
              }
            }
          }
        }
      } else if(type == Editor.EVENTS) {
        //<event_group logic="or" group="1">
        XPath x3 = XPath.newInstance("//event_group[@group='"+ name + "']");   


        List listOfElement_3 = x3.selectNodes(_dom.getDoc());
        if(!listOfElement_3.isEmpty()) {         
          ActionsForm f = (ActionsForm)(sos.scheduler.editor.app.MainWindow.getContainer().getCurrentEditor());
          if(f == null)
            return;
          Tree tree = f.getTree();
          if(tree.getSelectionCount() > 0) {
            TreeItem itemp = tree.getSelection()[0];
            for(int i = 0; i < itemp.getItemCount(); i++) {           
              TreeItem item = itemp.getItem(i);
              if(item.getText().endsWith(sos.scheduler.editor.actions.listeners.ActionsListener.GROUP_PREFIX + name)){
                tree.setSelection(new TreeItem [] {item});
                f.updateTreeItem(item.getText());
                f.updateTree("");
                break;
              }
            }
          }           
        }
      } else if(type == Editor.ACTION_COMMANDS) {
        XPath x3 = XPath.newInstance("//command[@name='"+ name + "']");   


        List listOfElement_3 = x3.selectNodes(_dom.getDoc());
        if(!listOfElement_3.isEmpty()) {         
          ActionsForm f = (ActionsForm)(sos.scheduler.editor.app.MainWindow.getContainer().getCurrentEditor());
          if(f == null)
            return;
          Tree tree = f.getTree();
          if(tree.getSelectionCount() > 0) {
            TreeItem itemp = tree.getSelection()[0];
            for(int i = 0; i < itemp.getItemCount(); i++) {           
              TreeItem item = itemp.getItem(i);
              if(item.getText().endsWith(sos.scheduler.editor.actions.listeners.ActionsListener.COMMAND_PREFIX + name)){
                tree.setSelection(new TreeItem [] {item});
                f.updateTreeItem(item.getText());
                f.updateTree("");
                break;
              }
            }
          }           
        }
      } else if (type == Editor.JOB_COMMAND_EXIT_CODES &&
          sos.scheduler.editor.app.MainWindow.getContainer().getCurrentEditor() instanceof ActionsForm){


        XPath x3 = null;
        String job = "";
        if(name.startsWith("start_job")) {
          job = name.substring("start_job: ".length());
          x3 = XPath.newInstance("//command/start_job[@job='"+ job + "']");

        } else {
          String child = name.substring(0, name.indexOf(": "));
          job = name.substring(child.length() + 2);
          x3 = XPath.newInstance("//command/"+child+"[@job_chain='"+ job + "']");           

        }


        List listOfElement_3 = x3.selectNodes(_dom.getDoc());
        if(!listOfElement_3.isEmpty()) {         
          ActionsForm f = (ActionsForm)(sos.scheduler.editor.app.MainWindow.getContainer().getCurrentEditor());
          if(f == null)
            return;
          Tree tree = f.getTree();
          if(tree.getSelectionCount() > 0) {
            TreeItem itemp = tree.getSelection()[0];
            for(int i = 0; i < itemp.getItemCount(); i++) {           
              TreeItem item = itemp.getItem(i);
              if(item.getText().equals(name)){
                tree.setSelection(new TreeItem [] {item});
                f.updateTreeItem(item.getText());
                f.updateTree("");
                break;
              }
            }
          }           
        }
      } else if (type == Editor.JOB_COMMAND_EXIT_CODES &&
          sos.scheduler.editor.app.MainWindow.getContainer().getCurrentEditor() instanceof SchedulerForm){


        XPath x3 = null;
        String job = "";
        if(name.startsWith("start_job")) {
          job = name.substring("start_job: ".length());
          x3 = XPath.newInstance("//commands/start_job[@job='"+ job + "']");

        } else {
          String child = name.substring(0, name.indexOf(": "));
          job = name.substring(child.length() + 2);
          x3 = XPath.newInstance("//commands/"+child+"[@job_chain='"+ job + "']");           

        }


        List listOfElement_3 = x3.selectNodes(_dom.getDoc());
        if(!listOfElement_3.isEmpty()) {         
          SchedulerForm f = (SchedulerForm)(sos.scheduler.editor.app.MainWindow.getContainer().getCurrentEditor());
          if(f == null)
            return;
          Tree tree = f.getTree();
          if(tree.getSelectionCount() > 0) {
            TreeItem itemp = tree.getSelection()[0];
            for(int i = 0; i < itemp.getItemCount(); i++) {           
              TreeItem item = itemp.getItem(i);
              if(item.getText().equals(name)){
                tree.setSelection(new TreeItem [] {item});
                f.updateTreeItem(item.getText());
                f.updateTree("");
                break;
              }
            }
          }           
        }

      } else if(type == Editor.JOB_COMMAND) {
        SchedulerForm f = (SchedulerForm)(sos.scheduler.editor.app.MainWindow.getContainer().getCurrentEditor());
        if(f == null)
          return;

        Tree tree = f.getTree();
        if(tree.getSelectionCount() > 0) {
          TreeItem itemp = tree.getSelection()[0];
          for(int i = 0; i < itemp.getItemCount(); i++) {           
            TreeItem item = itemp.getItem(i);
            if(item.getText().equals(name)){
              tree.setSelection(new TreeItem [] {item});
              f.updateTreeItem(item.getText());
              f.updateTree("");
              break;
            }
          }
        }
View Full Code Here

      return null;
  }

 
  public ActionsForm openActions(String filename) {
    ActionsForm actionsForm = new ActionsForm(this, folder, SWT.NONE);

    if(actionsForm.open(filename, filelist)) {
      CTabItem tab = newItem(actionsForm, actionsForm.getFilename());
      tab.setImage(new Image(tab.getDisplay(), getClass().getResourceAsStream(
          "/sos/scheduler/editor/editor-small.png")));
      return actionsForm;
    } else
      return null;
View Full Code Here

    }
    return null;
 
 
  public ActionsForm newActions() {   
      ActionsForm actions = new ActionsForm(this, folder, SWT.NONE);
      actions.openBlank();
      newItem(actions, NEW_DOCUMENTATION_TITLE);
      return actions;
    }
View Full Code Here

TOP

Related Classes of sos.scheduler.editor.actions.forms.ActionsForm

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.