Package org.eclipse.swt.widgets

Examples of org.eclipse.swt.widgets.TableItem



  public boolean deleteJob(Table table) {
    int index = table.getSelectionIndex();
    if (index >= 0) {
      TableItem item = table.getItem(index);
      Element e = (Element) item.getData();
      e.detach();
      _dom.setChanged(true);
      _dom.setChangedForDirectory("job", Utils.getAttributeValue("name", e) ,SchedulerDom.DELETE);
      table.remove(index);
      _main.updateJobs();
View Full Code Here


        ContextMenu.goTo(tCommands.getSelection()[0].getText(0) + ": " + str, _dom, Editor.JOB_COMMAND_EXIT_CODES);
      }
    });
    tCommands.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(final SelectionEvent e) {
        TableItem item = (TableItem) e.item;
        if (item == null)
          return;
        bRemoveExitcode.setEnabled(tCommands.getSelectionCount() > 0);

      }
View Full Code Here

  private void addJob() {
    Element e = null;

    e = new Element("start_job");       
    e.setAttribute("job", "job" + tCommands.getItemCount());
    TableItem item = new TableItem(tCommands, SWT.NONE);
    item.setText(new String[] { "start_job", "job"+tCommands.getItemCount(), "", "" });

    listener.addCommand(e);

  }
View Full Code Here

    Element e = null;

    e = new Element("order");     
    e.setAttribute("job_chain", "job_chain" + tCommands.getItemCount());   
    e.setAttribute("replace", "yes");
    TableItem item = new TableItem(tCommands, SWT.NONE);
    item.setText(new String[] { "order", "", "job_chain_" + tCommands.getItemCount(), "" });
    listener.addCommand(e);

  }
View Full Code Here

  }


  public void fillCommands(Table table) {
    boolean created;
    TableItem item = null;

    table.removeAll();
    List c = _command.getChildren();
    Iterator it2 = c.iterator();
    while (it2.hasNext()) {
      Element e2 = (Element) it2.next();
      created = false;
      //if (e2.getName().equals("start_job") || e2.getName().equals("add_order")) {
      if (e2.getName().equals("start_job") || e2.getName().equals("add_order") || e2.getName().equals("order")) {
        if (!created) { // Nur die commands add_order und start_job
          // anzeigen
          item = new TableItem(table, SWT.NONE);
          item.setText(1, "");
          created = true;
        }
        item.setText(0, e2.getName());
        item.setText(3, Utils.getAttributeValue("at", e2));
        if (e2.getName().equals("start_job"))
          item.setText(1, Utils.getAttributeValue("job", e2));
        if (e2.getName().equals("add_order") || e2.getName().equals("order")) {
          item.setText(1, Utils.getAttributeValue("id", e2));
          item.setText(2, Utils.getAttributeValue("job_chain", e2));
        }
      }
    }
  }
View Full Code Here

        table.removeAll();
        int index = 0;
        if (_resources != null) {
            for (Iterator it = _resources.getChildren("database", _dom.getNamespace()).iterator(); it.hasNext();) {
                Element database = (Element) it.next();
                TableItem item = new TableItem(table, SWT.NONE);
                String name = Utils.getAttributeValue("name", database);
                item.setText(0, !name.equals("") ? name : _defaultName);
                item.setText(1, Utils.getBooleanValue("required", database) ? "yes" : "no");
                if (database.equals(_database))
                    table.select(index);
                index++;
            }
        }
View Full Code Here

        table.removeAll();
        int index = 0;
        if (_database != null) {
            for (Iterator it = _database.getChildren("resource", _dom.getNamespace()).iterator(); it.hasNext();) {
                Element resource = (Element) it.next();
                TableItem item = new TableItem(table, SWT.NONE);
                item.setText(0, Utils.getAttributeValue("name", resource));
                item.setText(1, Utils.getAttributeValue("type", resource));
                if (resource.equals(_resource))
                    table.select(index);
                index++;
            }
        }
View Full Code Here

    butAddMissingNodes.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(final SelectionEvent e) {

        try {
          if(tNodes.getSelectionCount() > 0) {
            TableItem item = tNodes.getSelection()[0];
            if(!listener.checkForState(item.getText(3))) {
              listener.selectNode(null);

              listener.applyNode(true, item.getText(3), "", "", "", false);
             
            }

            if(!listener.checkForState(item.getText(4))) {
              listener.selectNode(null);
              listener.applyNode(true, item.getText(4), "", "", "", false);           
            }

            listener.fillChain(tNodes);
            bApplyNode.setEnabled(false);
            bRemoveNode.setEnabled(false);           
View Full Code Here

    if (_commands != null) {
      for (Iterator it = _commands.iterator(); it.hasNext();) {
        Object o = it.next();
        if (o instanceof Element) {
          Element e = (Element) o;
          TableItem item = new TableItem(table, SWT.NONE);
          item.setData(e);
         
          item.setText(0, Utils.getAttributeValue("name", e));
          item.setText(1, Utils.getAttributeValue("scheduler_host", e));
          item.setText(2, Utils.getAttributeValue("schdeuler_port", e));
        }
      }
    }

  }
View Full Code Here

 

  public boolean deleteCommands(Table table) {
    int index = table.getSelectionIndex();
    if (index >= 0) {
      TableItem item = table.getItem(index);
      Element e = (Element) item.getData();
      e.detach();
      _dom.setChanged(true);
      //_dom.setChangedForDirectory("job", Utils.getAttributeValue("name",_job), SchedulerDom.MODIFY);
      table.remove(index);
      _main.updateCommands();
View Full Code Here

TOP

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

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.