Example #1
0
  /**
   * Creates the Verify and Cancel buttons for the button bar
   *
   * @see
   *     org.eclipse.jface.dialogs.Dialog#createButtonsForButtonBar(org.eclipse.swt.widgets.Composite)
   */
  public void createButtonsForButtonBar(Composite parent) {
    parent.setLayout(new FormLayout());

    verifyRun = new Button(parent, SWT.NULL);
    verifyRun.setText("Run Verify");
    verifyRun.addSelectionListener(this);
    verifyRun.setToolTipText("Completely runs through the verification of this program");

    verifyStep = new Button(parent, SWT.NULL);
    verifyStep.setText("Step Verify");
    verifyStep.addSelectionListener(this);
    verifyStep.setToolTipText("Step through the verification of this program");

    close = new Button(parent, SWT.NULL);
    close.setText("Close");

    FormData formData = new FormData();
    formData.right = new FormAttachment(close, -10);
    formData.bottom = new FormAttachment(100, -10);
    verifyRun.setLayoutData(formData);

    formData = new FormData();
    formData.right = new FormAttachment(verifyRun, -10);
    formData.bottom = new FormAttachment(100, -10);
    verifyStep.setLayoutData(formData);

    formData = new FormData();
    formData.right = new FormAttachment(100, -10);
    formData.bottom = new FormAttachment(100, -10);
    close.setLayoutData(formData);
    close.addSelectionListener(this);
  }
  @Override
  protected void createSearchControl(
      Composite searchComposite, HashMap<String, Control> bindedControls) {
    searchComposite.setLayout(new FormLayout());

    FormData searchCompositeData = (FormData) searchComposite.getLayoutData();
    searchCompositeData.bottom = new FormAttachment(0, 65);
    searchComposite.setLayoutData(searchCompositeData);

    Composite mainSearch = new Composite(searchComposite, SWT.NONE);
    FormData formData = new FormData();
    formData.left = new FormAttachment(0, 0);
    formData.top = new FormAttachment(0, 0);
    formData.right = new FormAttachment(100, 0);
    formData.bottom = new FormAttachment(100, 0);
    mainSearch.setLayoutData(formData);

    String modelFilePath = "com/hhh/platform/ops/ui/run/LogRunViewSearcher.xml";

    InputStream xmlis = getClass().getClassLoader().getResourceAsStream(modelFilePath);
    XMLModelControlsCreator controlsCreator = new XMLModelControlsCreator(xmlis);

    controlsCreator.createContents(mainSearch);
    bindedControls.putAll(controlsCreator.getBindedControls());
  }
 private void createDropWidget(final Composite parent) {
   parent.setLayout(new FormLayout());
   Combo combo = new Combo(parent, SWT.READ_ONLY);
   combo.setItems(
       new String[] {
         "Toggle Button",
         "Radio Button",
         "Checkbox",
         "Canvas",
         "Label",
         "List",
         "Table",
         "Tree",
         "Text"
       });
   combo.select(LABEL);
   dropControlType = combo.getSelectionIndex();
   dropControl = createWidget(dropControlType, parent, "Drop Target");
   combo.addSelectionListener(
       new SelectionAdapter() {
         @Override
         public void widgetSelected(final SelectionEvent e) {
           Object data = dropControl.getLayoutData();
           Composite parent = dropControl.getParent();
           dropControl.dispose();
           Combo c = (Combo) e.widget;
           dropControlType = c.getSelectionIndex();
           dropControl = createWidget(dropControlType, parent, "Drop Target");
           dropControl.setLayoutData(data);
           updateDropTarget();
           parent.layout();
         }
       });
   Button b = new Button(parent, SWT.CHECK);
   b.setText("DropTarget");
   b.addSelectionListener(
       new SelectionAdapter() {
         @Override
         public void widgetSelected(final SelectionEvent e) {
           dropEnabled = ((Button) e.widget).getSelection();
           updateDropTarget();
         }
       });
   b.setSelection(dropEnabled);
   FormData data = new FormData();
   data.top = new FormAttachment(0, 10);
   data.bottom = new FormAttachment(combo, -10);
   data.left = new FormAttachment(0, 10);
   data.right = new FormAttachment(100, -10);
   dropControl.setLayoutData(data);
   data = new FormData();
   data.bottom = new FormAttachment(100, -10);
   data.left = new FormAttachment(0, 10);
   combo.setLayoutData(data);
   data = new FormData();
   data.bottom = new FormAttachment(100, -10);
   data.left = new FormAttachment(combo, 10);
   b.setLayoutData(data);
   updateDropTarget();
 }
Example #4
0
  protected void layOutPropertyPanel(int deviceTypes, SWTList rowRenderer) {
    Composite propertiesComposite = editor.getSWTPropertiesComposite();

    addHandOnKeyboardToStart(deviceTypes, propertiesComposite);

    frameList = rowRenderer;
    frameList.setTable(
        new Table(propertiesComposite, SWT.SINGLE | SWT.BORDER | SWT.FULL_SELECTION));

    demonstrateScriptButton = new Button(propertiesComposite, SWT.NONE);
    demonstrateScriptButton.setText(startDemonstratingLabel);
    shell.setDefaultButton(demonstrateScriptButton);
    demonstrateScriptButton.addSelectionListener(
        new SWTWidgetChangeHandler(SEFrameChooserLID.OpenScriptEditor));

    lIDMap.addWidget(
        SEFrameChooserLID.OpenScriptEditor, demonstrateScriptButton, ListenerIdentifierMap.NORMAL);

    closeButton = new Button(propertiesComposite, SWT.NONE);
    closeButton.setText(L10N.get("SE.Close", "Close"));
    closeButton.addSelectionListener(new SWTWidgetChangeHandler(CogToolLID.CloseWindow));

    propertiesComposite.setLayout(new FormLayout());

    // First thing resides at the top
    FormData data = new FormData();
    data.top = new FormAttachment(0, 0);
    data.left = new FormAttachment(0, 5);
    data.right = new FormAttachment(100, 0);

    positionStartLocParms(data);

    frameList.getTable().setLayoutData(data);

    data = new FormData();
    data.bottom = new FormAttachment(100, 0);
    data.left = new FormAttachment(0, 5);
    demonstrateScriptButton.setLayoutData(data);

    data = new FormData();
    data.top = new FormAttachment(demonstrateScriptButton, 0, SWT.TOP);
    data.left = new FormAttachment(demonstrateScriptButton, 5, SWT.RIGHT);
    data.bottom = new FormAttachment(100, 0);
    closeButton.setLayoutData(data);

    SashUtility.createVerticalSash(
        editor.bodyComposite,
        FRAME_LIST_WIDTH,
        250,
        SWT.RIGHT,
        propertiesComposite,
        editor.getPropFormData(),
        editor.scrollComposite,
        editor.getScrollFormData());
  }
Example #5
0
  /** @param args */
  public static void main(String[] args) {
    Display display = new Display();
    final Shell shell = new Shell(display);
    Button button1 = new Button(shell, SWT.PUSH);
    button1.setText("Button 1");
    final Sash sash = new Sash(shell, SWT.VERTICAL);
    Button button2 = new Button(shell, SWT.PUSH);
    button2.setText("Button 2");

    final FormLayout form = new FormLayout();
    shell.setLayout(form);

    FormData button1Data = new FormData();
    button1Data.left = new FormAttachment(0, 0);
    button1Data.right = new FormAttachment(sash, 0);
    button1Data.top = new FormAttachment(0, 0);
    button1Data.bottom = new FormAttachment(100, 0);
    button1.setLayoutData(button1Data);

    final int limit = 20, percent = 50;
    final FormData sashData = new FormData();
    sashData.left = new FormAttachment(percent, 0);
    sashData.top = new FormAttachment(0, 0);
    sashData.bottom = new FormAttachment(100, 0);
    sash.setLayoutData(sashData);
    sash.addListener(
        SWT.Selection,
        new Listener() {
          public void handleEvent(Event e) {
            Rectangle sashRect = sash.getBounds();
            Rectangle shellRect = shell.getClientArea();
            int right = shellRect.width - sashRect.width - limit;
            e.x = Math.max(Math.min(e.x, right), limit);
            if (e.x != sashRect.x) {
              sashData.left = new FormAttachment(0, e.x);
              shell.layout();
            }
          }
        });

    FormData button2Data = new FormData();
    button2Data.left = new FormAttachment(sash, 0);
    button2Data.right = new FormAttachment(100, 0);
    button2Data.top = new FormAttachment(0, 0);
    button2Data.bottom = new FormAttachment(100, 0);
    button2.setLayoutData(button2Data);

    shell.pack();
    shell.open();
    while (!shell.isDisposed()) {
      if (!display.readAndDispatch()) display.sleep();
    }
    display.dispose();
  }
  public void createControl(Composite parent) {
    int margin = Const.MARGIN;

    // create the composite to hold the widgets
    Composite composite = new Composite(parent, SWT.NONE);
    props.setLook(composite);

    FormLayout compLayout = new FormLayout();
    compLayout.marginHeight = Const.FORM_MARGIN;
    compLayout.marginWidth = Const.FORM_MARGIN;
    composite.setLayout(compLayout);

    wSourceDB = new List(composite, SWT.SINGLE | SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
    props.setLook(wSourceDB);
    for (int i = 0; i < databases.size(); i++) {
      DatabaseMeta dbInfo = databases.get(i);
      wSourceDB.add(dbInfo.getName());
    }
    fdSourceDB = new FormData();
    fdSourceDB.top = new FormAttachment(0, 0);
    fdSourceDB.left = new FormAttachment(0, 0);
    fdSourceDB.bottom = new FormAttachment(100, 0);
    fdSourceDB.right = new FormAttachment(50, 0);
    wSourceDB.setLayoutData(fdSourceDB);
    wSourceDB.addSelectionListener(
        new SelectionAdapter() {
          public void widgetSelected(SelectionEvent e) {
            setPageComplete(false);
          }
        });

    wTargetDB = new List(composite, SWT.SINGLE | SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
    props.setLook(wTargetDB);
    for (int i = 0; i < databases.size(); i++) {
      DatabaseMeta dbInfo = databases.get(i);
      wTargetDB.add(dbInfo.getName());
    }
    fdTargetDB = new FormData();
    fdTargetDB.top = new FormAttachment(0, 0);
    fdTargetDB.left = new FormAttachment(50, margin);
    fdTargetDB.bottom = new FormAttachment(100, 0);
    fdTargetDB.right = new FormAttachment(100, 0);
    wTargetDB.setLayoutData(fdTargetDB);
    wTargetDB.addSelectionListener(
        new SelectionAdapter() {
          public void widgetSelected(SelectionEvent e) {
            setPageComplete(false);
          }
        });

    // set the composite as the control for this page
    setControl(composite);
  }
  /** Create contents of the window. */
  protected void createContents() {
    shlCrisisList = new Shell();
    shlCrisisList.setSize(517, 310);
    shlCrisisList.setText("Crisis List");
    shlCrisisList.setLayout(new FormLayout());

    table = new Table(shlCrisisList, SWT.BORDER | SWT.FULL_SELECTION);
    table.setLinesVisible(true);
    table.setHeaderVisible(true);
    FormData fd_table = new FormData();
    fd_table.right = new FormAttachment(0, 507);
    fd_table.top = new FormAttachment(0, 10);
    fd_table.left = new FormAttachment(0, 10);
    table.setLayoutData(fd_table);

    TableColumn tableColumn = new TableColumn(table, SWT.NONE);
    tableColumn.setWidth(100);
    tableColumn.setText("Crisis number");

    TableColumn tableColumn_1 = new TableColumn(table, SWT.NONE);
    tableColumn_1.setWidth(100);
    tableColumn_1.setText("Label");

    TableColumn tableColumn_2 = new TableColumn(table, SWT.NONE);
    tableColumn_2.setWidth(100);
    tableColumn_2.setText("Place");

    TableColumn tableColumn_3 = new TableColumn(table, SWT.NONE);
    tableColumn_3.setWidth(100);
    tableColumn_3.setText("State");

    TableColumn tableColumn_4 = new TableColumn(table, SWT.NONE);
    tableColumn_4.setWidth(100);
    tableColumn_4.setText("Details");

    Button button = new Button(shlCrisisList, SWT.NONE);
    button.addMouseListener(
        new MouseAdapter() {
          @Override
          public void mouseDown(MouseEvent e) {
            NewCrisis.main(null);
          }
        });
    fd_table.bottom = new FormAttachment(100, -63);
    button.setText("New crisis");
    FormData fd_button = new FormData();
    fd_button.top = new FormAttachment(table, 18);
    fd_button.bottom = new FormAttachment(100, -10);
    fd_button.left = new FormAttachment(0, 206);
    fd_button.right = new FormAttachment(100, -217);
    button.setLayoutData(fd_button);
  }
Example #8
0
  protected void positionStartLocParms(FormData data) {
    if (mouseHandStartLoc != null) {
      FormData handLayoutData = new FormData();
      handLayoutData.bottom = new FormAttachment(demonstrateScriptButton, -5, SWT.TOP);
      handLayoutData.left = new FormAttachment(userMouseHand, 0, SWT.LEFT);
      handLayoutData.right = new FormAttachment(100, 0);

      mouseHandStartLoc.setLayoutData(handLayoutData);

      data.bottom = new FormAttachment(userMouseHand, -5, SWT.TOP);
    } else {
      data.bottom = new FormAttachment(demonstrateScriptButton, -5, SWT.TOP);
    }
  }
Example #9
0
  /**
   * Create contents of the view part.
   *
   * @param parent received by injection
   */
  @Inject
  public void createPartControl(Composite parent) {
    Composite container = new Composite(parent, SWT.NONE);
    container.setLayout(new FormLayout());

    Group grpIdentity = new Group(container, SWT.NONE);
    FormData fd_grpIdentity = new FormData();
    fd_grpIdentity.bottom = new FormAttachment(0, 94);
    fd_grpIdentity.right = new FormAttachment(0, 402);
    fd_grpIdentity.top = new FormAttachment(0);
    fd_grpIdentity.left = new FormAttachment(0);
    grpIdentity.setLayoutData(fd_grpIdentity);
    grpIdentity.setText("Identity");
    grpIdentity.setLayout(new GridLayout(2, false));

    Label label = new Label(grpIdentity, SWT.NONE);
    label.setLayoutData(new GridData(SWT.CENTER, SWT.CENTER, false, false, 2, 1));
    label.setText("display Name");
    label.setAlignment(SWT.CENTER);

    Label lblNom = new Label(grpIdentity, SWT.NONE);
    lblNom.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
    lblNom.setText("Nom : ");

    txtAName = new Text(grpIdentity, SWT.BORDER);
    txtAName.setText("A name");
    txtAName.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));

    Label lblPrnom = new Label(grpIdentity, SWT.NONE);
    lblPrnom.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
    lblPrnom.setText("Pr\u00E9nom");

    txtUnPrnom = new Text(grpIdentity, SWT.BORDER);
    txtUnPrnom.setText("Un pr\u00E9nom");
    txtUnPrnom.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));

    Group grpAdresse = new Group(container, SWT.NONE);
    grpAdresse.setText("Adresse");
    grpAdresse.setLayout(new FillLayout(SWT.HORIZONTAL));
    FormData fd_grpAdresse = new FormData();
    fd_grpAdresse.right = new FormAttachment(grpIdentity, 0, SWT.RIGHT);
    fd_grpAdresse.bottom = new FormAttachment(100, -12);
    fd_grpAdresse.top = new FormAttachment(grpIdentity, 6);
    fd_grpAdresse.left = new FormAttachment(0);
    grpAdresse.setLayoutData(fd_grpAdresse);

    Label lblAdresse = new Label(grpAdresse, SWT.NONE);
    lblAdresse.setText("Adresse");
  }
Example #10
0
  /** @param parent */
  private void createSubTitle(Composite parent) {
    FormData pkgNameLabelFromData = new FormData();
    pkgNameLabelFromData.top = new FormAttachment(0, 5);
    pkgNameLabelFromData.left = new FormAttachment(0, 5);
    pkgNameLabelFromData.right = new FormAttachment(100, -50);
    pkgNameLabelFromData.bottom = new FormAttachment(parent, 30); // 绝对位置
    pkgNameText = new Text(parent, SWT.BORDER);
    pkgNameText.setToolTipText("在这里可以手动输入要进行测试的进程名");
    pkgNameText.setBackground(new Color(Display.getCurrent(), 192, 192, 192));
    pkgNameText.setLayoutData(pkgNameLabelFromData);

    FormData addBtnFromData = new FormData();
    addBtnFromData.top = new FormAttachment(0, 5);
    addBtnFromData.left = new FormAttachment(pkgNameText, 5);
    addBtnFromData.right = new FormAttachment(100, -5);
    addBtnFromData.bottom = new FormAttachment(parent, 30); // 绝对位置

    addBtn = new Button(parent, SWT.NONE);
    addBtn.setText("添加");
    addBtn.setLayoutData(addBtnFromData);
    addBtn.addSelectionListener(
        new SelectionListener() {

          @Override
          public void widgetSelected(SelectionEvent e) {
            if (isSupportAddOrDeleteOper) {
              APTState.getInstance().DealWithEventBefore(APTEventEnum.CONFIGRURE_OPER);
              String text = pkgNameText.getText().trim();
              if (text.equals("")) {
                APTConsoleFactory.getInstance().APTPrint("请输入合法的包名");
                return;
              }

              PkgInfo dataItem = new PkgInfo();
              dataItem.contents[PkgInfo.NAME_INDEX] = text;

              dataItem.contents[PkgInfo.PID_INDEX] = Constant.PID_NOT_EXSIT;

              addDataItem(targetPkgTableViewer, dataItem);
              APTState.getInstance().DealWithEventAfter(APTEventEnum.CONFIGRURE_OPER);
            } else {
              APTConsoleFactory.getInstance().APTPrint("Operation forbid");
            }
          }

          @Override
          public void widgetDefaultSelected(SelectionEvent e) {}
        });
  }
Example #11
0
  /**
   * Open the dialog.
   *
   * @return the result
   */
  public DeviceApps open() {
    init();
    createContents();
    Button btnProfile = new Button(shlDecruptWizard, SWT.NONE);
    btnProfile.addSelectionListener(
        new SelectionAdapter() {
          @Override
          public void widgetSelected(SelectionEvent e) {
            apps.saveProfile();
          }
        });
    FormData fd_btnProfile = new FormData();
    fd_btnProfile.bottom = new FormAttachment(100, -10);
    fd_btnProfile.left = new FormAttachment(0, 10);
    btnProfile.setLayoutData(fd_btnProfile);
    btnProfile.setText("Save profile");

    Button btnSaveAsNew = new Button(shlDecruptWizard, SWT.NONE);
    btnSaveAsNew.addSelectionListener(
        new SelectionAdapter() {
          @Override
          public void widgetSelected(SelectionEvent e) {
            ProfileSave save = new ProfileSave(shlDecruptWizard, SWT.PRIMARY_MODAL | SWT.SHEET);
            save.open(apps);
            comboProfile.removeAll();
            Iterator<String> itprofiles = apps.getProfiles().iterator();
            while (itprofiles.hasNext()) {
              comboProfile.add(itprofiles.next());
            }
            comboProfile.select(comboProfile.indexOf(apps.getCurrentProfile()));
            init();
          }
        });
    FormData fd_btnSaveAsNew = new FormData();
    fd_btnSaveAsNew.left = new FormAttachment(btnProfile, 6);
    fd_btnSaveAsNew.bottom = new FormAttachment(100, -10);
    btnSaveAsNew.setLayoutData(fd_btnSaveAsNew);
    btnSaveAsNew.setText("Save as new profile");
    shlDecruptWizard.open();
    shlDecruptWizard.layout();
    Display display = getParent().getDisplay();
    while (!shlDecruptWizard.isDisposed()) {
      if (!display.readAndDispatch()) {
        display.sleep();
      }
    }
    return apps;
  }
  public void createControl(Composite parent) {
    // create the composite to hold the widgets
    Composite composite = new Composite(parent, SWT.NONE);
    props.setLook(composite);

    FormLayout compLayout = new FormLayout();
    compLayout.marginHeight = Const.FORM_MARGIN;
    compLayout.marginWidth = Const.FORM_MARGIN;
    composite.setLayout(compLayout);

    MouseAdapter lsMouse =
        new MouseAdapter() {
          public void mouseDown(MouseEvent e) {
            int s = getSize();
            // System.out.println("size = "+s);
            setPageComplete(s > 0);
          }
        };

    wTable = new FixedTableDraw(composite, props, this, fields);
    wTable.setRows(rows);
    props.setLook(wTable);
    wTable.setFields(fields);
    fdTable = new FormData();
    fdTable.left = new FormAttachment(0, 0);
    fdTable.right = new FormAttachment(100, 0);
    fdTable.top = new FormAttachment(0, 0);
    fdTable.bottom = new FormAttachment(100, 0);
    wTable.setLayoutData(fdTable);
    wTable.addMouseListener(lsMouse);

    // set the composite as the control for this page
    setControl(composite);
  }
  /**
   * Creates the file sets area.
   *
   * @param fileSetsContainer the container to add the file sets area to
   */
  private Control createFileSetsArea(Composite fileSetsContainer) throws CheckstylePluginException {

    Control[] controls = fileSetsContainer.getChildren();
    for (int i = 0; i < controls.length; i++) {
      controls[i].dispose();
    }

    if (mProjectConfig.isUseSimpleConfig()) {
      mFileSetsEditor = new SimpleFileSetsEditor(this);
    } else {
      mFileSetsEditor = new ComplexFileSetsEditor(this);
    }

    mFileSetsEditor.setFileSets(mProjectConfig.getFileSets());

    Control editor = mFileSetsEditor.createContents(mFileSetsContainer);

    fileSetsContainer.setLayout(new FormLayout());
    FormData fd = new FormData();
    fd.left = new FormAttachment(0);
    fd.top = new FormAttachment(0);
    fd.right = new FormAttachment(100);
    fd.bottom = new FormAttachment(100);
    editor.setLayoutData(fd);

    return fileSetsContainer;
  }
Example #14
0
  /** Creates content Composite. */
  Composite eswtConstructContent(int style) {
    Composite comp = super.eswtConstructContent(SWT.VERTICAL);

    FormLayout layout = new FormLayout();
    layout.marginBottom = Style.pixelMetric(Style.QSTYLE_PM_LAYOUTBOTTOMMARGIN);
    layout.marginTop = Style.pixelMetric(Style.QSTYLE_PM_LAYOUTTOPMARGIN);
    layout.marginLeft = Style.pixelMetric(Style.QSTYLE_PM_LAYOUTLEFTMARGIN);
    layout.marginRight = Style.pixelMetric(Style.QSTYLE_PM_LAYOUTRIGHTMARGIN);
    layout.spacing = Style.pixelMetric(Style.QSTYLE_PM_LAYOUTVERTICALSPACING);
    comp.setLayout(layout);

    eswtScrolledText = new ScrolledTextComposite(comp, comp.getVerticalBar());
    eswtImgLabel = new LabelExtension(comp, SWT.NONE);

    FormData imageLD = new FormData();
    imageLD.right = new FormAttachment(100);
    imageLD.top = new FormAttachment(0);
    eswtImgLabel.setLayoutData(imageLD);

    FormData scrolledTextLD = new FormData();
    scrolledTextLD.left = new FormAttachment(0);
    scrolledTextLD.top = new FormAttachment(0);
    scrolledTextLD.right = new FormAttachment(eswtImgLabel);
    eswtScrolledText.setLayoutData(scrolledTextLD);

    eswtProgbarLD = new FormData();
    eswtProgbarLD.left = new FormAttachment(0);
    eswtProgbarLD.right = new FormAttachment(100);
    eswtProgbarLD.bottom = new FormAttachment(100);

    eswtUpdateProgressbar(comp, false, false);

    return comp;
  }
Example #15
0
  @Override
  protected Control createContents(Composite parent) {

    Composite rootArea = new Composite(parent, SWT.NONE);
    m_timeChooserContent = new TimeChooserContent(rootArea, m_displayDate, getEnvironment());
    m_timeChooserContent.addTimeChangedListener(
        new AbstractDateSelectionListener() {
          @Override
          public void dateChanged(DateSelectionEvent e) {
            m_returnDate = (Date) e.getData();
            getShell()
                .getDisplay()
                .asyncExec(
                    new Runnable() {
                      @Override
                      public void run() {
                        close();
                      }
                    });
          }
        });
    m_timeChooserContent.setDate(m_displayDate);
    // layout
    rootArea.setLayout(new FormLayout());
    FormData data = new FormData();
    data.top = new FormAttachment(0, 0);
    data.left = new FormAttachment(0, 0);
    data.right = new FormAttachment(100, 0);
    data.bottom = new FormAttachment(100, 0);
    m_timeChooserContent.setLayoutData(data);
    return rootArea;
  }
Example #16
0
  @SuppressWarnings({"unchecked", "rawtypes"})
  @Override
  public void createControls(Composite parent, TabbedPropertySheetPage aTabbedPropertySheetPage) {
    super.createControls(parent, aTabbedPropertySheetPage);
    Composite composite = getWidgetFactory().createFlatFormComposite(parent);
    TableColumnLayout tableColumnLayout = new TableColumnLayout();
    composite.setLayout(tableColumnLayout);
    FormData data;

    table =
        getWidgetFactory().createTable(composite, SWT.H_SCROLL | SWT.V_SCROLL | SWT.FULL_SELECTION);
    table.setHeaderVisible(true);
    table.setLinesVisible(true);

    columns = new ArrayList();

    String[] titles = UserGroupPropertySource.getPropertiesDisplayValuesTable();
    int[] weights = {30, 30, 30};

    for (int i = 0; i < titles.length; i++) {
      TableColumn column = new TableColumn(table, SWT.NONE);
      column.setText(titles[i]);
      tableColumnLayout.setColumnData(column, new ColumnWeightData(weights[i]));
      columns.add(column);
    }

    data = new FormData();
    data.left = new FormAttachment(0, 0);
    data.right = new FormAttachment(100, 0);
    data.top = new FormAttachment(0, 0);
    data.bottom = new FormAttachment(100, 0);
    table.setLayoutData(data);
  }
Example #17
0
  protected void createControl(Composite parent, int treeStyle) {
    super.createControl(parent, treeStyle);

    // add 2px margin around filter text

    FormLayout layout = new FormLayout();
    layout.marginHeight = 0;
    layout.marginWidth = 0;
    setLayout(layout);

    FormData data = new FormData();
    data.left = new FormAttachment(0, 0);
    data.right = new FormAttachment(100, 0);
    data.bottom = new FormAttachment(100, 0);
    if (showFilterControls) {
      FormData filterData = new FormData();
      filterData.top = new FormAttachment(0, 2);
      filterData.left = new FormAttachment(0, 2);
      filterData.right = new FormAttachment(100, -2);
      filterComposite.setLayoutData(filterData);
      data.top = new FormAttachment(filterComposite, 2);
    } else {
      data.top = new FormAttachment(0, 0);
    }
    treeComposite.setLayoutData(data);
  }
  private void addFields() {
    int FieldsCols = 4;
    ColumnInfo[] colinf = new ColumnInfo[FieldsCols];

    // Table with fields
    wlFields = new Label(shell, SWT.NONE);
    wlFields.setText(BaseMessages.getString(PKG, "IfNullDialog.Fields.Label"));
    props.setLook(wlFields);
    fdlFields = new FormData();
    fdlFields.left = new FormAttachment(0, 0);
    fdlFields.top = new FormAttachment(wValueTypes, margin);
    wlFields.setLayoutData(fdlFields);

    colinf[0] =
        new ColumnInfo(
            BaseMessages.getString(PKG, "IfNullDialog.Fieldname.Column"),
            ColumnInfo.COLUMN_TYPE_CCOMBO,
            new String[] {},
            false);
    colinf[1] =
        new ColumnInfo(
            BaseMessages.getString(PKG, "IfNullDialog.Value.Column"),
            ColumnInfo.COLUMN_TYPE_TEXT,
            false);
    colinf[2] =
        new ColumnInfo(
            BaseMessages.getString(PKG, "IfNullDialog.Value.ConversionMask"),
            ColumnInfo.COLUMN_TYPE_CCOMBO,
            Const.getDateFormats());
    colinf[1].setUsingVariables(true);
    colinf[3] =
        new ColumnInfo(
            BaseMessages.getString(PKG, "IfNullDialog.Value.SetEmptyString"),
            ColumnInfo.COLUMN_TYPE_CCOMBO,
            new String[] {
              BaseMessages.getString(PKG, "System.Combo.Yes"),
              BaseMessages.getString(PKG, "System.Combo.No")
            });

    wFields =
        new TableView(
            transMeta,
            shell,
            SWT.BORDER | SWT.FULL_SELECTION | SWT.MULTI,
            colinf,
            fieldsRows,
            oldlsMod,
            props);

    fdFields = new FormData();
    fdFields.left = new FormAttachment(0, 0);
    fdFields.top = new FormAttachment(wlFields, margin);
    fdFields.right = new FormAttachment(100, 0);
    fdFields.bottom = new FormAttachment(wOK, -2 * margin);

    wFields.setLayoutData(fdFields);

    setComboValues();
    fieldColumns.add(colinf[0]);
  }
Example #19
0
  private Composite createFileTreeArea(Composite parent) {
    Composite top = new Composite(parent, SWT.NULL);
    top.setLayout(new FormLayout());

    fileBar = new ConfigFileBar(top, SWT.NULL);
    Composite tree = createModePropertyTree(top);

    fileBar.getNewFileButton().addSelectionListener(this);
    fileBar.getDeleteFileButton().addSelectionListener(this);

    FormData layoutData = new FormData();
    layoutData.top = new FormAttachment(0, 0);
    layoutData.left = new FormAttachment(0, 5);
    layoutData.right = new FormAttachment(100, -5);
    fileBar.setLayoutData(layoutData);

    layoutData = new FormData();
    layoutData.top = new FormAttachment(fileBar, 3);
    layoutData.left = new FormAttachment(0, 5);
    layoutData.right = new FormAttachment(100, -5);
    layoutData.bottom = new FormAttachment(100, 5);
    tree.setLayoutData(layoutData);

    return top;
  }
Example #20
0
 /**
  * Update ProgressBar widget.<br>
  * Try to reuse the old ProgressBar if possible, otherwise dispose it and create a new one.
  *
  * @param parent
  * @param indeterminate
  * @param visible
  */
 void eswtUpdateProgressbar(Composite parent, boolean indeterminate, boolean visible) {
   // Only dispose old ProgressBar if it has wrong style
   if (eswtProgressBar != null) {
     boolean isIndeterminate = (eswtProgressBar.getStyle() & SWT.INDETERMINATE) != 0;
     if (indeterminate != isIndeterminate) {
       eswtProgressBar.setLayoutData(null);
       eswtProgressBar.dispose();
       eswtProgressBar = null;
     }
   }
   // create new ProgressBar
   if (eswtProgressBar == null) {
     int newStyle = indeterminate ? SWT.INDETERMINATE : SWT.NONE;
     eswtProgressBar = new ProgressBar(parent, newStyle);
     eswtProgressBar.setLayoutData(eswtProgbarLD);
     // update ScrolledText's layoutdata
     FormData imageLD = (FormData) eswtImgLabel.getLayoutData();
     imageLD.bottom = new FormAttachment(eswtProgressBar);
   }
   // set Progressbar visibility
   if (eswtProgressBar != null) {
     eswtProgbarLD.top = (visible ? null : new FormAttachment(100));
     eswtProgressBar.setVisible(visible);
   }
 }
Example #21
0
 private FormData createLayoutDataForTree() {
   FormData layoutData = new FormData();
   layoutData.top = new FormAttachment(header, 0);
   layoutData.left = new FormAttachment(0, 0);
   layoutData.bottom = new FormAttachment(100, 0);
   layoutData.width = 190;
   return layoutData;
 }
Example #22
0
 private FormData createLayoutDataForExampleParent() {
   FormData layoutData = new FormData();
   layoutData.top = new FormAttachment(header, 0);
   layoutData.left = new FormAttachment(tree, 10);
   layoutData.right = new FormAttachment(100, 0);
   layoutData.bottom = new FormAttachment(100, 0);
   return layoutData;
 }
 /**
  * Create the layout data for the message area.
  *
  * @return FormData for the message area.
  */
 private FormData createMessageAreaData() {
   FormData messageData = new FormData();
   messageData.top = new FormAttachment(0);
   messageData.bottom = new FormAttachment(100);
   messageData.right = new FormAttachment(100);
   messageData.left = new FormAttachment(0);
   return messageData;
 }
  @Override
  public void createControl(Composite parent) {
    Composite controls = new Composite(parent, SWT.FILL);
    controls.setLayout(new FormLayout());

    Label label = new Label(controls, SWT.LEFT);
    label.setText("Available launch configurations: ");
    FormData f = new FormData();
    f.left = new FormAttachment(0, 5);
    f.top = new FormAttachment(0, 5);
    label.setLayoutData(f);

    availableConfigsCombo = new Combo(controls, SWT.LEFT | SWT.READ_ONLY);
    f = new FormData();
    f.left = new FormAttachment(label, 5);
    f.right = new FormAttachment(100, -100);
    f.top = new FormAttachment(0, 5);
    availableConfigsCombo.setLayoutData(f);

    add = new Button(controls, SWT.PUSH);
    add.setText("Add");
    add.setEnabled(false);
    f = new FormData();
    f.left = new FormAttachment(availableConfigsCombo, 5);
    f.right = new FormAttachment(100, -5);
    f.top = new FormAttachment(0, 4);
    add.setLayoutData(f);

    Label selectiosLabel = new Label(controls, SWT.LEFT);
    f = new FormData();
    f.left = new FormAttachment(0, 5);
    f.top = new FormAttachment(availableConfigsCombo, 5);
    selectiosLabel.setLayoutData(f);

    selectiosLabel.setText("Selected launch configurations:");
    selectedConfigsList =
        new org.eclipse.swt.widgets.List(
            controls, SWT.SINGLE | SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL | SWT.MULTI);
    f = new FormData();
    f.left = new FormAttachment(label, 5);
    f.right = new FormAttachment(100, -5);
    f.top = new FormAttachment(availableConfigsCombo, 5);
    f.bottom = new FormAttachment(100, -35);
    selectedConfigsList.setLayoutData(f);

    delete = new Button(controls, SWT.PUSH);
    delete.setText("Remove");
    f = new FormData();
    f.left = new FormAttachment(100, -100);
    f.right = new FormAttachment(100, -5);
    f.top = new FormAttachment(selectedConfigsList, 5);
    delete.setLayoutData(f);
    delete.setEnabled(false);

    addListenerrs();
    setControl(controls);
  }
  /**
   * Set the major UI features of this basic view composite
   *
   * @param textEditor
   * @param parentComposite
   * @param styleBit
   */
  public Transition(final XMLEditor textEditor, final Composite parentComposite, int styleBit) {
    super(parentComposite, SWT.BORDER);
    setBackground(SWTResourceManager.getColor(SWT.COLOR_DARK_MAGENTA));
    this.textEditor = textEditor;
    addDisposeListener(
        new DisposeListener() {
          @Override
          public void widgetDisposed(DisposeEvent e) {
            toolkit.dispose();
          }
        });
    toolkit.adapt(this);
    toolkit.paintBordersFor(this);
    setLayout(new FormLayout());
    setLayoutData(new GridData(GridData.FILL_BOTH));

    final ScrolledComposite parentScrolledComposite =
        new ScrolledComposite(this, SWT.BORDER | SWT.V_SCROLL);
    parentScrolledComposite.setAlwaysShowScrollBars(true);
    parentScrolledComposite.setExpandHorizontal(true);
    parentScrolledComposite.setExpandVertical(true);
    FormData parentScrolledCompositeFormLayoutData = new FormData();
    parentScrolledCompositeFormLayoutData.right = new FormAttachment(100);
    parentScrolledCompositeFormLayoutData.bottom = new FormAttachment(100);
    parentScrolledCompositeFormLayoutData.top = new FormAttachment(0, 5);
    parentScrolledCompositeFormLayoutData.left = new FormAttachment(0, 5);
    parentScrolledComposite.setLayoutData(parentScrolledCompositeFormLayoutData);
    this.setData(parentScrolledComposite);

    baseContainer = new Composite(parentScrolledComposite, SWT.NONE);
    baseContainer.setBackground(SWTResourceManager.getColor(204, 153, 255));
    parentScrolledComposite.setContent(baseContainer);

    baseContainer.setLayout(new GridLayout(1, true));
    try {
      CentralUtils centralUtils = CentralUtils.getCentralUtils(textEditor);
      centralUtils.setBasicUI(parentScrolledComposite, baseContainer);
      centralUtils.unmarshal(textEditor);
    } catch (JAXBException e) {
      LOG.info(e.getMessage());
    }

    // create a THumanInteractions object if humanInteractions variable is
    // null
    if (textEditor.getRootElement() == null) {
      humanInteractions = new THumanInteractions();
      textEditor.setRootElement(humanInteractions);
    }
    try {
      // create the biggest xml element- UI section
      humanInteractionsUI =
          new THumanInteractionsUI(
              textEditor, baseContainer, this, SWT.NONE, textEditor.getRootElement(), 0, 0);
    } catch (JAXBException e1) {
      LOG.info(e1.getMessage());
    }
  }
Example #26
0
  @Override
  public void createPartControl(Composite parent) {
    Composite container = new Composite(parent, SWT.NONE);
    container.setBackground(parent.getDisplay().getSystemColor(SWT.COLOR_WHITE));

    container.setLayout(new FormLayout());

    FormToolkit toolkit = new FormToolkit(container.getDisplay());
    Form form = toolkit.createForm(container);

    FormData data = new FormData();
    data.top = new FormAttachment(0, 20);
    data.left = new FormAttachment(50, -100);
    data.right = new FormAttachment(50, 100);
    data.bottom = new FormAttachment(100, -20);

    form.setLayoutData(data);

    // form.setText(Messages.IntroTitle);

    FillLayout layout = new FillLayout();
    layout.marginHeight = layout.marginWidth = 5;
    form.getBody().setLayout(layout);

    FormText text = toolkit.createFormText(form.getBody(), true);

    StringBuilder buf = new StringBuilder();
    buf.append("<form>"); // $NON-NLS-1$
    buf.append("<p><img href=\"logo\"/></p>"); // $NON-NLS-1$
    buf.append("<p><span color=\"header\" font=\"header\">") // $NON-NLS-1$
        .append(Messages.IntroTitle) //
        .append("</span></p>"); // $NON-NLS-1$
    addLink(buf, "action:open", Messages.IntroOpenFile, Messages.IntroOpenFileText); // $NON-NLS-1$
    addLink(buf, "action:new", Messages.IntroNewFile, Messages.IntroNewFileText); // $NON-NLS-1$
    addLink(
        buf,
        "action:sample",
        Messages.IntroOpenSample,
        Messages.IntroOpenSampleText); // $NON-NLS-1$
    addLink(
        buf,
        "action:daxsample",
        Messages.IntroOpenDaxSample,
        Messages.IntroOpenDaxSampleText); // $NON-NLS-1$
    addLink(
        buf,
        "http://buchen.github.com/portfolio/new_and_noteworthy.html", //$NON-NLS-1$
        Messages.IntroReadNews,
        Messages.IntroReadNewsText);
    buf.append("</form>"); // $NON-NLS-1$
    text.setText(buf.toString(), true, false);
    text.setImage("logo", PortfolioPlugin.image(PortfolioPlugin.IMG_LOGO)); // $NON-NLS-1$
    text.setColor("header", toolkit.getColors().getColor(IFormColors.TITLE)); // $NON-NLS-1$
    text.setFont("header", JFaceResources.getHeaderFont()); // $NON-NLS-1$
    text.addHyperlinkListener(this);
  }
  /**
   * Constructor for TabbedPropertyTitle.
   *
   * @param parent the parent composite.
   * @param factory the widget factory for the tabbed property sheet
   */
  public TabbedPropertyTitle(Composite parent, TabbedPropertySheetWidgetFactory factory) {
    super(parent, SWT.NO_FOCUS);
    this.factory = factory;

    // RAP not suppported
    //		this.addPaintListener(new PaintListener() {
    //
    //			public void paintControl(PaintEvent e) {
    //				if (image == null && (text == null || text.equals(BLANK))) {
    //					label.setVisible(false);
    //				} else {
    //					label.setVisible(true);
    //					drawTitleBackground(e);
    //				}
    //			}
    //		});
    // /RAP

    factory.getColors().initializeSectionToolBarColors();
    setBackground(factory.getColors().getBackground());
    setForeground(factory.getColors().getForeground());

    FormLayout layout = new FormLayout();
    layout.marginWidth = 1;
    layout.marginHeight = 2;
    setLayout(layout);

    Font font;
    if (!JFaceResources.getFontRegistry().hasValueFor(TITLE_FONT)) {
      FontData[] fontData =
          JFaceResources.getFontRegistry().getBold(JFaceResources.DEFAULT_FONT).getFontData();
      /* title font is 2pt larger than that used in the tabs. */
      fontData[0].setHeight(fontData[0].getHeight() + 2);
      JFaceResources.getFontRegistry().put(TITLE_FONT, fontData);
    }
    font = JFaceResources.getFont(TITLE_FONT);

    label = factory.createCLabel(this, BLANK);
    //		label.setBackground(new Color[] {
    //				factory.getColors().getColor(IFormColors.H_GRADIENT_END),
    //				factory.getColors().getColor(IFormColors.H_GRADIENT_START) },
    //				new int[] { 100 }, true);
    label.setFont(font);
    label.setForeground(factory.getColors().getColor(IFormColors.TITLE));
    FormData data = new FormData();
    data.left = new FormAttachment(0, 0);
    data.top = new FormAttachment(0, 0);
    data.right = new FormAttachment(100, 0);
    data.bottom = new FormAttachment(100, 0);
    label.setLayoutData(data);

    /*
     * setImage(PlatformUI.getWorkbench().getSharedImages().getImage(
     * ISharedImages.IMG_OBJ_ELEMENT));
     */
  }
Example #28
0
  private void setLayoutData(Control c, int left, int right, int top, int bottom) {
    FormData location = new FormData();

    location.left = new FormAttachment(left);
    location.right = new FormAttachment(right);
    location.top = new FormAttachment(top);
    location.bottom = new FormAttachment(bottom);

    c.setLayoutData(location);
  }
  /** This method initializes mainWindow */
  public void createMainWindow() {
    resultWindow = new Shell();
    resultWindow.setImage(new Image(Display.getCurrent(), "resources/MathWorldIcon.gif"));
    resultWindow.setText(title);
    resultWindow.setMaximized(false);
    resultWindow.setSize(new Point(394, 671));
    resultWindow.setLayout(new FillLayout());

    FormData formData2 = new FormData();
    formData2.bottom = new FormAttachment(100, -5);
    formData2.left = new FormAttachment(30, 50);
    formData2.right = new FormAttachment(70, -50);
    FormData formData1 = new FormData();
    formData1.bottom = new FormAttachment(100, -5);
    formData1.right = new FormAttachment(30, -50);
    formData1.left = new FormAttachment(0, 50);
    Text clusteringResultTextArea = new Text(resultWindow, SWT.MULTI | SWT.WRAP | SWT.V_SCROLL);
    clusteringResultTextArea.setText(printedClusteringResult);
  }
  private void recreateRootComposite() {
    if (rootComposite != null) rootComposite.dispose();
    rootComposite = new Composite(parentComposite, SWT.NONE);
    rootComposite.setLayout(new FillLayout());

    final FormData fd = new FormData();
    fd.left = new FormAttachment(0);
    fd.right = new FormAttachment(100);
    fd.top = new FormAttachment(toolbarComposite);
    fd.bottom = new FormAttachment(100);
    rootComposite.setLayoutData(fd);
  }