Package org.eclipse.swt.widgets

Examples of org.eclipse.swt.widgets.TableItem


      while (it.hasNext()) {
        Object o = it.next();
        if (o instanceof Element) { 
          Element e = (Element) o;
          if (e.getName().equals("copy_params") && type == Editor.COMMANDS) {
            TableItem item = new TableItem(table, SWT.NONE);
            item.setText(0, "<from>");
            item.setText(1, ((Element) o).getAttributeValue("from"));
          } else if (e.getName().equals("param")){
            if(e.getAttributeValue("name") != null) {
              TableItem item = new TableItem(table, SWT.NONE);
              item.setText(0, ((Element) o).getAttributeValue("name"));
              item.setText(1, (((Element) o).getAttributeValue("value") != null ? ((Element) o).getAttributeValue("value") : ""));
              if(parameterDescription != null) {
                item.setData("parameter_description_de", parameterDescription.get("parameter_description_de_" + ((Element) o).getAttributeValue("name")));
                item.setData("parameter_description_en", parameterDescription.get("parameter_description_en_" + ((Element) o).getAttributeValue("name")));
              }
              if(parameterRequired != null && isParameterRequired(((Element) o).getAttributeValue("name")))
                item.setBackground(Options.getRequiredColor());
            }
          }
        }
      }           
    }   
View Full Code Here


    table = new Table(group, SWT.FULL_SELECTION | SWT.BORDER);
    table.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(final SelectionEvent e) {
        if(table.getSelectionCount() > 0) {
          TableItem item = table.getSelection()[0];
          txtEventName.setText(item.getText(0));
          txtEventId.setText(item.getText(1));
          txtTitle.setText(item.getText(2));
          cboEventClass.setText(item.getText(3));             
          txtJobname.setText(item.getText(4));
          txtJobChain.setText(item.getText(5));
          txtOrderId.setText(item.getText(6));
          txtComment.setText(item.getText(7));
          txtExitCode.setText(item.getText(8));
          if(type==Editor.ADD_EVENT_GROUP) {
            int hour = Utils.getHours(item.getText(9), 0);
            int min = Utils.getMinutes(item.getText(9), 0);
            int sec = Utils.getSeconds(item.getText(9), 0);
           
            if((hour+min+sec) > 0) {
              txtHourExpirationPeriod.setText(String.valueOf(Utils.getHours(item.getText(9), 0)));
              txtMinExpirationPeriod.setText(String.valueOf(Utils.getMinutes(item.getText(9), 0)));
              txtSecExpirationPeriod.setText(String.valueOf(Utils.getSeconds(item.getText(9), 0)));
            }
           
            hour = Utils.getHours(item.getText(10), 0);
            min = Utils.getMinutes(item.getText(10), 0);
            sec = Utils.getSeconds(item.getText(10), 0);
           
            if((hour+min+sec) > 0) {
              txtHourExpirationCycle.setText(String.valueOf(Utils.getHours(item.getText(10), 0)));
              txtMinExpirationCycle.setText(String.valueOf(Utils.getMinutes(item.getText(10), 0)));
              txtSecExpirationCycle.setText(String.valueOf(Utils.getSeconds(item.getText(10), 0)));
            }
          }
        }
        butApply.setEnabled(false);
        butRemove.setEnabled(table.getSelectionCount() > 0);
View Full Code Here

        for(int i = 0; i < includeList.size(); i++) {
          Element include = (Element) includeList.get(i);
         
          if(include.getAttributeValue("file") != null) {
            String filename = Utils.getAttributeValue("file", include);
            TableItem item = new TableItem(table, SWT.NONE);
            item.setText(0, filename);
            item.setText(1, "file");
            String fname = new File(filename).getName();
            if(filename.endsWith("holidays.xml") &&
                Options.getHolidaysDescription().values().contains(Options.getSchedulerNormalizedHotFolder() + fname)) {
              //Object key = Options.getHolidaysDescription().get("holiday_id_" + filename.substring(0, filename.indexOf(".holidays.xml")));
              Object key = Options.getHolidaysDescription().get("holiday_id_" + fname.substring(0, fname.indexOf(".holidays.xml")));
              if(key != null)
                item.setText(2, key.toString());
            }
          } else {
            TableItem item = new TableItem(table, SWT.NONE);
           
            String filename = Utils.getAttributeValue("live_file", include);
            item.setText(0, filename);
            item.setText(1, "live_file");
           
            /*if(filename.endsWith("holidays.xml") &&
                Options.getHolidaysDescription().values().contains(Options.getSchedulerNormalizedHotFolder() + filename)) {
              Object key = Options.getHolidaysDescription().get("holiday_id_" + filename.substring(0, filename.indexOf(".holidays.xml")));
              if(key != null)
View Full Code Here

    table.removeAll();
    Iterator it = _lockUseList.iterator();
    while (it.hasNext()) {
      Element e = (Element) it.next();
      TableItem item = new TableItem(table, SWT.NONE);
      item.setText(0, Utils.getAttributeValue("lock", e));
      item.setText(1, Utils.getAttributeValue("exclusive", e));
    }

  }
View Full Code Here

  public void fillAuthentication(Table table) {

    table.removeAll();  
    for (Iterator it = _httpUsers.iterator(); it.hasNext();) {
      Element http_user = (Element) it.next();
      TableItem item = new TableItem(table, SWT.NONE);
      item.setText(0, Utils.getAttributeValue("url_path", http_user));
      item.setText(1, Utils.getAttributeValue("path", http_user));
    }
  }
View Full Code Here

  public void fillHttpAuthenticationTable(Table table) {
    table.removeAll();
    if (_httpUsers != null) {
      for (Iterator it = _httpUsers.iterator(); it.hasNext();) {
        Element e = (Element) it.next();
        TableItem user = new TableItem(table, SWT.NONE);
        user.setText(0, Utils.getAttributeValue("name", e));
        user.setText(1, Utils.getAttributeValue("password_md5", e));
      }
    }
  }
View Full Code Here

  public void fillTable(Table table) {

    table.removeAll();
    for (Iterator it = _list.iterator(); it.hasNext();) {
      Element service = (Element) it.next();
      TableItem item = new TableItem(table, SWT.NONE);
      item.setText(0, Utils.getAttributeValue("name", service));
      item.setText(1, Utils.getAttributeValue("url_path", service));
      item.setText(2, Utils.getAttributeValue("job_chain", service));
    }
  }
View Full Code Here

    if (_service != null) {
      Element params = _service.getChild("params");
      if (params != null) {
        for (Iterator it = params.getChildren("param").iterator(); it.hasNext();) {
          Element e = (Element) it.next();
          TableItem param = new TableItem(table, SWT.NONE);
          param.setText(0, Utils.getAttributeValue("name", e));
          param.setText(1, Utils.getAttributeValue("value", e));
        }
      }
    }
  }
View Full Code Here

      tcValue.setWidth(450);
      tcValue.setText("Value");

      for(int i= 0; i < listOfElement.size(); i++) {
        Element param = (Element)listOfElement.get(i);
        TableItem item = new TableItem( tableIncludeParameter, SWT.NONE);
        item.setText(0, Utils.getAttributeValue("name", param));
        item.setText(1, Utils.getAttributeValue("value", param));
        item.setData("param", param);
      }

     
     
     
      final Button newButton = new Button(group_1, SWT.NONE);
     
      newButton.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, false, false));
      newButton.setText("New");


      //fill Include Params From External File
      /*for(int j = 0; j < listOfElement.size(); j++) {
        Element params_ = (Element)listOfElement.get(j);
        java.util.List paramList = params_.getChildren("param");
        for(int i = 0; i < paramList.size(); i++) {
          Element param = (Element)paramList.get(i);
          TableItem item = new TableItem( tableIncludeParameter, SWT.NONE);
          item.setText(0, Utils.getAttributeValue("name", param));
          item.setText(1, Utils.getAttributeValue("value", param));
          item.setData("param", param);
        }
      }*/


      final Button butIncludeRemove = new Button(group_1, SWT.NONE);     
      final GridData gridData_8 = new GridData(GridData.FILL, GridData.BEGINNING, false, false);
      butIncludeRemove.setLayoutData(gridData_8);
      butIncludeRemove.setText("Remove");
      butIncludeRemove.setEnabled(false);
      butIncludeRemove.addSelectionListener(new org.eclipse.swt.events.SelectionAdapter() {
        public void widgetSelected(org.eclipse.swt.events.SelectionEvent e) {
          updateIncludeParam(includeParameterTabItem,
              false,
              tableIncludeParameter,
              txtIncludeParameter,
              txtIncludeParameterValue,
              butIncludeRemove);
        }
      });
      if(type == Editor.JOB) {

        butImport = new Button(group_1, SWT.NONE);
        butImport.setVisible(false);
        butImport.setLayoutData(new GridData(GridData.FILL, GridData.BEGINNING, false, false));
        //butImport.setText("import");
        butImport.setText(WIZZARD);
        butImport.addSelectionListener(new SelectionAdapter() {
          public void widgetSelected(final SelectionEvent e) {       
            JobAssistentImportJobsForm importParameterForms = new JobAssistentImportJobsForm(new JobListener(dom, listener.getParent(), listener.get_main()), tableIncludeParameter, Editor.JOB);         
            importParameterForms.showAllImportJobs();
          }
        });
        //butImport.setText("Import");
        butImport.setText(WIZZARD);
      }


      txtIncludeParameterValue.addKeyListener(new org.eclipse.swt.events.KeyAdapter() {
        public void keyPressed(org.eclipse.swt.events.KeyEvent e) {
          if (e.keyCode == SWT.CR && !txtIncludeParameter.getText().trim().equals("")){           
            updateIncludeParam(includeParameterTabItem,
                true,
                tableIncludeParameter,
                txtIncludeParameter,
                txtIncludeParameterValue,
                butIncludeRemove);

          }
        }
      });
      txtIncludeParameter.addKeyListener(new org.eclipse.swt.events.KeyAdapter() {
        public void keyPressed(org.eclipse.swt.events.KeyEvent e) {
          if (e.keyCode == SWT.CR && !txtIncludeParameter.equals("")) {           
            updateIncludeParam(includeParameterTabItem,
                true,
                tableIncludeParameter,
                txtIncludeParameter,
                txtIncludeParameterValue,
                butIncludeRemove);
          }
        }
      });

      butoIncludeSave.addSelectionListener(new org.eclipse.swt.events.SelectionAdapter() {
        public void widgetSelected(org.eclipse.swt.events.SelectionEvent e) {

          updateIncludeParam(includeParameterTabItem,
              true,
              tableIncludeParameter,
              txtIncludeParameter,
              txtIncludeParameterValue,
              butIncludeRemove);

        }
      });

      tableIncludeParameter.addSelectionListener(new org.eclipse.swt.events.SelectionAdapter() {
        public void widgetSelected(org.eclipse.swt.events.SelectionEvent e) {
          TableItem item = (TableItem) e.item;
          if (item == null)
            return;
          txtIncludeParameter.setText(item.getText(0));
          txtIncludeParameterValue.setText(item.getText(1));
          butIncludeRemove.setEnabled(tableIncludeParameter.getSelectionCount() > 0);         
          butoIncludeSave.setEnabled(false);
        }
      });

View Full Code Here

   
    if(add) {
      //neue Parameter bzw. editieren vorhandene Parameter    
      boolean found = false;
      for (int i =0; i < tableIncludeParameter.getItemCount(); i++) {
        TableItem item = tableIncludeParameter.getItem(i);
        if(item.getText(0).equals(txtIncludeParameter.getText())) {
          found = true;
          item.setText(0, txtIncludeParameter.getText());
          item.setText(1, txtIncludeParameterValue.getText());
          Element param = (Element)item.getData("param");
          param.setAttribute("name", item.getText(0) );
          param.setAttribute("value", item.getText(1) );
        }
      }
      if(!found) {
        //if(txtIncludeNode.getText().length() == 0) {
        //if(listOfElement.size() > 0 && txtIncludeNode.getText().length() == 0) {
          TableItem item = new TableItem(tableIncludeParameter, SWT.NONE);
          item.setText(0, txtIncludeParameter.getText());
          item.setText(1, txtIncludeParameterValue.getText());
         
         
          /*Element params = null;
          if(listOfElement.size() > 0)
            params = ((Element)listOfElement.get(0)).getParentElement();
          */
       
          Element param = new Element("param");
          param.setAttribute("name", item.getText(0) );
          param.setAttribute("value", item.getText(1) );
          //params.addContent(param);
          item.setData("param", param);
          listOfElement.add(param);
          includeParameterTabItem.setData("params", listOfElement);
        //} else {                             
        //  MainWindow.message("could not save cause note path ist not clearly", SWT.ICON_WARNING);
        //}
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.