コード例 #1
0
  private void createStatusWindow(Composite parent) {
    statusWindow = new StatusWindowWidget(parent);

    statusWindow.setLabelAndValue(
        UpdateableLabel.HOSTLABEL.name(),
        "Selected Host",
        NOT_CONNECTED,
        SWT.BOLD,
        SWT.COLOR_DARK_RED);

    String selectedFile = testManagerEditor.loadValue(testManagerEditor.configFileName);
    if (!Strings.isValid(selectedFile)) {
      selectedFile = testManagerEditor.getDefaultConfigPath();
      testManagerEditor.storeValue(testManagerEditor.configFileName, selectedFile);
    }
    OseeLog.log(TestManagerPlugin.class, Level.INFO, "The default config is: " + selectedFile);

    statusWindow.setLabelAndValue(
        UpdateableLabel.CONFIGPATHLABEL.name(), "Config File Path", selectedFile);

    saveWidget.setStatusLabel(statusWindow);
    loadWidget.setStatusLabel(statusWindow);

    // // Status ICON Labels
    // connectStatusIconLabel = new
    // Label(statusWindow.getStatusIconComposite(), SWT.NONE);
    // hostWidget.setConnectStatusLabel(connectStatusIconLabel);
    // connectStatusIconLabel.setVisible(false);

    statusWindow.refresh();
  }
コード例 #2
0
  private void createConfigurationToolBar(CoolBar coolBar) {
    CoolItem configCoolItem = new CoolItem(coolBar, SWT.NONE);
    ToolBar configToolBar = new ToolBar(coolBar, SWT.FLAT | SWT.HORIZONTAL);

    saveWidget = new SaveWidget(this);
    saveWidget.createToolItem(configToolBar);

    loadWidget = new LoadWidget(this);
    loadWidget.createToolItem(configToolBar);

    deleteButton = new ToolItem(configToolBar, SWT.PUSH | SWT.CENTER);
    deleteButton.setImage(ImageManager.getImage(OteTestManagerImage.FILE_DELETE));
    deleteButton.setToolTipText("Deletes Selected (highlighted) Scripts");
    deleteButton.addSelectionListener(
        new SelectionAdapter() {
          @Override
          public void widgetSelected(SelectionEvent e) {
            handleDeleteButton();
          }
        });
    deleteButton.addListener(
        SWT.MouseUp,
        new Listener() {
          @Override
          public void handleEvent(Event e) {
            if (e.button == 3) {
              handleDeleteButton();
            }
          }
        });

    configToolBar.pack();

    Point size = configToolBar.getSize();
    configCoolItem.setControl(configToolBar);
    configCoolItem.setSize(configCoolItem.computeSize(size.x, size.y));
    configCoolItem.setMinimumSize(size);
  }