/*
   * (non-Javadoc)
   *
   * @see
   * org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets
   * .Composite)
   */
  @Override
  protected Control createDialogArea(Composite parent) {
    getShell().setText("Select the views to filter");
    // create a checked treeviewer
    Composite composite = new Composite(parent, 0);
    GridData data = new GridData(GridData.FILL_HORIZONTAL, GridData.FILL_VERTICAL, true, true);
    data.widthHint = 600;
    data.heightHint = 400;
    composite.setLayoutData(data);
    composite.setLayout(new GridLayout());
    treeViewer = new TreeViewer(composite, SWT.CHECK | SWT.BORDER);
    treeViewer.setLabelProvider(new BaseViewInfoLabelProvider());
    treeViewer.setContentProvider(new BaseViewInfoContentProvider());
    treeViewer.setInput(getViewInfo());
    treeViewer
        .getTree()
        .addSelectionListener(
            new SelectionListener() {

              public void widgetDefaultSelected(SelectionEvent e) {
                // should not be called
              }

              public void widgetSelected(SelectionEvent e) {
                treeItemSelected(e);
              }
            });
    data = new GridData(GridData.FILL_HORIZONTAL, GridData.FILL_VERTICAL, true, true);
    data.widthHint = 600;
    data.heightHint = 400;
    treeViewer.getTree().setLayoutData(data);
    getTreeViewer().expandAll();
    populateTree();
    return composite;
  }
  @Override
  protected Control createDialogArea(Composite parent) {
    Composite panel = new Composite(parent, SWT.NONE);
    panel.setLayout(new GridLayout());
    GridData panelData = new GridData(GridData.FILL_BOTH);
    panel.setLayoutData(panelData);

    Group selectedGroup =
        WidgetFactory.createGroup(
            panel, "Selected Translator", GridData.FILL_HORIZONTAL); // $NON-NLS-1$
    selectedGroup.setLayout(new GridLayout(2, false));

    this.translatorNameText =
        WidgetFactory.createTextField(selectedGroup, GridData.FILL_HORIZONTAL, UNDEFINED);
    GridData data = new GridData(GridData.FILL_HORIZONTAL);
    data.heightHint = convertHeightInCharsToPixels(1);
    this.translatorNameText.setLayoutData(data);
    this.translatorNameText.setEditable(false);
    this.translatorNameText.setBackground(panel.getBackground());
    this.translatorNameText.setText(UNDEFINED);

    super.createDialogArea(panel);

    this.statusMessageLabel = new MessageLabel(panel);
    GridData statusData = new GridData(GridData.FILL_HORIZONTAL);
    data.heightHint = convertHeightInCharsToPixels(1);
    this.statusMessageLabel.setLayoutData(statusData);
    this.statusMessageLabel.setEnabled(false);
    this.statusMessageLabel.setText(UNDEFINED);

    getTreeViewer().expandToLevel(3);

    return panel;
  }
Ejemplo n.º 3
0
  private void initGUI() {
    radioGroup =
        new Listener() {
          @Override
          public void handleEvent(Event event) {
            Button b = (Button) event.widget;
            if (b.getSelection() == false) {
              b.setSelection(true);
            } else {
              if (event.widget == btnColumnar) {
                btnRowwise.setSelection(!btnColumnar.getSelection());
              } else {
                btnColumnar.setSelection(!btnRowwise.getSelection());
              }
              input.synchronizeWithUserSide();
            }
          }
        };

    try {
      GridLayout thisLayout = new GridLayout();
      thisLayout.marginWidth = 0;
      thisLayout.marginHeight = 0;
      thisLayout.numColumns = 2;
      thisLayout.horizontalSpacing = 0;
      thisLayout.makeColumnsEqualWidth = true;
      this.setLayout(thisLayout);
      {
        btnColumnar = new Button(this, SWT.TOGGLE | SWT.FLAT | SWT.CENTER);
        GridData btnColumnarLData = new GridData();
        btnColumnarLData.grabExcessHorizontalSpace = true;
        btnColumnarLData.horizontalAlignment = GridData.FILL;
        btnColumnarLData.verticalAlignment = GridData.FILL;
        btnColumnarLData.heightHint = HEIGHT_NORMAL;
        if (flat) btnColumnarLData.heightHint = HEIGHT_FLAT;
        btnColumnar.setLayoutData(btnColumnarLData);
        btnColumnar.setText(Messages.ReadDirectionChooser_0);
        btnColumnar.addListener(SWT.Selection, radioGroup);
      }
      {
        btnRowwise = new Button(this, SWT.TOGGLE | SWT.FLAT | SWT.CENTER);
        GridData btnRowwiseLData = new GridData();
        btnRowwiseLData.grabExcessHorizontalSpace = true;
        btnRowwiseLData.horizontalAlignment = GridData.FILL;
        btnRowwiseLData.verticalAlignment = GridData.FILL;
        btnRowwiseLData.heightHint = HEIGHT_NORMAL;
        if (flat) btnRowwiseLData.heightHint = HEIGHT_FLAT;
        btnRowwise.setLayoutData(btnRowwiseLData);
        btnRowwise.setText(Messages.ReadDirectionChooser_1);
        btnRowwise.addListener(SWT.Selection, radioGroup);
      }
      this.layout();
    } catch (Exception e) {
      LogUtil.logError(e);
    }
    initInput();
  }
  private Control createDialogAreaContentsForLoad(Composite p_composite) {
    messageLabel = new Label(p_composite, SWT.NULL);
    messageLabel.setText(
        Messages.getString("dialogs.OrganizeTestTextDialog.messageLabel.text1")); // $NON-NLS-1$
    GridData gd = new GridData(GridData.VERTICAL_ALIGN_FILL);
    gd.grabExcessHorizontalSpace = true;
    gd.horizontalSpan = 2;
    gd.widthHint = 400;
    messageLabel.setLayoutData(gd);
    Label nameLabel = new Label(p_composite, SWT.NULL);
    nameLabel.setText(
        Messages.getString("dialogs.OrganizeTestTextDialog.nameLabel.text2")); // $NON-NLS-1$
    gd = new GridData(GridData.VERTICAL_ALIGN_BEGINNING);
    gd.grabExcessHorizontalSpace = false;
    nameLabel.setLayoutData(gd);
    nameList = new List(p_composite, SWT.V_SCROLL);
    gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
    gd.grabExcessHorizontalSpace = true;
    gd.heightHint = 100;
    nameList.setLayoutData(gd);
    nameList.setItems(QuickRExPlugin.getDefault().getTestTextNames());
    nameList.addSelectionListener(
        new SelectionListener() {
          public void widgetSelected(SelectionEvent e) {
            if (nameList.getSelection() != null && nameList.getSelection().length > 0) {
              testTextField.setText(
                  QuickRExPlugin.getDefault()
                      .getTestTextByName(nameList.getSelection()[0])
                      .getText());
              selectedPath = null;
            }
          }

          public void widgetDefaultSelected(SelectionEvent e) {}
        });
    Label textLabel = new Label(p_composite, SWT.NULL);
    textLabel.setText(
        Messages.getString("dialogs.OrganizeTestTextDialog.textLabel.text2")); // $NON-NLS-1$
    gd = new GridData(GridData.VERTICAL_ALIGN_BEGINNING);
    gd.grabExcessHorizontalSpace = false;
    textLabel.setLayoutData(gd);
    testTextField =
        new Text(
            p_composite,
            SWT.READ_ONLY | SWT.LEAD | SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.RESIZE);
    gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_FILL);
    gd.grabExcessHorizontalSpace = true;
    gd.grabExcessVerticalSpace = true;
    gd.heightHint = 250;
    gd.widthHint = 400;
    testTextField.setLayoutData(gd);
    testTextField.setBackground(new Color(getShell().getDisplay(), new RGB(255, 255, 255)));
    return p_composite;
  }
  /* (non-Javadoc)
   * @see org.eclipse.bpmn2.modeler.ui.property.editors.ObjectEditor#createControl(org.eclipse.swt.widgets.Composite, java.lang.String, int)
   */
  @Override
  protected Control createControl(Composite composite, String label, int style) {
    super.createControl(composite, label, style);

    // we assume that the "Edit" button will handle editing of this read-only text field
    text.setEditable(false);
    GridData textLayoutData = (GridData) text.getLayoutData();
    textLayoutData.horizontalSpan = 1;
    boolean multiLine = ((style & SWT.MULTI) != 0);

    Composite buttons = new Composite(composite, SWT.NONE);
    buttons.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));
    buttons.setLayout(new FillLayout((style & SWT.MULTI) != 0 ? SWT.VERTICAL : SWT.HORIZONTAL));

    if (canAdd()) {
      addButton = getToolkit().createButton(buttons, null, SWT.PUSH);
      addButton.setImage(Activator.getDefault().getImage(IConstants.ICON_ADD_20));
      if (multiLine) textLayoutData.heightHint += 25;
    }

    if (canRemove()) {
      removeButton = getToolkit().createButton(buttons, null, SWT.PUSH);
      removeButton.setImage(Activator.getDefault().getImage(IConstants.ICON_REMOVE_20));
      if (multiLine) textLayoutData.heightHint += 25;
    }

    defaultButton = getToolkit().createButton(buttons, null, SWT.PUSH);
    defaultButton.setImage(Activator.getDefault().getImage(IConstants.ICON_EDIT_20));

    updateText();

    SelectionAdapter editListener =
        new SelectionAdapter() {

          @SuppressWarnings("unchecked")
          @Override
          public void widgetSelected(SelectionEvent e) {
            int id = ID_DEFAULT_BUTTON;
            if (e.widget == addButton) id = ID_ADD_BUTTON;
            else if (e.widget == removeButton) id = ID_REMOVE_BUTTON;
            buttonClicked(id);
          }
        };
    defaultButton.addSelectionListener(editListener);
    if (canAdd()) addButton.addSelectionListener(editListener);
    if (canRemove()) removeButton.addSelectionListener(editListener);

    return text;
  }
Ejemplo n.º 6
0
  void createRTFTransfer(Composite copyParent, Composite pasteParent) {
    //	RTF Transfer
    Label l = new Label(copyParent, SWT.NONE);
    l.setText("RTFTransfer:"); // $NON-NLS-1$
    copyRtfText = new Text(copyParent, SWT.MULTI | SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
    copyRtfText.setText("some\nrtf\ntext");
    GridData data = new GridData(GridData.FILL_HORIZONTAL);
    data.heightHint = data.widthHint = SIZE;
    copyRtfText.setLayoutData(data);
    Button b = new Button(copyParent, SWT.PUSH);
    b.setText("Copy");
    b.addSelectionListener(
        new SelectionAdapter() {
          public void widgetSelected(SelectionEvent e) {
            String data = copyRtfText.getText();
            if (data.length() > 0) {
              status.setText("");
              data = "{\\rtf1{\\colortbl;\\red255\\green0\\blue0;}\\uc1\\b\\i " + data + "}";
              clipboard.setContents(
                  new Object[] {data}, new Transfer[] {RTFTransfer.getInstance()});
            } else {
              status.setText("nothing to copy");
            }
          }
        });

    l = new Label(pasteParent, SWT.NONE);
    l.setText("RTFTransfer:"); // $NON-NLS-1$
    pasteRtfText =
        new Text(pasteParent, SWT.READ_ONLY | SWT.MULTI | SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
    data = new GridData(GridData.FILL_HORIZONTAL);
    data.heightHint = data.widthHint = SIZE;
    pasteRtfText.setLayoutData(data);
    b = new Button(pasteParent, SWT.PUSH);
    b.setText("Paste");
    b.addSelectionListener(
        new SelectionAdapter() {
          public void widgetSelected(SelectionEvent e) {
            String data = (String) clipboard.getContents(RTFTransfer.getInstance());
            if (data != null && data.length() > 0) {
              status.setText("");
              pasteRtfText.setText("start paste>" + data + "<end paste");
            } else {
              status.setText("nothing to paste");
            }
          }
        });
  }
Ejemplo n.º 7
0
  @Override
  protected Control createContents(Composite parent) {
    Composite composite = new Composite(parent, SWT.NONE);
    POPUP_LAYOUT_FACTORY.applyTo(composite);

    // LAYOUTDATA_GRAB_BOTH.applyTo(composite);
    GridData gd = LAYOUTDATA_GRAB_BOTH.create();

    composite.setLayoutData(gd);
    if (hasTitleArea()) {
      createTitleMenuArea(composite);
      createHorizontalSeparator(composite);
    }
    dialogArea = createDialogArea(composite);
    if (dialogArea.getLayoutData() == null) LAYOUTDATA_GRAB_BOTH.applyTo(composite);

    gd = LAYOUTDATA_GRAB_BOTH.create();
    dialogArea.pack();
    gd.widthHint = dialogArea.getSize().x;
    gd.heightHint = dialogArea.getSize().y;
    dialogArea.setLayoutData(gd);

    if (hasInfoArea()) {
      createHorizontalSeparator(composite);
      createInfoTextArea(composite);
    }
    return composite;
  }
Ejemplo n.º 8
0
 /**
  * Create this dialog's drop-down list component.
  *
  * @param parent the parent composite
  * @return the drop-down list component
  */
 protected void createDropDownText(Composite parent) {
   // create the list
   text = new Text(parent, SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL);
   // print the stacktrace in the text field
   try {
     ByteArrayOutputStream baos = new ByteArrayOutputStream();
     PrintStream ps = new PrintStream(baos);
     detail.printStackTrace(ps);
     if ((detail instanceof SWTError) && (((SWTError) detail).throwable != null)) {
       ps.println("\n*** Stack trace of contained exception ***"); // $NON-NLS-1$
       ((SWTError) detail).throwable.printStackTrace(ps);
     } else if ((detail instanceof SWTException) && (((SWTException) detail).throwable != null)) {
       ps.println("\n*** Stack trace of contained exception ***"); // $NON-NLS-1$
       ((SWTException) detail).throwable.printStackTrace(ps);
     }
     ps.flush();
     baos.flush();
     text.setText(baos.toString());
   } catch (IOException e) {
   }
   GridData data =
       new GridData(
           GridData.HORIZONTAL_ALIGN_FILL
               | GridData.GRAB_HORIZONTAL
               | GridData.VERTICAL_ALIGN_FILL
               | GridData.GRAB_VERTICAL);
   data.heightHint = text.getLineHeight() * TEXT_LINE_COUNT;
   text.setLayoutData(data);
 }
Ejemplo n.º 9
0
  private Text createSerchBar() {
    Text filterText = null;
    if ((gridStyle & IGridViewer.filterBar) != 0) {
      Label headerLabel = new Label(container, SWT.NONE);
      String columnText = filterColumn;
      if (columnNames != null && columnTitles != null) {
        for (int i = 0; i < columnNames.length; i++) {
          if (filterColumn.equals(columnNames[i])) {
            columnText = columnTitles[i];
            break;
          }
        }
      }
      headerLabel.setText(
          LocaleMessage.getString("please.input")
              + columnText
              + LocaleMessage.getString("prefix.of.column"));

      GridData gd = new GridData(GridData.FILL_HORIZONTAL);
      headerLabel.setLayoutData(gd);

      filterText = new Text(container, SWT.SINGLE | SWT.BORDER | SWT.SEARCH);
      gd.heightHint = 15;
      filterText.setLayoutData(gd);
    }
    return filterText;
  }
Ejemplo n.º 10
0
 protected void showStackTrace(boolean visible) {
   Point windowSize = getShell().getSize();
   Point oldSize = getShell().computeSize(SWT.DEFAULT, SWT.DEFAULT);
   GridData stackTraceGD = ((GridData) errorStackTrace.getLayoutData());
   if (visible) {
     stackTraceGD.heightHint = errorStackTrace.getLineHeight() * STACK_TRACE_LINE_COUNT;
     detailsButton.setText(CompatibleDialogConstants.get().HIDE_DETAILS_LABEL);
     errorStackTrace.setVisible(true);
   } else {
     stackTraceGD.heightHint = 0;
     detailsButton.setText(CompatibleDialogConstants.get().SHOW_DETAILS_LABEL);
     errorStackTrace.setVisible(false);
   }
   Point newSize = getShell().computeSize(SWT.DEFAULT, SWT.DEFAULT);
   getShell().setSize(new Point(windowSize.x, windowSize.y + (newSize.y - oldSize.y)));
 }
Ejemplo n.º 11
0
  @Override
  public void createControl(Composite parent) {

    Composite cmpFirstPage = new Composite(parent, SWT.NONE);
    cmpFirstPage.setLayout(new GridLayout(2, true));

    Label label = new Label(cmpFirstPage, SWT.CENTER);
    label.setText("Please connect your device");
    label.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 2, 1));

    Button btnConnect = new Button(cmpFirstPage, SWT.CENTER);
    btnConnect.setText("Connect Device");
    GridData gd_btnConnect = new GridData(SWT.CENTER, SWT.FILL, false, false, 2, 1);
    gd_btnConnect.heightHint = 100;
    btnConnect.setLayoutData(gd_btnConnect);
    btnConnect.addSelectionListener(
        new SelectionListener() {

          @Override
          public void widgetSelected(SelectionEvent arg0) {
            Connect(devicetemplate);
          }

          @Override
          public void widgetDefaultSelected(SelectionEvent arg0) {
            // TODO Auto-generated method stub

          }
        });

    new Label(cmpFirstPage, SWT.NONE);
    lblStatus = new Label(cmpFirstPage, SWT.CENTER);
    lblStatus.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 2, 1));
    setControl(cmpFirstPage);
  }
  /**
   * Create this dialog's drop-down list component.
   *
   * @param parent the parent composite
   */
  protected void createDropDownText(Composite parent) {
    // create the list
    text = new Text(parent, SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL);
    text.setFont(parent.getFont());

    // print the stacktrace in the text field
    try {
      ByteArrayOutputStream baos = new ByteArrayOutputStream();
      PrintStream ps = new PrintStream(baos);
      detail.printStackTrace(ps);
      ps.flush();
      baos.flush();
      text.setText(baos.toString());
    } catch (IOException e) {
    }

    GridData data =
        new GridData(
            GridData.HORIZONTAL_ALIGN_FILL
                | GridData.GRAB_HORIZONTAL
                | GridData.VERTICAL_ALIGN_FILL
                | GridData.GRAB_VERTICAL);
    data.heightHint = text.getLineHeight() * TEXT_LINE_COUNT;
    data.horizontalSpan = 2;
    text.setLayoutData(data);
  }
  public void createControl(Composite parent) {
    Composite container = new Composite(parent, SWT.NONE);
    GridLayout layout = new GridLayout();
    layout.numColumns = 2;
    layout.marginHeight = 0;
    layout.marginWidth = 5;
    container.setLayout(layout);

    tablePart.createControl(container);

    pluginListViewer = tablePart.getTableViewer();
    pluginListViewer.setContentProvider(new BuildpathContentProvider());
    pluginListViewer.setLabelProvider(MDEPlugin.getDefault().getLabelProvider());

    GridData gd = (GridData) tablePart.getControl().getLayoutData();
    gd.heightHint = 300;
    gd.widthHint = 300;

    pluginListViewer.setInput(MDEPlugin.getDefault());
    if (fSelected != null && fSelected.length > 0) {
      tablePart.setSelection(fSelected);
    }
    setControl(container);
    Dialog.applyDialogFont(container);
    PlatformUI.getWorkbench().getHelpSystem().setHelp(container, IHelpContextIds.UPDATE_CLASSPATH);
  }
Ejemplo n.º 14
0
  /**
   * Fills this field editor's basic controls into the given parent.
   *
   * <p>The string field implementation of this <code>FieldEditor</code> framework method
   * contributes the text field. Subclasses may override but must call <code>super.doFillIntoGrid
   * </code>.
   */
  protected void doFillIntoGrid(Composite parent, int numColumns) {
    getLabelControl(parent);

    textField = getTextControl(parent);
    GridData gd = new GridData();
    gd.horizontalSpan = numColumns - 1;
    if (widthInChars != UNLIMITED) {
      GC gc = new GC(textField);
      try {
        Point extent = gc.textExtent("X"); // $NON-NLS-1$
        gd.widthHint = widthInChars * extent.x;
      } finally {
        gc.dispose();
      }
    } else {
      //            System.out.println("fill");
      gd.horizontalAlignment = GridData.FILL_BOTH;
      gd.verticalSpan = 4;
      gd.horizontalSpan = 1;
      gd.grabExcessVerticalSpace = true;
      gd.widthHint = 400;
      gd.heightHint = 60;
      //            gd.grabExcessHorizontalSpace = true;
    }
    textField.setLayoutData(gd);
  }
  private void createFileContentsGroup(Composite parent) {
    Group theGroup =
        WidgetFactory.createGroup(
            parent, getString("fileContentsGroup"), SWT.NONE, 1, 4); // $NON-NLS-1$
    GridData groupGD = new GridData(GridData.FILL_BOTH);
    groupGD.heightHint = GROUP_HEIGHT_190;
    groupGD.widthHint = 400;
    theGroup.setLayoutData(groupGD);

    this.fileContentsViewer = new ListViewer(theGroup, SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
    GridData data = new GridData(GridData.FILL_BOTH);
    data.horizontalSpan = 4;
    this.fileContentsViewer.getControl().setFont(JFaceResources.getTextFont());
    this.fileContentsViewer.getControl().setLayoutData(data);

    if (this.dataFileInfo != null) {
      for (String row : this.dataFileInfo.getCachedFirstLines()) {
        if (row != null) {
          this.fileContentsViewer.add(row);
        }
      }
    }

    // Add a Context Menu
    final MenuManager columnMenuManager = new MenuManager();
    this.fileContentsViewer.getControl().setMenu(columnMenuManager.createContextMenu(parent));
  }
Ejemplo n.º 16
0
  /**
   * Creates a table.
   *
   * @param panel parent composite.
   */
  private void createTable(Composite panel) {
    GridData gridData = new GridData(GridData.FILL_BOTH);
    gridData.grabExcessVerticalSpace = true;
    gridData.verticalSpan = VERTICAL_SPAN;
    gridData.heightHint = HEIGHT_HINT;
    gridData.horizontalSpan = 2;
    table =
        new Table(
            panel, SWT.SINGLE | SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL | SWT.FULL_SELECTION);
    table.setLayoutData(gridData);
    table.setHeaderVisible(true);

    TableColumn column = new TableColumn(table, SWT.CENTER, 0);
    column.setText(Messages.RequirementDialog_NameLabelText);
    column.setWidth(COLUMN_WIDTH_SELECT);

    column = new TableColumn(table, SWT.LEFT, 1);
    column.setText(Messages.RequirementDialog_DescriptionLabelText);
    column.setWidth(COLUMN_WIDTH_PARAMETER);

    // create a table viewer.
    tableViewer = new TableViewer(table);
    tableViewer.setUseHashlookup(true);
    tableViewer.setColumnProperties(
        new String[] {
          Messages.RequirementDialog_NameLabelText, Messages.RequirementDialog_DescriptionLabelText
        });

    tableViewer.setContentProvider(this);
    tableViewer.setLabelProvider(new RequirementLabeProvider());
    tableViewer.setInput(requirements);
  }
Ejemplo n.º 17
0
  public Section createControl(FormToolkit toolkit, Composite parent) {
    Section propSec = toolkit.createSection(parent, Section.TITLE_BAR | Section.EXPANDED);
    propSec.setText(_TITLE);

    // widgets
    Composite propSecCl = toolkit.createComposite(propSec, SWT.WRAP);
    Table propTable =
        toolkit.createTable(propSecCl, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
    selectButton = toolkit.createButton(propSecCl, "Select All", SWT.CHECK);
    selectButton.setSelection(false);
    verifyButton = toolkit.createButton(propSecCl, "Perform Verification", SWT.PUSH);

    // layout
    propSec.setClient(propSecCl);
    propSecCl.setLayout(new GridLayout(2, false));
    GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true, 2, 1);
    gd.heightHint = propTable.getItemHeight() * 3;
    propTable.setLayoutData(gd);
    verifyButton.setLayoutData(new GridData(SWT.END, SWT.CENTER, false, false));

    addListeners();
    makeViewer(propTable);
    makeVerifyAction();

    return propSec;
  }
  private void createSignaturePreview(Composite composite, RowLayouter layouter) {
    Label previewLabel = new Label(composite, SWT.NONE);
    previewLabel.setText(RefactoringMessages.ExtractMethodInputPage_signature_preview);
    layouter.perform(previewLabel);

    IPreferenceStore store = DartToolsPlugin.getDefault().getCombinedPreferenceStore();
    fSignaturePreview =
        new DartSourceViewer(
            composite,
            null,
            null,
            false,
            SWT.READ_ONLY | SWT.V_SCROLL | SWT.WRAP /*| SWT.BORDER*/,
            store);
    fSignaturePreview.configure(
        new DartSourceViewerConfiguration(
            DartToolsPlugin.getDefault().getDartTextTools().getColorManager(), store, null, null));
    fSignaturePreview
        .getTextWidget()
        .setFont(JFaceResources.getFont(PreferenceConstants.EDITOR_TEXT_FONT));
    fSignaturePreview.adaptBackgroundColor(composite);
    fSignaturePreview.setDocument(fSignaturePreviewDocument);
    fSignaturePreview.setEditable(false);

    Control signaturePreviewControl = fSignaturePreview.getControl();
    PixelConverter pixelConverter = new PixelConverter(signaturePreviewControl);
    GridData gdata = new GridData(GridData.FILL_BOTH);
    gdata.widthHint = pixelConverter.convertWidthInCharsToPixels(50);
    gdata.heightHint = pixelConverter.convertHeightInCharsToPixels(2);
    signaturePreviewControl.setLayoutData(gdata);
    layouter.perform(signaturePreviewControl);
  }
  @Override
  protected Control createDialogArea(Composite parent) {
    Composite composite = (Composite) super.createDialogArea(parent);
    routineViewer = new TreeViewer(composite);

    labelProvider = new ShowRoutineItemsLabelProvider(allRoutineItems, existedRoutinesRecord);

    routineViewer.setContentProvider(labelProvider);
    routineViewer.setLabelProvider(labelProvider);
    routineViewer.setInput(allRoutineItems);
    routineViewer.setFilters(
        new ViewerFilter[] {new ShowRoutineItemsViewerFilter(allRoutineItems, system)});
    GridData layoutData = new GridData(GridData.FILL_BOTH);
    layoutData.heightHint = 150;
    layoutData.widthHint = 200;
    routineViewer.getTree().setLayoutData(layoutData);

    routineViewer.addSelectionChangedListener(
        new ISelectionChangedListener() {

          public void selectionChanged(SelectionChangedEvent event) {
            updateButtons();
          }
        });
    return composite;
  }
Ejemplo n.º 20
0
  public BackBoard(Composite parent, int style) {
    super(parent, SWT.NONE);

    this.display = parent.getDisplay();

    GridLayout layout = new GridLayout();
    layout.marginWidth = 0;
    layout.marginHeight = 0;
    super.setLayout(layout);

    Composite back = new Composite(this, SWT.NONE);
    back.setBackground(display.getSystemColor(SWT.COLOR_WHITE));
    back.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, true));

    GridLayout backLayout = new GridLayout();
    backLayout.numColumns = 1;
    backLayout.verticalSpacing = 10;
    backLayout.marginWidth = 0;
    backLayout.marginHeight = 0;
    back.setLayout(backLayout);

    GridData titleBarGridData = new GridData(GridData.FILL, GridData.FILL, true, false);
    titleBarGridData.heightHint = 33;

    titleBar = new Canvas(back, SWT.NONE);
    titleBar.setLayoutData(titleBarGridData);
    titleBar.setBackgroundImage(
        Activator.getImageDescriptor("/icons/titleback.gif").createImage(display));

    backLayout = new GridLayout();
    backLayout.horizontalSpacing = 10;
    backLayout.marginWidth = 0;
    backLayout.marginHeight = 3;
    backLayout.marginRight = 10;
    titleBar.setLayout(backLayout);

    paintListener =
        new PaintListener() {
          public void paintControl(PaintEvent e) {
            if (e.widget == titleBar) {
              drawTitle(e);
            }
          }
        };

    titleBar.addPaintListener(paintListener);

    contents = new Composite(back, SWT.NONE);
    GridData contentsGridData = new GridData(GridData.FILL, GridData.FILL, true, true);
    contents.setBackground(display.getSystemColor(SWT.COLOR_WHITE));
    contents.setLayoutData(contentsGridData);

    GridData gridData = new GridData(GridData.FILL, GridData.FILL, true, true);
    gridData.horizontalAlignment = SWT.RIGHT;

    toolBar = new ToolBar(titleBar, SWT.FLAT);
    toolBar.setLayoutData(gridData);
    toolBar.setBackgroundImage(
        Activator.getImageDescriptor("/icons/titleback.gif").createImage(display));
  }
Ejemplo n.º 21
0
  @Override
  public void createPartControl(Composite parent) {
    if (engine == null) {
      init();
    }
    Display display = parent.getDisplay();
    fBackgroundColor = display.getSystemColor(SWT.COLOR_LIST_BACKGROUND);
    fForegroundColor = display.getSystemColor(SWT.COLOR_LIST_FOREGROUND);
    fSeparatorColor = ColorManager.getColor(152, 170, 203);

    fComposite = createComposite(parent);
    fComposite.setLayout(new GridLayout());

    createTitleLabel(fComposite, Messages.getString("ReportDocumentEditor.1")); // $NON-NLS-1$
    createLabel(fComposite, null);
    createLabel(fComposite, null);

    createHeadingLabel(fComposite, Messages.getString("ReportDocumentEditor.2")); // $NON-NLS-1$

    Composite separator = createCompositeSeparator(fComposite);
    GridData data = new GridData(GridData.FILL_HORIZONTAL);
    data.heightHint = 2;
    separator.setLayoutData(data);

    createInfomation(fComposite);
  }
Ejemplo n.º 22
0
  @Override
  protected void addToMainPage(Composite container) {
    remoteServices = new Group(container, SWT.SHADOW_IN);
    remoteServices.setText(
        Messages.getString("WizardProjectConversion.servicesTableLabel")); // $NON-NLS-1$
    remoteServices.setLayout(new FillLayout());
    GridData data = new GridData(SWT.FILL, SWT.FILL, true, true);
    data.heightHint = 350;
    remoteServices.setLayoutData(data);

    fServiceModelWidget = new ServiceProviderConfigurationWidget(remoteServices, SWT.NONE);
    tableViewer.addSelectionChangedListener(
        new ISelectionChangedListener() {
          public void selectionChanged(SelectionChangedEvent e) {
            IProject project =
                (IProject) ((IStructuredSelection) e.getSelection()).getFirstElement();
            if (project != null) {
              changeProject(project);
            }
          }
        });
    tableViewer.addCheckStateListener(
        new ICheckStateListener() {
          public void checkStateChanged(CheckStateChangedEvent e) {
            IProject project = (IProject) e.getElement();
            if (e.getChecked() && project != null) {
              changeProject(project);
            }
          }
        });
    Shell shell = getContainer().getShell();
    PlatformUI.getWorkbench()
        .getHelpSystem()
        .setHelp(shell, RDTHelpContextIds.CONVERTING_TO_REMOTE_PROJECT);
  }
Ejemplo n.º 23
0
  public static void main(String[] args) {
    final Display display = new Display();
    final Shell shell = new Shell(display);
    shell.setText("SWT and Swing DND Example");
    GridLayout layout = new GridLayout(1, false);
    shell.setLayout(layout);

    Text swtText = new Text(shell, SWT.BORDER);
    swtText.setText("SWT Text");
    GridData data = new GridData(GridData.FILL_HORIZONTAL);
    swtText.setLayoutData(data);
    setDragDrop(swtText);

    Composite comp = new Composite(shell, SWT.EMBEDDED);
    java.awt.Frame frame = SWT_AWT.new_Frame(comp);
    JTextField swingText = new JTextField(40);
    swingText.setText("Swing Text");
    swingText.setDragEnabled(true);
    frame.add(swingText);
    data = new GridData(GridData.FILL_HORIZONTAL);
    data.heightHint = swingText.getPreferredSize().height;
    comp.setLayoutData(data);

    shell.setSize(400, 200);
    shell.open();
    while (!shell.isDisposed()) {
      if (!display.readAndDispatch()) display.sleep();
    }
    display.dispose();
  }
  @Override
  protected Control createContents(Composite p) {
    Composite parent = (Composite) super.createContents(p);

    Label scriptLabel = new Label(parent, SWT.NONE);
    String headerMessages = getHeaderMessages();
    scriptLabel.setText(headerMessages);
    // FIXME, If the message can't be displayed complectly. try to set the tool tip
    if (headerMessages.length() > 50) { // simply first, just set the length greater than 50
      scriptLabel.setToolTipText(headerMessages);
    }

    int style = SWT.MULTI | SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL;
    if (isReadonly()) {
      style |= SWT.READ_ONLY;
    }
    scriptTxt = new StyledText(parent, style);
    GridData layoutData = new GridData(GridData.FILL_BOTH);
    layoutData.heightHint = 280;
    layoutData.minimumHeight = 280;
    layoutData.widthHint = 500;
    layoutData.minimumWidth = 500;
    scriptTxt.setLayoutData(layoutData);
    scriptTxt.setText(getScriptContent());

    return parent;
  }
  private Composite createAvailableList(Composite parent) {
    Composite container = new Composite(parent, SWT.NONE);
    GridLayout layout = new GridLayout();
    layout.marginWidth = 0;
    layout.marginHeight = 0;
    container.setLayout(layout);
    container.setLayoutData(new GridData());

    Label label = new Label(container, SWT.NONE);
    label.setText(PDEUIMessages.ImportWizard_DetailedPage_availableList);

    Table table = new Table(container, SWT.BORDER | SWT.MULTI | SWT.V_SCROLL);
    GridData gd = new GridData(GridData.FILL_BOTH);
    gd.heightHint = 200;
    gd.widthHint = 225;
    table.setLayoutData(gd);

    fAvailableListViewer = new TableViewer(table);
    fAvailableListViewer.setLabelProvider(new PluginImportLabelProvider());
    fAvailableListViewer.setContentProvider(new ContentProvider());
    fAvailableListViewer.setInput(PDECore.getDefault().getModelManager());
    fAvailableListViewer.setComparator(ListUtil.PLUGIN_COMPARATOR);

    return container;
  }
  /**
   * @param parent
   * @param style
   */
  public ResourceAdaptorConfigPropertiesPanel(Composite parent, int style) {
    super(parent, style);

    GridLayout layout = new GridLayout();
    layout.numColumns = 1;
    setLayout(layout);

    /*
     *  ----------------------------
     *  |Name : Type : Default| Add|
     *  |                     | Rem|
     *  |                     |    |
     *  |                     |    |
     *  |                     |    |
     *  ----------------------------
     *  | x Support active reconf  |
     *  ----------------------------
     */

    tablePanel = new EditableTablePanel(this, SWT.BORDER, COLUMNS, EDITORS, VALUES);
    GridData data =
        new GridData(GridData.FILL_BOTH | GridData.GRAB_HORIZONTAL | GridData.GRAB_VERTICAL);
    // Makes it look good on the edit...
    data.widthHint = 420;
    data.heightHint = 160;
    tablePanel.setLayoutData(data);

    // Support active reconfig check button
    activeReconfigButton = new Button(this, SWT.CHECK);
    activeReconfigButton.setText("This Resource Adaptor supports active &reconfiguration");
    data = new GridData(GridData.FILL_HORIZONTAL | GridData.GRAB_HORIZONTAL);
    activeReconfigButton.setLayoutData(data);
  }
  /**
   * @param parent
   * @return
   */
  public Control createContents(Composite parent) {
    final FormToolkit toolkit = new FormToolkit(parent.getDisplay());
    ScrolledForm sf = toolkit.createScrolledForm(parent);
    Composite comp = sf.getForm().getBody();
    comp.setLayout(new GridLayout(1, true));
    comp.setBackground(parent.getBackground());

    Section brandSection = toolkit.createSection(comp, Section.TITLE_BAR);
    GridData gridData = new GridData(GridData.FILL_HORIZONTAL);
    brandSection.setLayoutData(gridData);
    brandSection.setText("Supported Interaction Types");

    Table table = new Table(comp, SWT.BORDER | SWT.FULL_SELECTION | SWT.CHECK | SWT.SINGLE);
    table.setHeaderVisible(true);
    TableLayout layout = new TableLayout();
    layout.addColumnData(new ColumnWeightData(1));
    table.setLayout(layout);
    TableColumn column = new TableColumn(table, SWT.NONE);
    column.setText("Interaction Type");
    column.setWidth(100);
    column.setResizable(true);
    GridData gd = new GridData(GridData.FILL_HORIZONTAL);
    gd.heightHint = 200;
    table.setLayoutData(gd);

    viewer = new CheckboxTableViewer(table);
    viewer.setContentProvider(new InteractionTypeContentProvider());
    InteractionTypeLabelProvider labelProvider = new InteractionTypeLabelProvider();
    viewer.setLabelProvider(labelProvider);
    viewer.setCheckStateProvider(labelProvider);
    viewer.addCheckStateListener(this);
    viewer.setInput(this);

    return comp;
  }
    private TableViewer buildTableViewer(Composite parent, ArrayList<String> tableDataModel) {

      TableLayoutComposite tableLayout = new TableLayoutComposite(parent, SWT.NONE);
      this.addColumnsData(tableLayout);

      final Table table =
          new Table(
              tableLayout,
              SWT.H_SCROLL | SWT.V_SCROLL | SWT.SINGLE | SWT.FULL_SELECTION | SWT.BORDER);
      table.setLinesVisible(false);

      TableColumn column = new TableColumn(table, SWT.NONE, 0);
      column.setResizable(true);

      GridData gridData = new GridData(GridData.FILL_BOTH);
      gridData.horizontalSpan = 1;
      gridData.heightHint = TableTools.calculateHeightHint(table, 7);
      tableLayout.setLayoutData(gridData);

      TableViewer tableViewer = new TableViewer(table);
      tableViewer.setUseHashlookup(true);
      tableViewer.setLabelProvider(this.buildLabelProvider());
      tableViewer.setContentProvider(this.buildContentProvider());

      tableViewer.setInput(tableDataModel);
      tableViewer.refresh();
      return tableViewer;
    }
Ejemplo n.º 29
0
  /** @see org.eclipse.jface.dialogs.IDialogPage#createControl(Composite) */
  public void createControl(Composite parent) {
    Composite composite = createGridLayoutComposite(parent, 1);

    publishConfigRadioButton =
        createRadioButton(composite, PublishingUIResources.publishConfigRadioButton_text, 1, true);

    publishProcessesRadioButton =
        createRadioButton(
            composite, PublishingUIResources.publishProcessesRadioButton_text, 1, false);

    Composite processComposite = createChildGridLayoutComposite(composite, 1);

    processViewer = new CheckboxTreeViewer(processComposite);
    GridData gridData = new GridData(GridData.FILL_BOTH | GridData.GRAB_HORIZONTAL);
    gridData.heightHint = 300;
    processViewer.getTree().setLayoutData(gridData);
    //		processViewer.setContentProvider(new ProcessViewerContentProvider());
    processViewer.setLabelProvider(new ProcessTreeLabelProvider());

    includeBaseProcessesCheckbox =
        createCheckbox(
            processComposite, PublishingUIResources.includeBaseProcessesCheckboxLabel_text);

    initControls();

    addListeners();

    setControl(composite);
  }
Ejemplo n.º 30
0
  @Override
  public void createControl(Composite parent) {
    initializeDialogUnits(parent);
    readConfiguration();

    Composite result = new Composite(parent, SWT.NONE);
    result.setFont(parent.getFont());
    GridLayout layout = new GridLayout(2, false);
    result.setLayout(layout);

    addTextPatternControls(result);

    Label separator = new Label(result, SWT.NONE);
    separator.setVisible(false);
    GridData data = new GridData(GridData.FILL, GridData.FILL, false, false, 2, 1);
    data.heightHint = convertHeightInCharsToPixels(1) / 3;
    separator.setLayoutData(data);

    addFileNameControls(result);

    setControl(result);
    Dialog.applyDialogFont(result);
    PlatformUI.getWorkbench()
        .getHelpSystem()
        .setHelp(result, ISearchHelpContextIds.TEXT_SEARCH_PAGE);
  }