Exemplo n.º 1
0
  protected Control createDialogArea(Composite parent) {
    Composite comp;
    Composite subComp;
    ValidationHandler validationHandler;
    Label label;

    comp = (Composite) super.createDialogArea(parent);
    subComp = new Composite(comp, SWT.NONE);
    subComp.setLayout(new GridLayout(1, false));
    validationHandler = new ValidationHandler();

    // Create pool group.
    createPoolGroup(subComp, validationHandler);

    // Create vertical spacer.
    label = new Label(subComp, SWT.NONE);
    label.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

    // Create tab folder.
    tabFolder = new TabFolder(subComp, SWT.NONE);
    tabFolder.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    createSignalTab(tabFolder, validationHandler);
    createStackTab(tabFolder, validationHandler);

    // Create error message label.
    errorMessageLabel = new CLabel(subComp, SWT.NONE);
    errorMessageLabel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

    // Create separator line.
    label = new Label(parent, SWT.HORIZONTAL | SWT.SEPARATOR);
    label.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

    applyDialogFont(comp);
    return comp;
  }
Exemplo n.º 2
0
  private void createContents() {
    TabFolder tabFolder = new TabFolder(this, SWT.NONE);
    tabFolder.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));

    CommonSelectorComposite commonCompositeRef =
        new CommonSelectorComposite(tabFolder, SWT.NONE, false, true);
    commonCompositeRef.getTreeViewer().getTree().setLinesVisible(false);
    commonCompositeRef.getTreeViewer().getTree().setHeaderVisible(false);
    commonCompositeRef.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
    commonCompositeRef.setDataSet(this.dataset);
    commonCompositeRef.getTreeViewer().expandAll();
    TabItem tabItem1 = new TabItem(tabFolder, SWT.NONE);
    tabItem1.setText("Ref");
    tabItem1.setControl(commonCompositeRef);

    if (hasLabel) {
      CommonSelectorComposite commonCompositeLabel =
          new CommonSelectorComposite(tabFolder, SWT.NONE, false, true);
      commonCompositeLabel.getTreeViewer().getTree().setLinesVisible(false);
      commonCompositeLabel.getTreeViewer().getTree().setHeaderVisible(false);
      commonCompositeLabel.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
      commonCompositeLabel.setDataSet(this.dataset);
      commonCompositeLabel.getTreeViewer().expandAll();
      TabItem tabItem2 = new TabItem(tabFolder, SWT.NONE);
      tabItem2.setText("Label");
      tabItem2.setControl(commonCompositeLabel);
    }

    tabFolder.addSelectionListener(
        new SelectionListener() {
          public void widgetDefaultSelected(SelectionEvent event) {
            selectedRef = "Ref".equals(((TabItem) event.item).getText());
          }

          public void widgetSelected(SelectionEvent event) {
            selectedRef = "Ref".equals(((TabItem) event.item).getText());
          }
        });

    Composite composite = new Composite(this, SWT.NONE);
    GridData gd_composite = new GridData(SWT.FILL, SWT.FILL, true, false);

    composite.setLayoutData(gd_composite);
    GridLayout gridLayout = new GridLayout();
    gridLayout.numColumns = 2;
    gridLayout.marginWidth = 0;
    gridLayout.marginHeight = 0;
    composite.setLayout(gridLayout);

    Label label = new Label(composite, SWT.NONE);
    label.setText("属性值");
    displayText = new Text(composite, SWT.BORDER);
    displayText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));

    displayText.setEditable(false);
    displayText.setBackground(displayText.getParent().getBackground());

    displayText.setText(this.propertyItem.getValue());
  }
Exemplo n.º 3
0
  /**
   * Ueberschrieben, um einen DisposeListener an das Composite zu haengen.
   *
   * @see de.willuhn.jameica.gui.parts.TablePart#paint(org.eclipse.swt.widgets.Composite)
   */
  public synchronized void paint(Composite parent) throws RemoteException {
    final TabFolder folder = new TabFolder(parent, SWT.NONE);
    folder.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    TabGroup tab = new TabGroup(folder, i18n.tr("Anzeige einschränken"));

    ColumnLayout cols = new ColumnLayout(tab.getComposite(), 2);

    {
      this.left = new SimpleContainer(cols.getComposite());

      Input t = this.getText();
      this.left.addInput(t);

      // Duerfen wir erst nach dem Zeichnen
      t.getControl().addKeyListener(new DelayedAdapter());

      this.left.addInput(this.getKonto());
    }

    {
      Container right = new SimpleContainer(cols.getComposite());

      right.addInput(this.getRange());
      MultiInput range = new MultiInput(this.getFrom(), this.getTo());
      right.addInput(range);
    }

    this.buttons.addButton(
        i18n.tr("Aktualisieren"),
        new Action() {
          public void handleAction(Object context) throws ApplicationException {
            handleReload(true);
          }
        },
        null,
        true,
        "view-refresh.png");
    this.buttons.paint(parent);

    // Erstbefuellung
    GenericIterator items =
        getList(
            getKonto().getValue(),
            (Date) getFrom().getValue(),
            (Date) getTo().getValue(),
            (String) getText().getValue());
    if (items != null) {
      items.begin();
      while (items.hasNext()) addItem(items.next());
    }

    super.paint(parent);
  }
Exemplo n.º 4
0
  /** @see de.willuhn.jameica.gui.Part#paint(org.eclipse.swt.widgets.Composite) */
  public void paint(Composite parent) throws RemoteException {
    try {
      if (this.konto == null) {
        if (tiny) {
          ColumnLayout layout = new ColumnLayout(parent, 2);
          Container left = new SimpleContainer(layout.getComposite());
          left.addInput(this.getKontoAuswahl());
          Container right = new SimpleContainer(layout.getComposite());
          right.addInput(this.getRange());
        } else {
          final TabFolder folder = new TabFolder(parent, SWT.NONE);
          folder.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
          TabGroup tab = new TabGroup(folder, i18n.tr("Anzeige einschränken"));

          tab.addInput(this.getKontoAuswahl());
          tab.addInput(this.getRange());

          ButtonArea buttons = new ButtonArea();
          buttons.addButton(
              i18n.tr("Aktualisieren"),
              new Action() {

                /** @see de.willuhn.jameica.gui.Action#handleAction(java.lang.Object) */
                public void handleAction(Object context) throws ApplicationException {
                  reloadListener.handleEvent(new Event());
                }
              },
              null,
              true,
              "view-refresh.png");

          buttons.paint(parent);
        }
      } else {
        Container container = new SimpleContainer(parent);
        container.addInput(this.getRange());
      }

      this.chart = new LineChart();
      this.reloadListener.handleEvent(null); // einmal initial ausloesen
      chart.paint(parent);
    } catch (RemoteException re) {
      throw re;
    } catch (Exception e) {
      Logger.error("unable to paint chart", e);
      Application.getMessagingFactory()
          .sendMessage(
              new StatusBarMessage(
                  i18n.tr("Fehler beim Anzeigen des Saldo-Verlaufs"), StatusBarMessage.TYPE_ERROR));
    }
  }
Exemplo n.º 5
0
  /**
   * Adds a tab to the page.
   *
   * @param text the tab label
   */
  public void addTab(String text) {
    if (folder == null) {
      // initialize tab folder
      folder = new TabFolder(super.getFieldEditorParent(), SWT.NONE);
      folder.setLayoutData(new GridData(GridData.FILL_BOTH));
    }

    TabItem item = new TabItem(folder, SWT.NONE);
    item.setText(text);

    Composite currentTab = new Composite(folder, SWT.NULL);
    GridLayout layout = new GridLayout();
    currentTab.setLayout(layout);
    currentTab.setFont(super.getFieldEditorParent().getFont());
    currentTab.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

    item.setControl(currentTab);
  }
    private void createParameterExceptionsFolder(Composite composite) {
      TabFolder folder = new TabFolder(composite, SWT.TOP);
      folder.setLayoutData(new GridData(GridData.FILL_BOTH));

      TabItem item = new TabItem(folder, SWT.NONE);
      item.setText(RefactoringMessages.ChangeSignatureInputPage_parameters);
      item.setControl(createParameterTableControl(folder));

      TabItem itemEx = new TabItem(folder, SWT.NONE);
      itemEx.setText(RefactoringMessages.ChangeSignatureInputPage_exceptions);
      itemEx.setControl(createExceptionsTableControl(folder));

      folder.addSelectionListener(
          new SelectionAdapter() {
            @Override
            public void widgetSelected(SelectionEvent e) {
              ((TabItem) e.item).getControl().setFocus();
            }
          });
    }
  @Override
  protected void initialize(Composite composite) {
    GridData gridData = new GridData();
    gridData.grabExcessHorizontalSpace = true;
    gridData.grabExcessVerticalSpace = true;
    gridData.verticalAlignment = GridData.FILL;
    gridData.horizontalAlignment = GridData.FILL;

    final TabFolder tabFolder = new TabFolder(composite, SWT.NONE);
    tabFolder.setLayoutData(gridData);

    this.tabWrapperList.add(new DBSelectTabWrapper(this, tabFolder, SWT.NONE, this.settings));
    this.tabWrapperList.add(new EnvironmentTabWrapper(this, tabFolder, SWT.NONE, this.settings));
    this.tabWrapperList.add(
        new AdvancedTabWrapper(this, tabFolder, SWT.NONE, this.settings, this.diagram));
    this.tabWrapperList.add(new OptionTabWrapper(this, tabFolder, SWT.NONE, this.settings));

    ListenerAppender.addTabListener(tabFolder, tabWrapperList);

    this.tabWrapperList.get(0).setInitFocus();
  }
Exemplo n.º 8
0
  public void createControl(Composite parent) {
    Composite container = new Composite(parent, SWT.NULL);
    GridLayout layout = new GridLayout();
    layout.verticalSpacing = 10;
    container.setLayout(layout);

    createViewer(container);

    fTabFolder = new TabFolder(container, SWT.NONE);
    fTabFolder.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    createTabs(fTabFolder, getDialogSettings());

    initializeViewer();
    if (getErrorMessage() != null) {
      setMessage(getErrorMessage());
      setErrorMessage(null);
    }
    setControl(container);
    hookHelpContext(container);
    Dialog.applyDialogFont(container);
  }
  protected void createControl(Composite parent) {

    Composite scriptContainer = new Composite(parent, SWT.NULL);
    scriptContainer.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    scriptContainer.setLayout(new GridLayout(3, false));
    expression = new Combo(scriptContainer, SWT.NULL);
    new Label(scriptContainer, SWT.NULL).setText(":");
    script = new Text(scriptContainer, SWT.BORDER);
    script.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

    TabFolder resultTab = new TabFolder(parent, SWT.BORDER);
    resultTab.setLayoutData(new GridData(GridData.FILL_BOTH));
    TabItem textResult = new TabItem(resultTab, SWT.NULL);
    textResult.setText("To String");
    result = new Text(resultTab, SWT.BORDER | SWT.MULTI);
    result.setLayoutData(new GridData(GridData.FILL_BOTH));
    textResult.setControl(result);
    setResultTree(new TreeViewer(resultTab, SWT.V_SCROLL | SWT.H_SCROLL | SWT.BORDER));
    getResultTree().getTree().setHeaderVisible(true);

    getResultTree().getTree().setHeaderVisible(true);
    TreeColumn col = new TreeColumn(getResultTree().getTree(), SWT.NONE);
    col.setText("Name");
    col.setResizable(true);
    col.setWidth(120);
    col = new TreeColumn(getResultTree().getTree(), SWT.NONE);
    col.setText("ClassName");
    col.setWidth(120);
    col.setResizable(true);
    col = new TreeColumn(getResultTree().getTree(), SWT.NONE);
    col.setWidth(120);
    col.setText("Value");
    col.setResizable(true);

    TabItem treeResult = new TabItem(resultTab, SWT.NULL);
    treeResult.setText("Tree");
    treeResult.setControl(getResultTree().getTree());
  }
Exemplo n.º 10
0
 public void createControl(Composite parent) {
   isStillControlsBeingCreated = true;
   Composite composite = new Composite(parent, SWT.NONE);
   composite.setLayout(new GridLayout(1, false));
   tabFolder = new TabFolder(composite, SWT.NONE);
   tabFolder.setSelection(0);
   GridData gd_tabFolder = new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1);
   gd_tabFolder.heightHint = 350;
   tabFolder.setLayoutData(gd_tabFolder);
   Map<String, LibraryCategory> libraryArtifactCategories =
       LibraryArtifactHandler.getLibraryArtifactCategories();
   addTabPage(libraryArtifactCategories.get(LibraryArtifactHandler.ALL_LIB_CATEGORY_ID));
   for (String key : libraryArtifactCategories.keySet()) {
     if (!key.equals(LibraryArtifactHandler.ALL_LIB_CATEGORY_ID)) {
       LibraryCategory category = libraryArtifactCategories.get(key);
       if (category.getLibraryArtifacts().size() > 0) {
         addTabPage(category);
       }
     }
   }
   isStillControlsBeingCreated = false;
   setControl(composite);
 }
  public void showAttributes(Composite parent) {
    composite = new Splitter(parent, SWT.HORIZONTAL);

    GridLayout layout = new GridLayout();
    layout.marginWidth = 0;
    layout.marginHeight = 0;
    layout.numColumns = 1;
    composite.setLayout(layout);

    GridData data = new GridData(GridData.FILL_BOTH);
    composite.setLayoutData(data);

    tabs = new TabFolder(composite, SWT.TOP);
    tabs.setLayoutData(data);
    general = new TabItem(tabs, SWT.NONE);

    general.setText(DropWizardMessages.General_Tab_Title);

    Composite generalTabContent = new Composite(tabs, SWT.NONE);

    general.setControl(fillGeneralOption(generalTabContent));

    TabItem advanced = new TabItem(tabs, SWT.NONE);
    advanced.setText(DropWizardMessages.Advanced_Tab_Title);
    TagAttributesComposite advancedTabContent =
        new TagAttributesComposite(tabs, SWT.NONE, getSpecificWizard().getWizardModel(), context);
    advanced.setControl(advancedTabContent);

    tabs.addSelectionListener(advancedTabContent);

    setControl(composite);
    getSpecificWizard()
        .getWizardModel()
        .addPropertyChangeListener(IDropWizardModel.TAG_PROPOSAL, this);
    updateTitle();
    runValidation();
  }
Exemplo n.º 12
0
  private void initGUI() {
    try {
      GridLayout thisLayout = new GridLayout();
      thisLayout.makeColumnsEqualWidth = true;
      this.setLayout(thisLayout);
      this.setSize(604, 337);
      button1 = new Button(this, SWT.PUSH | SWT.CENTER);
      GridData button1LData = new GridData();
      button1LData.horizontalAlignment = GridData.FILL;
      button1LData.grabExcessHorizontalSpace = true;
      button1.setLayoutData(button1LData);
      button1.setText(Messages.FullAnalysisUI_startanalysis);
      button1.addMouseListener(
          new MouseAdapter() {

            @Override
            public void mouseDown(final MouseEvent evt) {
              if (checkEditor()) {
                text = getEditorText();
                if (btnReferenceTools.getSelection()) {
                  selectAppropriateAlphabet();
                } else {
                  appropriateAlphabetToBeDetected = true;
                }
                recalcGraph();
              }
            }
          });
      composite1 = new Composite(this, SWT.NONE);
      GridLayout composite1Layout = new GridLayout();
      composite1Layout.numColumns = 2;
      composite1Layout.marginWidth = 0;
      composite1Layout.marginHeight = 0;
      GridData composite1LData = new GridData();
      composite1LData.grabExcessHorizontalSpace = true;
      composite1LData.horizontalAlignment = GridData.FILL;
      composite1LData.verticalAlignment = GridData.FILL;
      composite1LData.grabExcessVerticalSpace = true;
      composite1.setLayoutData(composite1LData);
      composite1.setLayout(composite1Layout);
      {
        group1 = new Group(composite1, SWT.NONE);
        GridLayout group1Layout = new GridLayout();
        group1.setLayout(group1Layout);
        GridData group1LData = new GridData();
        group1LData.horizontalAlignment = GridData.FILL;
        group1LData.grabExcessHorizontalSpace = true;
        group1LData.verticalAlignment = GridData.FILL;
        group1LData.grabExcessVerticalSpace = true;
        group1.setLayoutData(group1LData);
        group1.setText(Messages.FullAnalysisUI_graphlabel);
        {
          myGraph = new CustomFreqCanvas(group1, SWT.NONE);

          GridLayout myGraphLayout = new GridLayout();
          myGraph.setLayout(myGraphLayout);
          GridData myGraphLData = new GridData();
          myGraphLData.verticalAlignment = GridData.FILL;
          myGraphLData.grabExcessVerticalSpace = true;
          myGraphLData.grabExcessHorizontalSpace = true;
          myGraphLData.horizontalAlignment = GridData.FILL;
          myGraph.setLayoutData(myGraphLData);
        }
      }
      {
        group4 = new Group(composite1, SWT.NONE);
        GridLayout group4Layout = new GridLayout();
        group4.setLayout(group4Layout);
        GridData group4LData = new GridData();
        group4LData.horizontalAlignment = GridData.FILL;
        group4LData.grabExcessVerticalSpace = true;
        group4LData.verticalAlignment = GridData.FILL;
        group4.setLayoutData(group4LData);
        group4.setText(Messages.FullAnalysisUI_propertieslabel);
        {
          tabFolder1 = new TabFolder(group4, SWT.NONE);
          {
            tabItem1 = new TabItem(tabFolder1, SWT.NONE);
            tabItem1.setText(Messages.FullAnalysisUI_firsttablabel);
            {
              composite3 = new Composite(tabFolder1, SWT.NONE);
              GridLayout composite3Layout = new GridLayout();
              composite3Layout.makeColumnsEqualWidth = true;
              composite3.setLayout(composite3Layout);
              GridData composite3LData = new GridData();
              composite3LData.grabExcessHorizontalSpace = true;
              composite3LData.horizontalAlignment = GridData.FILL;
              composite3LData.verticalAlignment = GridData.FILL;
              composite3LData.grabExcessVerticalSpace = true;
              tabItem1.setControl(composite3);
              {
                composite2 = new Composite(composite3, SWT.NONE);
                GridLayout composite2Layout = new GridLayout();
                composite2Layout.makeColumnsEqualWidth = true;
                composite2Layout.marginHeight = 0;
                GridData composite2LData = new GridData();
                composite2LData.grabExcessHorizontalSpace = true;
                composite2LData.horizontalAlignment = GridData.FILL;
                composite2.setLayoutData(composite2LData);
                composite2.setLayout(composite2Layout);
                {
                  button3 = new Button(composite2, SWT.RADIO | SWT.LEFT);
                  button3.setText(Messages.FullAnalysisUI_monoalphabetic);
                  button3.setSelection(true);
                  button3.addSelectionListener(
                      new SelectionAdapter() {
                        @Override
                        public void widgetSelected(SelectionEvent evt) {
                          polyOnOffSelected(evt);
                        }
                      });
                }
                {
                  button4 = new Button(composite2, SWT.RADIO | SWT.LEFT);
                  button4.setText(Messages.FullAnalysisUI_polyalphabetic);
                  button4.addSelectionListener(
                      new SelectionAdapter() {
                        @Override
                        public void widgetSelected(SelectionEvent evt) {
                          polyOnOffSelected(evt);
                        }
                      });
                }
              }
              {
                group2 = new Group(composite3, SWT.NONE);
                GridLayout group2Layout = new GridLayout();
                group2Layout.numColumns = 2;
                group2.setLayout(group2Layout);
                GridData group2LData = new GridData();
                group2LData.horizontalAlignment = GridData.FILL;
                group2LData.verticalAlignment = GridData.BEGINNING;
                group2LData.grabExcessHorizontalSpace = true;
                group2.setLayoutData(group2LData);
                group2.setText(Messages.FullAnalysisUI_vigeneresettings);
                {
                  GridData spinner1LData = new GridData();
                  spinner1 = new Spinner(group2, SWT.NONE);
                  spinner1.setLayoutData(spinner1LData);
                  spinner1.addMouseListener(
                      new MouseAdapter() {
                        @Override
                        public void mouseDown(MouseEvent evt) {
                          recalcGraph();
                        }
                      });
                  spinner1.addSelectionListener(
                      new SelectionAdapter() {
                        @Override
                        public void widgetSelected(SelectionEvent evt) {
                          changedVigOptions();
                          recalcGraph();
                        }
                      });
                  spinner1.setSelection(1);
                }
                {
                  label1 = new Label(group2, SWT.NONE);
                  label1.setLayoutData(new GridData());
                  label1.setText(Messages.FullAnalysisUI_keylength);
                }
                {
                  GridData spinner2LData = new GridData();
                  spinner2 = new Spinner(group2, SWT.NONE);
                  spinner2.setLayoutData(spinner2LData);
                  spinner2.addMouseListener(
                      new MouseAdapter() {
                        @Override
                        public void mouseDown(MouseEvent evt) {
                          recalcGraph();
                        }
                      });
                  spinner2.addSelectionListener(
                      new SelectionAdapter() {
                        @Override
                        public void widgetSelected(SelectionEvent evt) {
                          changedVigOptions();
                        }
                      });
                }
                {
                  label2 = new Label(group2, SWT.NONE);
                  label2.setLayoutData(new GridData());
                  label2.setText(Messages.FullAnalysisUI_keyoffset);
                }
              }
            }
          }
          {
            tabItem2 = new TabItem(tabFolder1, SWT.NONE);
            tabItem2.setText(Messages.FullAnalysisUI_secondtablabel);
            {
              composite4 = new Composite(tabFolder1, SWT.NONE);
              GridLayout composite4Layout = new GridLayout();
              composite4Layout.makeColumnsEqualWidth = true;
              composite4.setLayout(composite4Layout);
              GridData composite4LData = new GridData();
              composite4LData.grabExcessHorizontalSpace = true;
              composite4LData.horizontalAlignment = GridData.FILL;
              composite4LData.verticalAlignment = GridData.FILL;
              composite4LData.grabExcessVerticalSpace = true;
              tabItem2.setControl(composite4);
              {
                btnReferenceTools = new Button(composite4, SWT.CHECK | SWT.LEFT);
                GridData button2LData = new GridData();
                button2LData.grabExcessHorizontalSpace = true;
                button2LData.horizontalAlignment = GridData.FILL;
                btnReferenceTools.setLayoutData(button2LData);
                btnReferenceTools.setText(Messages.FullAnalysisUI_enabledecrOverlay);
                btnReferenceTools.addMouseListener(
                    new MouseAdapter() {
                      @Override
                      public void mouseDown(MouseEvent evt) {

                        if (!btnReferenceTools.getSelection()) {
                          enableReferenceTools(true);
                          if (myLimitedAnalysis == null) recalcGraph();
                          if (myLimitedAnalysis != null) myGraph.setAnalysis(myLimitedAnalysis);
                        } else {
                          enableReferenceTools(false);
                          if (myAnalysis == null) recalcGraph();
                          if (myAnalysis != null) myGraph.setAnalysis(myAnalysis);
                        }
                        if (myAnalysis != null || myLimitedAnalysis != null) {
                          myGraph.setOverlayActivated(!btnReferenceTools.getSelection());
                          myGraph.redraw();
                        }
                      }
                    });
              }
              {
                combo1 = new Combo(composite4, SWT.READ_ONLY);
                GridData combo1LData = new GridData();
                combo1LData.grabExcessHorizontalSpace = true;
                GridData combo1LData1 = new GridData();
                combo1LData1.horizontalAlignment = GridData.FILL;
                combo1LData1.heightHint = 21;
                combo1.setLayoutData(combo1LData1);

                // add reftexts
                reftexts.add(
                    new Reftext(
                        Messages.FullAnalysisUI_germanreftextname1, Messages.FullAnalysisUI_0));
                reftexts.add(
                    new Reftext(
                        Messages.FullAnalysisUI_germanreftextname2, Messages.FullAnalysisUI_1));
                reftexts.add(
                    new Reftext(
                        Messages.FullAnalysisUI_englishreftextname1, Messages.FullAnalysisUI_2));

                for (int i = 0; i < reftexts.size(); i++) combo1.add(reftexts.get(i).name);
                combo1.addSelectionListener(
                    new SelectionAdapter() {
                      @Override
                      public void widgetSelected(SelectionEvent evt) {
                        combo1WidgetSelected(evt);
                      }
                    });
                combo1.setText(combo1.getItem(0));
              }
              {
                label3 = new Label(composite4, SWT.NONE);
                GridData label3LData = new GridData();
                label3LData.horizontalAlignment = GridData.FILL;
                label3LData.grabExcessHorizontalSpace = true;
                label3.setLayoutData(label3LData);
                label3.setText(Messages.FullAnalysisUI_alphabetused);
              }
              {
                combo2 = new Combo(composite4, SWT.READ_ONLY);
                GridData combo2LData = new GridData();
                combo2LData.heightHint = 21;
                combo2LData.horizontalAlignment = GridData.FILL;
                combo2.setLayoutData(combo2LData);
                combo2.addSelectionListener(
                    new SelectionAdapter() {
                      @Override
                      public void widgetSelected(SelectionEvent evt) {
                        combo2WidgetSelected(evt);
                      }
                    });

                AbstractAlphabet[] alphas = AlphabetsManager.getInstance().getAlphabets();
                for (int i = 0; i < alphas.length; i++) {
                  combo2.add(alphas[i].getName());
                  if (alphas[i].isDefaultAlphabet()) {
                    // combo2.setText(alphas[i].getName());
                    combo2.select(i);
                    myOverlayAlphabet = String.valueOf(alphas[i].getCharacterSet());
                  }
                }
              }
            }
          }
          GridData tabFolder1LData = new GridData();
          tabFolder1LData.horizontalAlignment = GridData.FILL;
          tabFolder1LData.verticalAlignment = GridData.FILL;
          tabFolder1LData.grabExcessVerticalSpace = true;
          tabFolder1LData.grabExcessHorizontalSpace = true;
          tabFolder1.setLayoutData(tabFolder1LData);
          tabFolder1.setSelection(0);
        }
      }
      this.layout();
    } catch (Exception e) {
      LogUtil.logError(FreqAnalysisPlugin.PLUGIN_ID, e);
    }

    tipLauncher = new SingleVanishTooltipLauncher(this.getShell());
    enableReferenceTools(false);
  }
Exemplo n.º 13
0
  @Override
  protected void createCustomContents(Composite parent) {
    GridData gd;

    Group group =
        WidgetFactory.createSimpleGroup(
            parent, UTIL.getString("Common.Properties.Label")); // $NON-NLS-1$;

    scrolled = new Composite(group, SWT.NONE);
    GridLayout gridLayout = new GridLayout();
    gridLayout.numColumns = 2;
    scrolled.setLayout(gridLayout);

    urlLabel = new Label(scrolled, SWT.NONE);
    urlLabel.setText(UTIL.getString("Common.URL.Label")); // $NON-NLS-1$
    urlLabel.setToolTipText(UTIL.getString("Common.URL.ToolTip")); // $NON-NLS-1$
    gd = new GridData();
    gd.verticalAlignment = GridData.CENTER;
    urlLabel.setLayoutData(gd);

    urlText = new Text(scrolled, SWT.SINGLE | SWT.BORDER);
    urlText.setToolTipText(UTIL.getString("Common.URL.ToolTip")); // $NON-NLS-1$
    gd = new GridData();
    gd.horizontalAlignment = GridData.FILL;
    gd.verticalAlignment = GridData.BEGINNING;
    gd.grabExcessHorizontalSpace = true;
    gd.horizontalSpan = 1;
    urlText.setLayoutData(gd);

    securityLabel = new Label(scrolled, SWT.NONE);
    securityLabel.setText(UTIL.getString("Common.Security.Type.Label")); // $NON-NLS-1$
    securityLabel.setToolTipText(UTIL.getString("Common.Security.Type.ToolTip")); // $NON-NLS-1$
    gd = new GridData();
    gd.verticalAlignment = GridData.CENTER;
    securityLabel.setLayoutData(gd);

    securityText = new Text(scrolled, SWT.SINGLE | SWT.BORDER);
    securityText.setToolTipText(UTIL.getString("Common.Security.Type.ToolTip")); // $NON-NLS-1$
    gd = new GridData();
    gd.horizontalAlignment = GridData.FILL;
    gd.verticalAlignment = GridData.BEGINNING;
    gd.grabExcessHorizontalSpace = true;
    gd.horizontalSpan = 1;
    securityText.setLayoutData(gd);

    usernameLabel = new Label(scrolled, SWT.NONE);
    usernameLabel.setText(UTIL.getString("Common.Username.Label")); // $NON-NLS-1$
    usernameLabel.setToolTipText(UTIL.getString("Common.Username.ToolTip")); // $NON-NLS-1$
    gd = new GridData();
    gd.verticalAlignment = GridData.CENTER;
    usernameLabel.setLayoutData(gd);

    usernameText = new Text(scrolled, SWT.SINGLE | SWT.BORDER);
    usernameText.setToolTipText(UTIL.getString("Common.Username.ToolTip")); // $NON-NLS-1$
    gd = new GridData();
    gd.horizontalAlignment = GridData.FILL;
    gd.verticalAlignment = GridData.BEGINNING;
    gd.grabExcessHorizontalSpace = true;
    gd.horizontalSpan = 1;
    usernameText.setLayoutData(gd);

    passwordLabel = new Label(scrolled, SWT.NONE);
    passwordLabel.setText(UTIL.getString("Common.Password.Label")); // $NON-NLS-1$
    passwordLabel.setToolTipText(UTIL.getString("Common.Password.ToolTip")); // $NON-NLS-1$
    gd = new GridData();
    gd.verticalAlignment = GridData.CENTER;
    passwordLabel.setLayoutData(gd);

    passwordText = new Text(scrolled, SWT.SINGLE | SWT.BORDER | SWT.PASSWORD);
    passwordText.setToolTipText(UTIL.getString("Common.Password.ToolTip")); // $NON-NLS-1$
    gd = new GridData();
    gd.horizontalAlignment = GridData.FILL;
    gd.verticalAlignment = GridData.BEGINNING;
    gd.grabExcessHorizontalSpace = true;
    gd.horizontalSpan = 1;
    passwordText.setLayoutData(gd);
    urlPreviewLabel = new Label(scrolled, SWT.NONE);
    urlPreviewLabel.setText(
        UTIL.getString("WSProfileDetailsWizardPage.urlPreviewLabel")); // $NON-NLS-1$
    gd = new GridData();
    urlPreviewLabel.setLayoutData(gd);

    urlPreviewText =
        new Text(scrolled, SWT.MULTI | SWT.BORDER | SWT.WRAP | SWT.READ_ONLY | SWT.V_SCROLL);
    gd = new GridData(GridData.FILL_HORIZONTAL);
    gd.grabExcessHorizontalSpace = true;
    gd.heightHint = 40;
    gd.horizontalSpan = 3;
    urlPreviewText.setLayoutData(gd);
    urlPreviewText.setBackground(
        Display.getCurrent().getSystemColor(SWT.COLOR_WIDGET_LIGHT_SHADOW));

    initControls();

    TabFolder tabFolder = new TabFolder(scrolled, SWT.TOP | SWT.BORDER);
    tabFolder.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 2, 1));

    Composite parameterPanel = WidgetFactory.createPanel(tabFolder);
    this.parametersTab = new TabItem(tabFolder, SWT.FILL);
    this.parametersTab.setControl(parameterPanel);
    this.parametersTab.setText(UTIL.getString("ParametersPanel_groupTitle")); // $NON-NLS-1$
    this.parameterPanel = new ParameterPanel(this, parameterPanel, parameterMap, 6);
    this.urlPreviewText.setText(updateUrlPreview().toString());

    Composite headerPropertiesPanel = WidgetFactory.createPanel(tabFolder);
    this.headerPropertiesTab = new TabItem(tabFolder, SWT.FILL);
    this.headerPropertiesTab.setControl(headerPropertiesPanel);
    this.headerPropertiesTab.setText(
        UTIL.getString("HeaderPropertiesPanel_groupTitle")); // $NON-NLS-1$
    new HeaderPropertiesPanel(headerPropertiesPanel, this.extraProperties, 6);

    addlisteners();
  }
Exemplo n.º 14
0
  private void ViewDataTab() {

    composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
    GridLayout gl_composite = new GridLayout(1, false);
    gl_composite.verticalSpacing = 0;
    gl_composite.marginWidth = 0;
    gl_composite.horizontalSpacing = 0;
    composite.setLayout(gl_composite);

    Group grpFilters = new Group(composite, SWT.NONE);
    grpFilters.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
    grpFilters.setText("Filtri");
    grpFilters.setLayout(new GridLayout(4, false));

    Label lblComp = new Label(grpFilters, SWT.NONE);
    lblComp.setText("Compartimento");

    Label lblEdificio = new Label(grpFilters, SWT.NONE);
    lblEdificio.setText("Edificio");

    Label lblDa = new Label(grpFilters, SWT.NONE);
    lblDa.setText("Data:");
    new Label(grpFilters, SWT.NONE);

    comboComp = new Combo(grpFilters, SWT.READ_ONLY);
    comboComp.addSelectionListener(
        new SelectionAdapter() {
          @Override
          public void widgetSelected(SelectionEvent e) {
            if (comboComp.getText().equals("*")) {
              comboEdif.setItems(DataView.EdifItems());
            } else {
              comboEdif.setItems(DataView.EdifItems(comboComp.getText()));
            }
          }
        });
    GridData gd_comboComp = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
    gd_comboComp.widthHint = 150;
    comboComp.setLayoutData(gd_comboComp);
    comboComp.setItems(compItems);
    comboComp.add("*");

    comboEdif = new Combo(grpFilters, SWT.READ_ONLY);
    GridData gd_comboEdif = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
    gd_comboEdif.widthHint = 150;
    comboEdif.setLayoutData(gd_comboEdif);

    dateTime = new DateTime(grpFilters, SWT.BORDER);
    dateTime.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, true, false, 1, 1));
    dateTime.setDate(2014, 0, 1);

    Button btnGo = new Button(grpFilters, SWT.NONE);
    btnGo.addSelectionListener(
        new SelectionAdapter() {
          @Override
          public void widgetSelected(SelectionEvent e) {
            year = dateTime.getYear();
            month = dateTime.getMonth();
            date = dateTime.getDay();
            edificio = new Edificio();
            edificio.setIdEdificio(
                Integer.parseInt(
                    comboEdif.getText().substring(0, comboEdif.getText().indexOf(":"))));

            buttonGoActions();
          }
        });

    GridData gd_btnGo = new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1);
    gd_btnGo.widthHint = 70;
    btnGo.setLayoutData(gd_btnGo);
    btnGo.setText("GO");

    tabResults = new TabFolder(composite, SWT.NONE);
    tabResults.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));

    tabMeterAcqua();

    tabMeterRipartitoreCalore();

    tabMeterSonde();

    TabItem tbtmMeterTermie = new TabItem(tabResults, SWT.NONE);
    tbtmMeterTermie.setText("Meter Termie");

    TabItem tbtmMeterElettrico = new TabItem(tabResults, SWT.NONE);
    tbtmMeterElettrico.setText("Meter Elettrico");

    TabItem tbtmMeterGas = new TabItem(tabResults, SWT.NONE);
    tbtmMeterGas.setText("Meter Gas");
  }
Exemplo n.º 15
0
  public void createPartControl(Composite parent) {
    final Font monospaceFont =
        new Font(parent.getDisplay(), new FontData("Monospace", 12, SWT.NONE));
    final Color greenColor = parent.getDisplay().getSystemColor(SWT.COLOR_DARK_GREEN);
    final Color redColor = parent.getDisplay().getSystemColor(SWT.COLOR_DARK_RED);
    final Color blackColor = parent.getDisplay().getSystemColor(SWT.COLOR_BLACK);
    final Color greyColor = parent.getDisplay().getSystemColor(SWT.COLOR_GRAY);

    FillLayout fillLayout = (FillLayout) parent.getLayout();
    fillLayout.type = SWT.VERTICAL;

    Composite terminalComposite = new Composite(parent, SWT.NONE);
    terminalComposite.setLayout(new FormLayout());
    terminalComposite.setBackground(blackColor);

    TabFolder terminalPane = new TabFolder(terminalComposite, SWT.BOTTOM);
    terminalPane.setBackground(blackColor);
    FormData terminalLayoutData = new FormData();
    terminalLayoutData.top = new FormAttachment(0);
    terminalLayoutData.left = new FormAttachment(0);
    terminalLayoutData.right = new FormAttachment(100);
    terminalPane.setLayoutData(terminalLayoutData);

    TabItem outTabItem = new TabItem(terminalPane, SWT.NONE);
    outTabItem.setText("out");
    //    terminalDataLayer = new DataLayer(currentlySelectedExecutionRecordDataProvider);

    SelectionLayer selectionLayer = new SelectionLayer(terminalDataLayer);
    ViewportLayer viewPortLayer = new ViewportLayer(selectionLayer);
    viewPortLayer.setRegionName(GridRegion.BODY);
    ColumnHeaderLayer columnHeaderLayer =
        new ColumnHeaderLayer(new DataLayer(columnDataProvider), viewPortLayer, selectionLayer);
    CompositeLayer compositeLayer = new CompositeLayer(1, 2);
    compositeLayer.setChildLayer(GridRegion.COLUMN_HEADER, columnHeaderLayer, 0, 0);
    compositeLayer.setChildLayer(GridRegion.BODY, viewPortLayer, 0, 1);
    compositeLayer.setConfigLabelAccumulatorForRegion(GridRegion.BODY, configLabelAccumulator);
    terminalGrid = new NatTable(terminalPane, compositeLayer);
    terminalGrid.setTheme(new EarlGridTheme());
    terminalGrid.setBackground(blackColor);
    outTabItem.setControl(terminalGrid);

    TabItem errTabItem = new TabItem(terminalPane, SWT.NONE);
    errTabItem.setText("err");
    tabularErrorTable = new Table(terminalPane, SWT.VIRTUAL | SWT.HIDE_SELECTION);
    tabularErrorTable.setHeaderVisible(false);
    tabularErrorTable.setLinesVisible(true);
    //    tabularErrorTable.addListener(SWT.SetData, tabularErrorDataHandler);
    tabularErrorTable.setFont(monospaceFont);
    tabularErrorTable.setBackground(redColor);
    tabularErrorTable.setForeground(greyColor);
    errTabItem.setControl(tabularErrorTable);

    TabItem logTabItem = new TabItem(terminalPane, SWT.NONE);
    logTabItem.setText("log");
    tabularLogTable = new Table(terminalPane, SWT.VIRTUAL | SWT.HIDE_SELECTION);
    tabularLogTable.setHeaderVisible(false);
    tabularLogTable.setLinesVisible(true);
    //    tabularLogTable.addListener(SWT.SetData, tabularErrorDataHandler);
    tabularLogTable.setFont(monospaceFont);
    tabularLogTable.setBackground(greenColor);
    tabularLogTable.setForeground(greyColor);
    logTabItem.setControl(tabularLogTable);

    terminalPane.setSelection(0);

    commandLineTxt = new Text(terminalComposite, SWT.BORDER);
    FormData commandLineTxtLayoutData = new FormData();
    commandLineTxtLayoutData.left = new FormAttachment(terminalPane, 0, SWT.LEFT);
    commandLineTxtLayoutData.right = new FormAttachment(terminalPane, 0, SWT.RIGHT);
    commandLineTxtLayoutData.bottom = new FormAttachment(100);
    commandLineTxt.setLayoutData(commandLineTxtLayoutData);
    commandLineTxt.addFocusListener(commandLineFocusListener);
    commandLineTxt.addKeyListener(commandLineKeyListener);
    commandLineTxt.setFont(monospaceFont);
    commandLineTxt.setBackground(blackColor);
    commandLineTxt.setForeground(greyColor);
    commandLineTxt.addTraverseListener(preventTraversal);
    terminalLayoutData.bottom = new FormAttachment(commandLineTxt);

    monospaceFont.dispose();
  }
Exemplo n.º 16
0
  /** Create widgets for monkey options */
  private void createUI() {

    Composite mainComposite = this;
    Layout mainLayout = new GridLayout();
    mainComposite.setLayout(mainLayout);

    // list of monkey options groups
    List<MonkeyOptionsGroup> monkeyOptionsGroupsList =
        MonkeyOptionsMgt.getMonkeyOptionsGroupsList();

    // list of monkey options in each group
    List<MonkeyOption> monkeyOptions = null;

    // Create Tab Folder
    final TabFolder tabFolder = new TabFolder(mainComposite, SWT.NULL);
    GridData data = new GridData(SWT.FILL, SWT.FILL, true, false);
    data.heightHint = TABFOLDER_HEIGHT_HINT;
    tabFolder.setLayoutData(data);

    /*
     * Iterate through Monkey Groups
     */
    for (MonkeyOptionsGroup monkeyOptionGroup : monkeyOptionsGroupsList) {

      // Create Tab Item
      TabItem tabItem = new TabItem(tabFolder, SWT.NULL);
      tabItem.setText(monkeyOptionGroup.getTitle());
      Composite group = new Composite(tabFolder, SWT.NULL);
      group.setLayout(new GridLayout(3, false));
      group.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
      tabItem.setControl(group);

      // get monkey options in this group
      monkeyOptions = monkeyOptionGroup.getMonkeyOptions();

      /*
       * Iterate through Monkey Options in this group
       */
      for (final MonkeyOption monkeyOption : monkeyOptions) {

        // create a checkbox for each monkey option
        Button checkbox = new Button(group, SWT.CHECK);
        checkbox.setSelection(monkeyOption.isChecked());
        checkbox.setText(monkeyOption.getUserFriendlyName());
        checkbox.setToolTipText(monkeyOption.getName() + ": " + monkeyOption.getDescription());

        monkeyOption.setCheckedWidget(checkbox);
        checkbox.addSelectionListener(
            new SelectionAdapter() {
              @Override
              public void widgetSelected(SelectionEvent e) {
                boolean checkedStatus = ((Button) e.widget).getSelection();
                monkeyOption.setChecked(checkedStatus);
                notifyCompositeChangeListeners();
              }
            });
        GridData checkboxData = new GridData(SWT.NULL, SWT.FILL, false, false);
        checkbox.setLayoutData(checkboxData);

        // Create input fields depending on the monkey option type
        switch (monkeyOption.getType()) {
          case TYPE_NONE:
            // extend checkbox area along the line
            checkboxData.widthHint = SWT.DEFAULT;
            checkboxData.horizontalSpan = 3;
            checkbox.setLayoutData(checkboxData);
            break;

          case TYPE_TEXT:
          case TYPE_NUMBER:
            createWidgetsForTextOrNumberType(group, monkeyOption);
            break;

          case TYPE_PATH:
            createWidgetsForPathType(group, monkeyOption);
            break;

          default:
            // none

        }
      }
    }

    /*
     * Command Line area
     */
    Composite commandLineArea = new Composite(mainComposite, SWT.NONE); // composite
    commandLineArea.setLayout(new GridLayout(2, false));
    data = new GridData(SWT.FILL, SWT.FILL, true, true);
    commandLineArea.setLayoutData(data);

    Label commandLineLabel = new Label(commandLineArea, SWT.NONE); // label
    commandLineLabel.setText(AndroidNLS.UI_MonkeyOptions_CommandLine);
    data = new GridData(SWT.FILL, SWT.FILL, false, true);
    commandLineLabel.setLayoutData(data);

    commandLine =
        new Text(commandLineArea, SWT.MULTI | SWT.WRAP | SWT.BORDER | SWT.V_SCROLL); // text
    data = new GridData(SWT.FILL, SWT.FILL, true, true);
    commandLineArea.pack();
    data.widthHint = commandLineArea.getBounds().width - commandLineLabel.getBounds().width;
    data.heightHint = commandLineArea.getBounds().height;
    commandLine.setLayoutData(data);
    commandLine.setText(MonkeyOptionsMgt.getParamList());
    commandLine.setEditable(false);
  }
  /** Create contents of the window */
  protected void createContents() {

    m_shell = new Shell();

    m_shell.setImage(SWTResourceManager.getImage(IPAToolAppWnd.class, "/Properties.ico"));
    final BorderLayout borderLayout = new BorderLayout(0, 0);
    borderLayout.setVgap(5);
    m_shell.setLayout(borderLayout);
    m_shell.setSize(800, 400);
    m_shell.setMinimumSize(new Point(800, 400));
    m_shell.setText("IPATool2");

    Composite composite;
    composite = new Composite(m_shell, SWT.NONE);
    {
      TabFolder tabFolder = new TabFolder(composite, SWT.NONE);
      tabFolder.setBounds(10, 10, 748, 200);

      {
        TabItem tbtmTools = new TabItem(tabFolder, SWT.NONE);
        tbtmTools.setText("Tools");

        Composite composite_1 = new Composite(tabFolder, SWT.NONE);
        tbtmTools.setControl(composite_1);

        m_txtUpdFolder = new Text(composite_1, SWT.BORDER);
        m_txtUpdFolder.setText("");
        m_txtUpdFolder.setBounds(122, 14, 564, 21);

        Button btnUpdFolder = new Button(composite_1, SWT.NONE);
        btnUpdFolder.addSelectionListener(
            new SelectionAdapter() {

              @Override
              public void widgetSelected(SelectionEvent e) {
                _selectFolder(m_txtUpdFolder);
              }
            });
        btnUpdFolder.setText("...");
        btnUpdFolder.setBounds(692, 12, 38, 25);

        m_txtExistingFolder = new Text(composite_1, SWT.BORDER);
        m_txtExistingFolder.setText("");
        m_txtExistingFolder.setBounds(122, 45, 564, 21);

        Button btnExFolder = new Button(composite_1, SWT.NONE);
        btnExFolder.addSelectionListener(
            new SelectionAdapter() {

              @Override
              public void widgetSelected(SelectionEvent e) {
                _selectFolder(m_txtExistingFolder);
              }
            });
        btnExFolder.setText("...");
        btnExFolder.setBounds(692, 43, 38, 25);

        m_txtITunesFolder = new Text(composite_1, SWT.BORDER);
        m_txtITunesFolder.setText("");
        m_txtITunesFolder.setBounds(122, 76, 564, 21);

        Button btnitunesFolder = new Button(composite_1, SWT.NONE);
        btnitunesFolder.addSelectionListener(
            new SelectionAdapter() {

              @Override
              public void widgetSelected(SelectionEvent e) {
                _selectFolder(m_txtITunesFolder);
              }
            });
        btnitunesFolder.setText("...");
        btnitunesFolder.setBounds(692, 74, 38, 25);

        m_lbliTunes = new Label(composite_1, SWT.NONE);
        m_lbliTunes.setText("iTunes IPAs Folder:");
        m_lbliTunes.setBounds(10, 79, 119, 15);

        m_lblExFolder = new Label(composite_1, SWT.NONE);
        m_lblExFolder.setText("Current IPAs Folder:");
        m_lblExFolder.setBounds(10, 48, 119, 15);

        Label lblUpdFolder = new Label(composite_1, SWT.NONE);
        lblUpdFolder.setFont(SWTResourceManager.getFont("Segoe UI", 9, SWT.BOLD));
        lblUpdFolder.setForeground(SWTResourceManager.getColor(SWT.COLOR_RED));
        lblUpdFolder.setText(" IPAs Folder:");
        lblUpdFolder.setBounds(10, 17, 119, 15);
        {
          m_chkRecurseFolders = new Button(composite_1, SWT.CHECK);
          m_chkRecurseFolders.addSelectionListener(
              new SelectionAdapter() {

                @Override
                public void widgetSelected(SelectionEvent e) {}
              });
          m_chkRecurseFolders.setLocation(122, 103);
          m_chkRecurseFolders.setSize(107, 16);
          m_chkRecurseFolders.setSelection(true);
          m_chkRecurseFolders.setText("Recurse folders");
        }
        {
          m_btnRenameIPAs = new Button(composite_1, SWT.NONE);
          m_btnRenameIPAs.setBackground(SWTResourceManager.getColor(SWT.COLOR_RED));
          m_btnRenameIPAs.setLocation(120, 137);
          m_btnRenameIPAs.setSize(94, 25);
          m_btnRenameIPAs.addSelectionListener(
              new SelectionAdapter() {

                @Override
                public void widgetSelected(SelectionEvent e) {
                  renameIPAs();
                }
              });
          m_btnRenameIPAs.setText("Rename IPAs");
        }

        m_btnUpdateIPAs = new Button(composite_1, SWT.NONE);
        m_btnUpdateIPAs.addSelectionListener(
            new SelectionAdapter() {

              @Override
              public void widgetSelected(SelectionEvent e) {
                updateIPAs();
              }
            });
        m_btnUpdateIPAs.setBounds(216, 137, 94, 25);
        m_btnUpdateIPAs.setText("Update IPAs");

        m_chkUseAllFolders = new Button(composite_1, SWT.CHECK);
        m_chkUseAllFolders.addSelectionListener(
            new SelectionAdapter() {

              @Override
              public void widgetSelected(SelectionEvent e) {
                if (m_chkUseAllFolders.getSelection()) {
                  m_lblExFolder.setForeground(SWTResourceManager.getColor(SWT.COLOR_RED));
                  m_lbliTunes.setForeground(SWTResourceManager.getColor(SWT.COLOR_RED));
                } else {
                  m_lblExFolder.setForeground(null);
                  m_lbliTunes.setForeground(null);
                }
              }
            });
        m_chkUseAllFolders.setBounds(244, 103, 107, 16);
        m_chkUseAllFolders.setText("Use all folders");

        m_btnCleanJPGs = new Button(composite_1, SWT.NONE);
        m_btnCleanJPGs.setBackground(SWTResourceManager.getColor(SWT.COLOR_RED));
        m_btnCleanJPGs.setBounds(310, 137, 94, 25);
        m_btnCleanJPGs.addSelectionListener(
            new SelectionAdapter() {

              @Override
              public void widgetSelected(SelectionEvent e) {
                cleanJPEGs();
              }
            });
        m_btnCleanJPGs.setText("Clean JPEGs");
      }

      TabItem tbtmCheckIPAs = new TabItem(tabFolder, SWT.NONE);
      tbtmCheckIPAs.setText("Check");

      Composite composite_1 = new Composite(tabFolder, SWT.NONE);
      tbtmCheckIPAs.setControl(composite_1);

      m_txtIPhoneFolder = new Text(composite_1, SWT.BORDER);
      m_txtIPhoneFolder.setText("");
      m_txtIPhoneFolder.setBounds(122, 14, 564, 21);

      Button btnIPhoneFolder = new Button(composite_1, SWT.NONE);
      btnIPhoneFolder.addSelectionListener(
          new SelectionAdapter() {

            @Override
            public void widgetSelected(SelectionEvent e) {
              _selectFolder(m_txtIPhoneFolder);
            }
          });
      btnIPhoneFolder.setText("...");
      btnIPhoneFolder.setBounds(692, 12, 38, 25);

      m_txtIPadFolder = new Text(composite_1, SWT.BORDER);
      m_txtIPadFolder.setText("");
      m_txtIPadFolder.setBounds(122, 45, 564, 21);

      Button btnIPadFolder = new Button(composite_1, SWT.NONE);
      btnIPadFolder.addSelectionListener(
          new SelectionAdapter() {

            @Override
            public void widgetSelected(SelectionEvent e) {
              _selectFolder(m_txtIPadFolder);
            }
          });
      btnIPadFolder.setText("...");
      btnIPadFolder.setBounds(692, 43, 38, 25);

      m_txtMixedFolder = new Text(composite_1, SWT.BORDER);
      m_txtMixedFolder.setText("");
      m_txtMixedFolder.setBounds(122, 76, 564, 21);

      Button btnMixedFolder = new Button(composite_1, SWT.NONE);
      btnMixedFolder.addSelectionListener(
          new SelectionAdapter() {

            @Override
            public void widgetSelected(SelectionEvent e) {
              _selectFolder(m_txtMixedFolder);
            }
          });
      btnMixedFolder.setText("...");
      btnMixedFolder.setBounds(692, 74, 38, 25);

      Label lblBothIpasFolder = new Label(composite_1, SWT.NONE);
      lblBothIpasFolder.setText("mixed Folder:");
      lblBothIpasFolder.setBounds(10, 79, 119, 15);

      Label lblIpadIpasFolder = new Label(composite_1, SWT.NONE);
      lblIpadIpasFolder.setText("iPad Folder:");
      lblIpadIpasFolder.setBounds(10, 48, 119, 15);

      Label lblIphoneFolder = new Label(composite_1, SWT.NONE);
      lblIphoneFolder.setText("iPhone Folder:");
      lblIphoneFolder.setBounds(10, 17, 119, 15);

      m_btnCheck = new Button(composite_1, SWT.NONE);
      m_btnCheck.addSelectionListener(
          new SelectionAdapter() {

            @Override
            public void widgetSelected(SelectionEvent e) {
              checkIPAs();
            }
          });
      m_btnCheck.setText("Check IPAs");
      m_btnCheck.setBounds(122, 122, 90, 25);
    }
    composite.setLayoutData(BorderLayout.NORTH);

    final Label lblX = new Label(composite, SWT.NONE);
    lblX.setBounds(10, 10, 14, 211);
    final TabFolder m_tabTraces = new TabFolder(m_shell, SWT.NONE);
    m_tabTraces.setLayoutData(BorderLayout.CENTER);

    final Composite composite_1 = new Composite(m_shell, SWT.NONE);
    composite_1.setLayout(new BorderLayout(0, 0));
    composite_1.setLayoutData(BorderLayout.CENTER);

    // ------------------------------------------------------------------------
    // ********** TabbedTracer ***********************************************
    final CTabFolder tabTraces = m_tabbedTracer.createTabFolder(composite_1);
    tabTraces.setLayoutData(BorderLayout.CENTER);
    Tracer.setTracer(m_tabbedTracer);
  }
Exemplo n.º 18
0
  private void initGUI() {
    try {
      final FormLayout thisLayout = new FormLayout();
      this.setLayout(thisLayout);
      this.setSize(217, 163);
      {
        filenameHolder = new Composite(this, SWT.NONE);
        final GridLayout filenameHolderLayout = new GridLayout();
        filenameHolderLayout.numColumns = 3;
        filenameHolderLayout.makeColumnsEqualWidth = true;
        final FormData filenameHolderLData = new FormData();
        filenameHolderLData.width = 214;
        filenameHolderLData.height = 47;
        filenameHolderLData.left = new FormAttachment(16, 1000, 0);
        filenameHolderLData.right = new FormAttachment(1000, 1000, 0);
        filenameHolderLData.top = new FormAttachment(21, 1000, 0);
        filenameHolder.setLayoutData(filenameHolderLData);
        filenameHolder.setLayout(filenameHolderLayout);
        {
          scenarioLbl = new Label(filenameHolder, SWT.NONE);
          final GridData scenarioLblLData = new GridData();
          scenarioLblLData.horizontalAlignment = GridData.FILL;
          scenarioLbl.setLayoutData(scenarioLblLData);
          scenarioLbl.setText("Scenario");
          scenarioLbl.setAlignment(SWT.RIGHT);
        }
        {
          scenarioVal = new Label(filenameHolder, SWT.NONE);
          final GridData scenarioValLData = new GridData();
          scenarioValLData.horizontalSpan = 2;
          scenarioValLData.horizontalAlignment = GridData.FILL;
          scenarioValLData.grabExcessHorizontalSpace = true;
          scenarioVal.setLayoutData(scenarioValLData);
          scenarioVal.setText("[pending]");
        }
        {
          controlLabel = new Label(filenameHolder, SWT.NONE);
          final GridData label1LData = new GridData();
          label1LData.horizontalAlignment = GridData.FILL;
          controlLabel.setLayoutData(label1LData);
          controlLabel.setText("Control file");
          controlLabel.setAlignment(SWT.RIGHT);
        }
        {
          controlVal = new Label(filenameHolder, SWT.NONE);
          final GridData label2LData = new GridData();
          label2LData.horizontalSpan = 2;
          label2LData.grabExcessHorizontalSpace = true;
          label2LData.horizontalAlignment = GridData.FILL;
          controlVal.setLayoutData(label2LData);
          controlVal.setText("[pending]");
        }
      }
      {
        scenarioTabs = new TabFolder(this, SWT.NONE);
        {
          multipleTab = new TabItem(scenarioTabs, SWT.NONE);
          multipleTab.setText("Multiple Scenarios");
          {
            composite2 = new Composite(scenarioTabs, SWT.NONE);
            final GridLayout composite2Layout = new GridLayout();
            composite2Layout.makeColumnsEqualWidth = true;
            composite2.setLayout(composite2Layout);
            multipleTab.setControl(composite2);
            {
              multiRunBtnHolder = new Composite(composite2, SWT.NONE);
              final RowLayout multiRunBtnHolderLayout =
                  new RowLayout(org.eclipse.swt.SWT.HORIZONTAL);
              multiRunBtnHolderLayout.fill = true;
              final GridData multiRunBtnHolderLData = new GridData();
              multiRunBtnHolderLData.grabExcessHorizontalSpace = true;
              multiRunBtnHolder.setLayoutData(multiRunBtnHolderLData);
              multiRunBtnHolder.setLayout(multiRunBtnHolderLayout);
              {
                doGenerateButton = new Button(multiRunBtnHolder, SWT.PUSH | SWT.CENTER);
                doGenerateButton.setText("Generate");
              }
              {
                runBtn = new Button(multiRunBtnHolder, SWT.PUSH | SWT.CENTER);
                runBtn.setText("Run all");
              }
            }

            {
              multiTableHolder = new Composite(composite2, SWT.NONE);
              final GridLayout multiTableHolderLayout = new GridLayout();
              multiTableHolderLayout.makeColumnsEqualWidth = true;
              multiTableHolder.setLayout(multiTableHolderLayout);
            }
          }
        }
        final FormData scenarioTabsLData = new FormData();
        scenarioTabsLData.width = 204;
        scenarioTabsLData.left = new FormAttachment(10, 1000, 0);
        scenarioTabsLData.right = new FormAttachment(990, 1000, 0);
        scenarioTabsLData.bottom = new FormAttachment(1000, 1000, 0);
        scenarioTabsLData.height = 79;
        scenarioTabsLData.top = new FormAttachment(0, 1000, 56);
        scenarioTabs.setLayoutData(scenarioTabsLData);
        scenarioTabs.setSelection(1);
      }
      this.layout();
    } catch (final Exception e) {
      e.printStackTrace();
    }
  }
  /** {@inheritDoc} */
  public Control createContents(Composite parent) {

    Composite container = null;

    try {

      this.mPageController = new PageController();

      // suppress default- & apply-buttons
      noDefaultAndApplyButton();

      mMainTab = new TabFolder(parent, SWT.TOP);
      mMainTab.setLayoutData(new GridData(GridData.FILL_BOTH));
      mMainTab.addSelectionListener(mPageController);

      // create the main container
      container = new Composite(mMainTab, SWT.NULL);
      container.setLayout(new FormLayout());
      container.setLayoutData(new GridData(GridData.FILL_BOTH));

      // create the checkbox to enable/diable the simple configuration
      this.mChkSimpleConfig = new Button(container, SWT.CHECK);
      this.mChkSimpleConfig.setText(Messages.CheckstylePropertyPage_btnUseSimpleConfig);
      this.mChkSimpleConfig.addSelectionListener(this.mPageController);
      this.mChkSimpleConfig.setSelection(mProjectConfig.isUseSimpleConfig());

      FormData fd = new FormData();
      // fd.left = new FormAttachment(this.mChkEnable, 0, SWT.RIGHT);
      fd.top = new FormAttachment(0, 3);
      fd.right = new FormAttachment(100, -3);
      this.mChkSimpleConfig.setLayoutData(fd);

      // create the checkbox to enabel/disable checkstyle
      this.mChkEnable = new Button(container, SWT.CHECK);
      this.mChkEnable.setText(Messages.CheckstylePropertyPage_btnActivateCheckstyle);
      this.mChkEnable.addSelectionListener(this.mPageController);
      this.mChkEnable.setSelection(mCheckstyleInitiallyActivated);

      fd = new FormData();
      fd.left = new FormAttachment(0, 3);
      fd.top = new FormAttachment(0, 3);
      fd.right = new FormAttachment(this.mChkSimpleConfig, 3, SWT.LEFT);
      this.mChkEnable.setLayoutData(fd);

      // create the checkbox for formatter synching
      this.mChkSyncFormatter = new Button(container, SWT.CHECK);
      this.mChkSyncFormatter.setText(Messages.CheckstylePropertyPage_btnSyncFormatter);
      this.mChkSyncFormatter.addSelectionListener(this.mPageController);
      this.mChkSyncFormatter.setSelection(mProjectConfig.isSyncFormatter());

      fd = new FormData();
      fd.left = new FormAttachment(0, 3);
      fd.top = new FormAttachment(this.mChkEnable, 3, SWT.BOTTOM);
      this.mChkSyncFormatter.setLayoutData(fd);

      // create the configuration area
      mFileSetsContainer = new Composite(container, SWT.NULL);
      Control configArea = createFileSetsArea(mFileSetsContainer);
      fd = new FormData();
      fd.left = new FormAttachment(0, 3);
      fd.top = new FormAttachment(this.mChkSyncFormatter, 6, SWT.BOTTOM);
      fd.right = new FormAttachment(100, -3);
      fd.bottom = new FormAttachment(45);
      configArea.setLayoutData(fd);

      // create the filter area
      Control filterArea = createFilterArea(container);
      fd = new FormData();
      fd.left = new FormAttachment(0, 3);
      fd.top = new FormAttachment(configArea, 3, SWT.BOTTOM);
      fd.right = new FormAttachment(100, -3);
      fd.bottom = new FormAttachment(100, -3);
      fd.width = 500;
      filterArea.setLayoutData(fd);

      // create the local configurations area
      Control localConfigArea = createLocalConfigArea(mMainTab);

      TabItem mainItem = new TabItem(mMainTab, SWT.NULL);
      mainItem.setControl(container);
      mainItem.setText(Messages.CheckstylePropertyPage_tabMain);

      TabItem localItem = new TabItem(mMainTab, SWT.NULL);
      localItem.setControl(localConfigArea);
      localItem.setText(Messages.CheckstylePropertyPage_tabCheckConfigs);

    } catch (CheckstylePluginException e) {
      CheckstyleUIPlugin.errorDialog(getShell(), Messages.errorOpeningPropertiesPage, e, true);
    }

    return container;
  }
Exemplo n.º 20
0
  protected Control createPageArea(Composite parent) {
    int numPages = fDescriptors.size();
    fScopeParts = new ScopePart[numPages];

    if (numPages == 0) {
      Label label = new Label(parent, SWT.CENTER | SWT.WRAP);
      label.setText(SearchMessages.SearchDialog_noSearchExtension);
      return label;
    }

    fCurrentIndex = getPreferredPageIndex();

    Composite composite = new Composite(parent, SWT.NONE);
    composite.setFont(parent.getFont());

    GridLayout layout = new GridLayout();
    layout.marginHeight = 0;
    layout.marginWidth = 0;
    composite.setLayout(layout);
    composite.setLayoutData(new GridData(GridData.FILL_BOTH));

    TabFolder folder = new TabFolder(composite, SWT.NONE);
    folder.setLayout(new TabFolderLayout());
    folder.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
    folder.setFont(composite.getFont());

    for (int i = 0; i < numPages; i++) {
      SearchPageDescriptor descriptor = getDescriptorAt(i);
      if (WorkbenchActivityHelper.filterItem(descriptor)) continue;

      final TabItem item = new TabItem(folder, SWT.NONE);
      item.setData("descriptor", descriptor); // $NON-NLS-1$
      item.setText(descriptor.getLabel());
      item.addDisposeListener(
          new DisposeListener() {
            public void widgetDisposed(DisposeEvent e) {
              item.setData("descriptor", null); // $NON-NLS-1$
              if (item.getImage() != null) item.getImage().dispose();
            }
          });
      ImageDescriptor imageDesc = descriptor.getImage();
      if (imageDesc != null) item.setImage(imageDesc.createImage());

      if (i == fCurrentIndex) {
        Control pageControl = createPageControl(folder, descriptor);
        pageControl.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
        item.setControl(pageControl);
        fCurrentPage = descriptor.getPage();
        fDialogSettings.put(STORE_PREVIOUS_PAGE, descriptor.getId());
      }
    }

    folder.addSelectionListener(
        new SelectionAdapter() {
          public void widgetSelected(SelectionEvent event) {
            turnToPage(event);
          }
        });

    folder.setSelection(fCurrentIndex);

    return composite;
  }
  /* (non-Javadoc)
   * @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite)
   */
  public void createControl(Composite parent) {
    Composite comp = SWTFactory.createComposite(parent, 1, 1, GridData.FILL_BOTH, 0, 0);

    Composite nameComp = SWTFactory.createComposite(comp, 2, 1, GridData.FILL_HORIZONTAL, 0, 0);

    SWTFactory.createLabel(nameComp, PDEUIMessages.TargetDefinitionContentPage_4, 1);

    fNameText = SWTFactory.createSingleText(nameComp, 1);
    fNameText.addModifyListener(
        new ModifyListener() {
          public void modifyText(ModifyEvent e) {
            String name = fNameText.getText().trim();
            if (name.length() == 0) {
              setErrorMessage(PDEUIMessages.TargetDefinitionContentPage_7);
            } else {
              setErrorMessage(null);
              setMessage(PDEUIMessages.TargetDefinitionContentPage_2);
            }
            getTargetDefinition().setName(name);
            setPageComplete(isPageComplete());
          }
        });

    TabFolder tabs = new TabFolder(comp, SWT.NONE);
    tabs.setLayoutData(new GridData(GridData.FILL_BOTH));
    tabs.setFont(comp.getFont());

    fLocationTab = new TabItem(tabs, SWT.NONE);
    fLocationTab.setText(PDEUIMessages.LocationSection_0);

    Composite pluginTabContainer = SWTFactory.createComposite(tabs, 1, 1, GridData.FILL_BOTH);
    SWTFactory.createWrapLabel(
        pluginTabContainer, PDEUIMessages.TargetDefinitionContentPage_LocationDescription, 2, 400);
    fLocationTree = TargetLocationsGroup.createInDialog(pluginTabContainer);
    fLocationTab.setControl(pluginTabContainer);
    PlatformUI.getWorkbench()
        .getHelpSystem()
        .setHelp(pluginTabContainer, IHelpContextIds.EDIT_TARGET_WIZARD_LOCATIONS_TAB);

    TabItem contentTab = new TabItem(tabs, SWT.NONE);
    contentTab.setText(PDEUIMessages.TargetDefinitionContentPage_6);
    Composite contentTabContainer = SWTFactory.createComposite(tabs, 1, 1, GridData.FILL_BOTH);
    SWTFactory.createWrapLabel(contentTabContainer, PDEUIMessages.ContentSection_1, 2, 400);
    fContentTree = TargetContentsGroup.createInDialog(contentTabContainer);
    contentTab.setControl(contentTabContainer);
    PlatformUI.getWorkbench()
        .getHelpSystem()
        .setHelp(contentTabContainer, IHelpContextIds.EDIT_TARGET_WIZARD_CONTENT_TAB);

    TabItem envTab = new TabItem(tabs, SWT.NONE);
    envTab.setText(PDEUIMessages.TargetDefinitionEnvironmentPage_3);
    Composite envTabContainer = SWTFactory.createComposite(tabs, 1, 1, GridData.FILL_BOTH);
    createTargetEnvironmentGroup(envTabContainer);
    createJREGroup(envTabContainer);
    envTab.setControl(envTabContainer);
    PlatformUI.getWorkbench()
        .getHelpSystem()
        .setHelp(envTabContainer, IHelpContextIds.EDIT_TARGET_WIZARD_ENVIRONMENT_TAB);

    TabItem argsTab = new TabItem(tabs, SWT.NONE);
    argsTab.setText(PDEUIMessages.TargetDefinitionEnvironmentPage_4);
    argsTab.setControl(createArgumentsGroup(tabs));
    PlatformUI.getWorkbench()
        .getHelpSystem()
        .setHelp(argsTab.getControl(), IHelpContextIds.EDIT_TARGET_WIZARD_ARGUMENT_TAB);

    TabItem depTab = new TabItem(tabs, SWT.NONE);
    depTab.setText(PDEUIMessages.TargetDefinitionEnvironmentPage_5);
    depTab.setControl(createImplicitTabContents(tabs));
    PlatformUI.getWorkbench()
        .getHelpSystem()
        .setHelp(depTab.getControl(), IHelpContextIds.EDIT_TARGET_WIZARD_IMPLICIT_TAB);

    PlatformUI.getWorkbench().getHelpSystem().setHelp(comp, IHelpContextIds.EDIT_TARGET_WIZARD);
    initializeListeners();
    targetChanged(getTargetDefinition());
    setControl(comp);
  }
Exemplo n.º 22
0
  private void create(Shell parent, boolean readOnly) {
    shell.setText(Res.getString("EditorCaption"));
    if (parent != null) shell.setImage(parent.getImage());
    GridLayout layTmp = new GridLayout();
    layTmp.marginBottom = 0;
    layTmp.verticalSpacing = 0;
    shell.setLayout(layTmp);

    TabFolder tfTmp = new TabFolder(shell, SWT.NONE);
    GridData gdTmp = new GridData(GridData.FILL_BOTH);
    tfTmp.setLayoutData(gdTmp);

    // --- Options tab

    Composite cmpTmp = new Composite(tfTmp, SWT.NONE);
    layTmp = new GridLayout();
    cmpTmp.setLayout(layTmp);

    Group grpTmp = new Group(cmpTmp, SWT.NONE);
    layTmp = new GridLayout();
    grpTmp.setLayout(layTmp);
    grpTmp.setText(Res.getString("grpStandaloneStrings"));
    gdTmp = new GridData(GridData.FILL_HORIZONTAL);
    grpTmp.setLayoutData(gdTmp);

    chkExtractStandalone = new Button(grpTmp, SWT.CHECK);
    chkExtractStandalone.setText(Res.getString("chkExtractStandalone"));

    grpTmp = new Group(cmpTmp, SWT.NONE);
    grpTmp.setLayout(new GridLayout());
    grpTmp.setText(Res.getString("grpKeyValuePairs"));
    gdTmp = new GridData(GridData.FILL_HORIZONTAL);
    grpTmp.setLayoutData(gdTmp);

    rdExtractAllPairs = new Button(grpTmp, SWT.RADIO);
    rdExtractAllPairs.setText(Res.getString("rdExtractAllPairs"));
    rdDontExtractPairs = new Button(grpTmp, SWT.RADIO);
    rdDontExtractPairs.setText(Res.getString("rdDontExtractPairs"));

    Label label = new Label(grpTmp, SWT.NONE);
    label.setText(Res.getString("stExceptions"));

    edExceptions = new Text(grpTmp, SWT.BORDER);
    gdTmp = new GridData(GridData.FILL_HORIZONTAL);
    edExceptions.setLayoutData(gdTmp);

    TabItem tiTmp = new TabItem(tfTmp, SWT.NONE);
    tiTmp.setText(Res.getString("tabOptions"));
    tiTmp.setControl(cmpTmp);

    // --- Inline tab

    cmpTmp = new Composite(tfTmp, SWT.NONE);
    layTmp = new GridLayout();
    cmpTmp.setLayout(layTmp);

    chkUseCodeFinder = new Button(cmpTmp, SWT.CHECK);
    chkUseCodeFinder.setText("Has inline codes as defined below:");
    chkUseCodeFinder.addSelectionListener(
        new SelectionAdapter() {
          public void widgetSelected(SelectionEvent e) {
            updateInlineCodes();
          };
        });

    pnlCodeFinder = new InlineCodeFinderPanel(cmpTmp, SWT.NONE);
    pnlCodeFinder.setLayoutData(new GridData(GridData.FILL_BOTH));

    tiTmp = new TabItem(tfTmp, SWT.NONE);
    tiTmp.setText("Inline Codes");
    tiTmp.setControl(cmpTmp);

    // --- Output tab

    /*cmpTmp = new Composite(tfTmp, SWT.NONE);
    layTmp = new GridLayout();
    cmpTmp.setLayout(layTmp);

    grpTmp = new Group(cmpTmp, SWT.NONE);
    layTmp = new GridLayout();
    grpTmp.setLayout(layTmp);
    grpTmp.setText(Res.getString("grpExtendedChars"));
    gdTmp = new GridData(GridData.FILL_HORIZONTAL);
    grpTmp.setLayoutData(gdTmp);

    chkEscapeExtendedChars = new Button(grpTmp, SWT.CHECK);
    chkEscapeExtendedChars.setText(Res.getString("chkEscapeExtendedChars"));

    tiTmp = new TabItem(tfTmp, SWT.NONE);
    tiTmp.setText(Res.getString("tabOutput"));
    tiTmp.setControl(cmpTmp);*/

    // --- Dialog-level buttons

    SelectionAdapter OKCancelActions =
        new SelectionAdapter() {
          public void widgetSelected(SelectionEvent e) {
            result = false;
            if (e.widget.getData().equals("h")) {
              if (help != null) help.showWiki("JSON Filter");
              return;
            }
            if (e.widget.getData().equals("o")) {
              if (!saveData()) return;
              result = true;
            }
            shell.close();
          };
        };
    pnlActions = new OKCancelPanel(shell, SWT.NONE, OKCancelActions, true);
    gdTmp = new GridData(GridData.FILL_HORIZONTAL);
    pnlActions.setLayoutData(gdTmp);
    pnlActions.btOK.setEnabled(!readOnly);
    if (!readOnly) {
      shell.setDefaultButton(pnlActions.btOK);
    }

    shell.pack();
    Rectangle Rect = shell.getBounds();
    shell.setMinimumSize(Rect.width, Rect.height);
    Dialogs.centerWindow(shell, parent);
    setData();
  }
  /** @see PreferencePage#createContents(Composite) */
  protected Control createContents(Composite parent) {
    final String MULTIPAGE_EDITOR_PAGE_DBSETTING =
        DbfLauncherPlugin.getResourceString("multipage.editor.page.dbsetting");
    final String MULTIPAGE_EDITOR_PAGE_DBINTERFACE =
        DbfLauncherPlugin.getResourceString("multipage.editor.page.dbinterface");
    final String MULTIPAGE_EDITOR_PAGE_DISPLAY =
        DbfLauncherPlugin.getResourceString("multipage.editor.page.display");
    final String MULTIPAGE_EDITOR_PAGE_MODEL =
        DbfLauncherPlugin.getResourceString("multipage.editor.page.model");
    final String MULTIPAGE_EDITOR_PAGE_MAPPING =
        DbfLauncherPlugin.getResourceString("multipage.editor.page.mapping");
    final String MULTIPAGE_EDITOR_PAGE_DRIVER =
        DbfLauncherPlugin.getResourceString("multipage.editor.page.driver");
    final String MULTIPAGE_EDITOR_PAGE_PREVIEW =
        DbfLauncherPlugin.getResourceString("multipage.editor.page.preview");
    DbfLauncherPlugin.log(
        IStatus.INFO,
        DbfLauncherPlugin.getResourceString("DbfProjectPropertyPage createContents new TabFolder"));

    folder = new TabFolder(parent, SWT.NONE);

    // folder.setLayout(new TabFolderLayout());
    folder.setLayoutData(new GridData(GridData.FILL_BOTH));
    // TODO findout why iprogressmonitor stuck property pages
    // iprogressmonitor = new ProgressMonitorPart(folder,
    // folder.getLayout());

    MyDefaultSelectionListener mydefaultselectionlistener = new MyDefaultSelectionListener();
    folder.addSelectionListener(mydefaultselectionlistener);

    // general property page
    generalPropertyPage = new DbfProjectGeneralPropertyPage(this);
    dbfProjectPropertyEditor = new DbfProjectPropertyEditor(this);
    // add to tab
    TabItem generalTab = new TabItem(folder, SWT.NONE);
    generalTab.setText(DbfPluginResources.PROPERTIES_PAGE_PROJECT_GENERAL_TAB_LABEL);
    generalTab.setControl(generalPropertyPage.createContents(folder));
    // add to tab
    TabItem dbSettingsTab = new TabItem(folder, SWT.NONE);
    dbSettingsTab.setText(MULTIPAGE_EDITOR_PAGE_DBSETTING);
    dbSettingsTab.setControl(dbfProjectPropertyEditor.createDBSettings(folder));
    // add to tab
    TabItem dbInterfaceSettingsTab = new TabItem(folder, SWT.NONE);
    dbInterfaceSettingsTab.setText(MULTIPAGE_EDITOR_PAGE_DBINTERFACE);
    dbInterfaceSettingsTab.setControl(dbfProjectPropertyEditor.createDbInterfaceSettings(folder));
    // add to tab
    TabItem displaySettingsTab = new TabItem(folder, SWT.NONE);
    displaySettingsTab.setText(MULTIPAGE_EDITOR_PAGE_DISPLAY);
    displaySettingsTab.setControl(dbfProjectPropertyEditor.createDisplaySettings(folder));
    // add to tab
    TabItem modelSettingsTab = new TabItem(folder, SWT.NONE);
    modelSettingsTab.setText(MULTIPAGE_EDITOR_PAGE_MODEL);
    modelSettingsTab.setControl(dbfProjectPropertyEditor.createModelSettings(folder));
    // add to tab
    TabItem dbMappingSettingsTab = new TabItem(folder, SWT.NONE);
    dbMappingSettingsTab.setText(MULTIPAGE_EDITOR_PAGE_MAPPING);
    dbMappingSettingsTab.setControl(dbfProjectPropertyEditor.createMappingSettings(folder));
    // add to tab
    TabItem dbDriverSettingsTab = new TabItem(folder, SWT.NONE);
    dbDriverSettingsTab.setText(MULTIPAGE_EDITOR_PAGE_DRIVER);
    dbDriverSettingsTab.setControl(dbfProjectPropertyEditor.createDriverSettings(folder));
    // add to tab
    TabItem dbPreviewTab = new TabItem(folder, SWT.NONE);
    dbPreviewTab.setText(MULTIPAGE_EDITOR_PAGE_PREVIEW);
    dbPreviewTab.setControl(dbfProjectPropertyEditor.createPreview(folder));

    return folder;
  }
Exemplo n.º 24
0
 private TabFolder createTabs(final Composite parent) {
   final TabFolder tabFolder = new TabFolder(parent, SWT.BORDER);
   tabFolder.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
   return tabFolder;
 }
Exemplo n.º 25
0
  public void createControl(Composite parent) {
    // Check for exception
    if (ex != null) {
      setErrorMessage(ex.getLocalizedMessage());
    }
    scrollTop = new ScrolledComposite(parent, SWT.H_SCROLL | SWT.V_SCROLL);
    scrollTop.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
    scrollTop.setExpandVertical(true);
    scrollTop.setExpandHorizontal(true);

    setControl(scrollTop);

    top = new Composite(scrollTop, SWT.NONE);
    top.setLayout(new GridLayout());

    createVerticalSpacer(top, 1);

    createToolCombo(top);

    createVerticalSpacer(top, 1);

    optionsFolder = new TabFolder(top, SWT.BORDER);
    optionsFolder.setLayoutData(new GridData(GridData.FILL_BOTH));

    // "general" tab
    TabItem generalTab = new TabItem(optionsFolder, SWT.NONE);
    generalTab.setText(Messages.getString("ValgrindOptionsTab.General")); // $NON-NLS-1$

    Composite generalTop = new Composite(optionsFolder, SWT.NONE);
    generalTop.setLayout(new GridLayout());
    generalTop.setLayoutData(new GridData(GridData.FILL_BOTH));

    createBasicOptions(generalTop);

    createVerticalSpacer(generalTop, 1);

    createErrorOptions(generalTop);

    generalTab.setControl(generalTop);

    TabItem suppTab = new TabItem(optionsFolder, SWT.NONE);
    suppTab.setText(Messages.getString("ValgrindOptionsTab.Suppressions")); // $NON-NLS-1$

    Composite suppTop = new Composite(optionsFolder, SWT.NONE);
    suppTop.setLayout(new GridLayout());
    suppTop.setLayoutData(new GridData(GridData.FILL_BOTH));

    createSuppressionsOption(suppTop);

    suppTab.setControl(suppTop);

    toolTab = new TabItem(optionsFolder, SWT.NONE);
    toolTab.setText(Messages.getString("ValgrindOptionsTab.Tool")); // $NON-NLS-1$

    dynamicTabHolder = new Composite(optionsFolder, SWT.NONE);
    dynamicTabHolder.setLayout(new GridLayout());
    dynamicTabHolder.setLayoutData(new GridData(GridData.FILL_BOTH));

    toolTab.setControl(dynamicTabHolder);

    scrollTop.setContent(top);
    recomputeSize();
  }
Exemplo n.º 26
0
  @Override
  public void createControl(Composite parent) {
    GridData gridData;

    Composite composite = new Composite(parent, SWT.NONE);
    setControl(composite);

    composite.setLayout(new GridLayout());

    gridData = new GridData(SWT.BEGINNING, SWT.FILL, false, false);
    composite.setLayoutData(gridData);

    TabFolder tabFolder = new TabFolder(composite, SWT.TOP);

    /*
     * grabExcessHorizontalSpace must be true or the tab folder will not
     * display a scroll bar if the wizard is resized
     */
    gridData = new GridData(SWT.BEGINNING, SWT.BEGINNING, true, false);

    /*
     * FIXME this does not work and the wizard may "explode" if too many
     * remote projects are presented
     */
    gridData.widthHint = 400;
    tabFolder.setLayoutData(gridData);

    for (final FileList fileList : fileLists) {

      final String projectID = fileList.getProjectID();

      TabItem tabItem = new TabItem(tabFolder, SWT.NONE);
      tabItem.setText(remoteProjectNames.get(projectID));

      ProjectOptionComposite tabComposite = new ProjectOptionComposite(tabFolder, projectID);

      tabItem.setControl(tabComposite);

      projectOptionComposites.put(projectID, tabComposite);
    }

    Composite vcsComposite = new Composite(composite, SWT.NONE);
    vcsComposite.setLayout(new GridLayout());

    disableVCSCheckbox = new Button(vcsComposite, SWT.CHECK);
    disableVCSCheckbox.setText(GeneralPreferencePage.DISABLE_VERSION_CONTROL_TEXT);
    disableVCSCheckbox.setSelection(!preferenceUtils.useVersionControl());

    Button explainButton = new Button(vcsComposite, SWT.PUSH);
    explainButton.setText("Explain");

    final Label explanation = new Label(vcsComposite, SWT.NONE);
    explanation.setEnabled(false);
    explanation.setText(Messages.Explain_version_control);
    explanation.setVisible(false);
    explainButton.addSelectionListener(
        new SelectionAdapter() {

          @Override
          public void widgetSelected(SelectionEvent e) {
            explanation.setVisible(true);
          }
        });
    explainButton.pack();
    explanation.pack();
    updateConnectionStatus();

    attachListeners();

    // invokes updatePageComplete for every project id
    preselectProjectNames();
  }