예제 #1
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));
  }
예제 #2
0
  public void createPartControl(Composite parent) {
    Composite top = new Composite(parent, SWT.NONE);
    GridLayout layout = new GridLayout();
    layout.marginHeight = 0;
    layout.marginWidth = 0;
    top.setLayout(layout);
    // top banner
    Composite banner = new Composite(top, SWT.NONE);
    banner.setLayoutData(
        new GridData(
            GridData.HORIZONTAL_ALIGN_FILL, GridData.VERTICAL_ALIGN_BEGINNING, true, false));
    layout = new GridLayout();
    layout.marginHeight = 5;
    layout.marginWidth = 10;
    layout.numColumns = 2;
    banner.setLayout(layout);

    // setup bold font
    Font boldFont = JFaceResources.getFontRegistry().getBold(JFaceResources.DEFAULT_FONT);

    Label l = new Label(banner, SWT.WRAP);
    l.setText("Subject:");
    l.setFont(boldFont);
    l = new Label(banner, SWT.WRAP);
    l.setText("This is a message about the cool Eclipse RCP!");

    l = new Label(banner, SWT.WRAP);
    l.setText("From:");
    l.setFont(boldFont);

    final Link link = new Link(banner, SWT.NONE);
    link.setText("<a>[email protected]</a>");
    link.addSelectionListener(
        new SelectionAdapter() {
          public void widgetSelected(SelectionEvent e) {
            MessageDialog.openInformation(
                getSite().getShell(),
                "Not Implemented",
                "Imagine the address book or a new message being created now.");
          }
        });

    l = new Label(banner, SWT.WRAP);
    l.setText("Date:");
    l.setFont(boldFont);
    l = new Label(banner, SWT.WRAP);
    l.setText("10:34 am");
    // message contents
    Text text = new Text(top, SWT.MULTI | SWT.WRAP);
    text.setText(
        "This RCP Application was generated from the PDE Plug-in Project wizard. This sample shows how to:\n"
            + "- add a top-level menu and toolbar with actions\n"
            + "- add keybindings to actions\n"
            + "- create views that can't be closed and\n"
            + "  multiple instances of the same view\n"
            + "- perspectives with placeholders for new views\n"
            + "- use the default about dialog\n"
            + "- create a product definition\n");
    text.setLayoutData(new GridData(GridData.FILL_BOTH));
  }
  /* (non-Javadoc)
   * @see org.eclipse.jface.dialogs.IconAndMessageDialog#createMessageArea(org.eclipse.swt.widgets.Composite)
   */
  @Override
  protected Control createMessageArea(Composite parent) {
    initializeDialogUnits(parent);

    Composite messageComposite = new Composite(parent, SWT.NONE);
    messageComposite.setFont(parent.getFont());
    GridLayout layout = new GridLayout();
    layout.numColumns = 1;
    layout.marginHeight = 0;
    layout.marginWidth = 0;
    layout.verticalSpacing = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING);
    layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
    messageComposite.setLayout(layout);
    messageComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));

    createLinkControl(messageComposite);

    int indent = convertWidthInCharsToPixels(3);

    fNotSortAllRadio.doFillIntoGrid(messageComposite, 1);
    LayoutUtil.setHorizontalIndent(fNotSortAllRadio.getSelectionButton(null), indent);

    fSortAllRadio.doFillIntoGrid(messageComposite, 1);
    LayoutUtil.setHorizontalIndent(fSortAllRadio.getSelectionButton(null), indent);

    final Composite warningComposite = new Composite(messageComposite, SWT.NONE);
    layout = new GridLayout();
    layout.numColumns = 2;
    layout.marginWidth = 0;
    layout.marginHeight = 0;
    warningComposite.setLayout(layout);
    warningComposite.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false));
    warningComposite.setFont(messageComposite.getFont());

    Image image = Dialog.getImage(Dialog.DLG_IMG_MESSAGE_WARNING);
    final Label imageLabel1 = new Label(warningComposite, SWT.LEFT | SWT.WRAP);
    imageLabel1.setImage(image);
    imageLabel1.setLayoutData(
        new GridData(GridData.BEGINNING, GridData.CENTER, false, false, 1, 1));

    final Label label = new Label(warningComposite, SWT.WRAP);
    label.setText(DialogsMessages.SortMembersMessageDialog_sort_warning_label);
    GridData gridData = new GridData(GridData.FILL, GridData.CENTER, true, false, 1, 1);
    gridData.widthHint = convertHorizontalDLUsToPixels(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH);
    label.setLayoutData(gridData);
    label.setFont(warningComposite.getFont());

    fNotSortAllRadio.setDialogFieldListener(
        new IDialogFieldListener() {
          public void dialogFieldChanged(DialogField field) {
            imageLabel1.setEnabled(!fNotSortAllRadio.isSelected());
            label.setEnabled(!fNotSortAllRadio.isSelected());
          }
        });
    imageLabel1.setEnabled(!fNotSortAllRadio.isSelected());
    label.setEnabled(!fNotSortAllRadio.isSelected());

    return messageComposite;
  }
  /**
   * Creates and returns the source lookup control.
   *
   * @param parent the parent widget of this control
   */
  public Control createControl(Composite parent) {
    Font font = parent.getFont();

    Composite comp = new Composite(parent, SWT.NONE);
    GridLayout topLayout = new GridLayout();
    topLayout.numColumns = 2;
    topLayout.marginHeight = 0;
    topLayout.marginWidth = 0;
    comp.setLayout(topLayout);
    GridData gd = new GridData(GridData.FILL_BOTH);
    comp.setLayoutData(gd);

    fVariablesViewer = new TreeViewer(comp);
    gd = new GridData(GridData.FILL_BOTH);
    gd.heightHint = 6;
    fVariablesViewer.getControl().setLayoutData(gd);
    fEnvironmentVariablesContentProvider = new EnvironmentVariableContentProvider();
    fVariablesViewer.setContentProvider(fEnvironmentVariablesContentProvider);
    fVariablesViewer.setLabelProvider(getLabelProvider());
    fVariablesViewer.setInput(this);
    fVariablesViewer.addSelectionChangedListener(this);

    Composite pathButtonComp = new Composite(comp, SWT.NONE);
    GridLayout pathButtonLayout = new GridLayout();
    pathButtonLayout.marginHeight = 0;
    pathButtonLayout.marginWidth = 0;
    pathButtonComp.setLayout(pathButtonLayout);
    gd = new GridData(GridData.VERTICAL_ALIGN_BEGINNING | GridData.HORIZONTAL_ALIGN_FILL);
    pathButtonComp.setLayoutData(gd);
    pathButtonComp.setFont(font);

    fAddButton =
        createPushButton(
            pathButtonComp, InterpretersMessages.AbstractInterpreterEnvironmentVariablesBlock_add);
    fAddButton.addSelectionListener(this);

    fAddExistedButton =
        createPushButton(
            pathButtonComp,
            InterpretersMessages.AbstractInterpreterEnvironmentVariablesBlock_addFromEnvironment);
    fAddExistedButton.addSelectionListener(this);
    fEditButton =
        createPushButton(
            pathButtonComp, InterpretersMessages.AbstractInterpreterEnvironmentVariablesBlock_edit);
    fEditButton.addSelectionListener(this);

    fRemoveButton =
        createPushButton(pathButtonComp, InterpretersMessages.InterpreterLibraryBlock_6);
    fRemoveButton.addSelectionListener(this);

    fImportButton = createPushButton(pathButtonComp, "Import...");
    fImportButton.addSelectionListener(this);

    fExportButton = createPushButton(pathButtonComp, "Export...");
    fExportButton.addSelectionListener(this);

    return comp;
  }
예제 #5
0
  /* (non-Javadoc)
   * @see org.unitarou.swt.WidgetContainer#createContents(org.eclipse.swt.widgets.Composite)
   */
  public Control createContents(Composite parent) {
    ArgumentChecker.throwIfNull(parent);

    GridLayout layout;
    frame_ = new Composite(parent, SWT.NONE);
    switch (alignment_) {
      case TOP:
        layout = new GridLayout(1, true);
        layout.marginWidth = 2;
        layout.marginHeight = 2;
        frame_.setLayout(layout);
        annotationLabel_ = new Label(frame_, SWT.WRAP);
        annotationLabel_.setLayoutData(new GridData(SWT.CENTER, SWT.BOTTOM, true, true));
        boardControl_ = digestIgoBoardPanel_.createContents(frame_);
        boardControl_.setLayoutData(new GridData(SWT.CENTER, SWT.TOP, true, true));
        break;

      case BOTTOM:
        layout = new GridLayout(1, true);
        layout.marginWidth = 2;
        layout.marginHeight = 2;
        frame_.setLayout(layout);
        boardControl_ = digestIgoBoardPanel_.createContents(frame_);
        boardControl_.setLayoutData(new GridData(SWT.CENTER, SWT.FILL, true, false));
        annotationLabel_ = new Label(frame_, SWT.WRAP);
        annotationLabel_.setLayoutData(new GridData(SWT.CENTER, SWT.TOP, true, true));
        break;

      case LEFT:
        layout = new GridLayout(2, false);
        layout.marginWidth = 2;
        layout.marginHeight = 2;
        frame_.setLayout(layout);
        boardControl_ = digestIgoBoardPanel_.createContents(frame_);
        boardControl_.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, true, true));
        annotationLabel_ = new Label(frame_, SWT.WRAP);
        annotationLabel_.setLayoutData(new GridData(SWT.RIGHT, SWT.TOP, true, true));
        break;

      case RIGHT:
        layout = new GridLayout(2, false);
        layout.marginWidth = 2;
        layout.marginHeight = 2;
        frame_.setLayout(layout);
        annotationLabel_ = new Label(frame_, SWT.WRAP);
        annotationLabel_.setLayoutData(new GridData(SWT.LEFT, SWT.TOP, true, true));
        boardControl_ = digestIgoBoardPanel_.createContents(frame_);
        boardControl_.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, true, true));
        break;

      default:
        assert false : "Unknown alignment type :" + alignment_; // $NON-NLS-1$
    }
    return frame_;
  }
예제 #6
0
 /** Initialize a grid layout with the default Dialog settings. */
 public GridLayout initGridLayout(GridLayout layout, boolean margins) {
   layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
   if (margins) {
     layout.marginWidth = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN);
     layout.marginHeight = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN);
   } else {
     layout.marginWidth = 0;
     layout.marginHeight = 0;
   }
   return layout;
 }
예제 #7
0
  Composite createControl(final Composite parent, final PreferencePage prefParent) {
    Composite composite = new Composite(parent, SWT.NONE);
    Font parentFont = parent.getFont();

    GridLayout glayout = new GridLayout(2, false);
    glayout.marginHeight = 0;
    glayout.marginWidth = 0;
    composite.setLayout(glayout);
    composite.setFont(parentFont);

    Label tableLabel = new Label(composite, SWT.NONE);
    tableLabel.setText(UITexts.cabalImplsBlock_installed);
    GridData gdata = new GridData(SWT.FILL, SWT.TOP, true, false);
    gdata.horizontalSpan = 2;
    tableLabel.setLayoutData(gdata);
    tableLabel.setFont(parentFont);

    Composite tableComposite = new Composite(composite, SWT.NONE);
    tableComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));

    table = SWTUtil.createTable(tableComposite);
    createColumns(tableComposite);
    createViewer();

    // Deep copy the implementations, replace them later.
    CabalImplementationManager cMgr = CabalImplementationManager.getInstance();
    impls.clear();
    for (CabalImplementation impl : cMgr.getCabalImplementations()) {
      impls.add(new CabalImplementation(impl));
    }

    viewer.setInput(impls);

    // And set the current default (checked) implementation
    CabalImplementation defImpl = cMgr.getDefaultCabalImplementation();
    if (defImpl != null) {
      CabalImplementation impl = findImplementation(defImpl.getUserIdentifier());
      setCheckedCabalImplementation(impl);
    }

    Composite buttonsComp = new Composite(composite, SWT.NONE);

    glayout = new GridLayout(1, true);
    glayout.marginHeight = 0;
    glayout.marginWidth = 0;
    buttonsComp.setLayout(glayout);
    buttonsComp.setLayoutData(new GridData(SWT.CENTER, SWT.TOP, false, false));
    buttonsComp.setFont(parentFont);
    createButtons(buttonsComp);
    enableButtons();

    return composite;
  }
  /** Creates the widgets that display the target order */
  private void createTaskList(Composite parent) {
    Font font = parent.getFont();

    Label label = new Label(parent, SWT.NONE);
    label.setText("Task execution order:");
    label.setFont(font);

    Composite orderComposite = new Composite(parent, SWT.NONE);
    GridData gd = new GridData(GridData.FILL_HORIZONTAL);
    orderComposite.setLayoutData(gd);
    GridLayout layout = new GridLayout(2, false);
    layout.marginHeight = 0;
    layout.marginWidth = 0;
    orderComposite.setLayout(layout);
    orderComposite.setFont(font);

    taskOrderText =
        new Text(orderComposite, SWT.MULTI | SWT.WRAP | SWT.BORDER | SWT.V_SCROLL | SWT.READ_ONLY);
    taskOrderText.setFont(font);
    gd = new GridData(GridData.FILL_HORIZONTAL | GridData.FILL_VERTICAL);
    gd.heightHint = 40;
    gd.widthHint = IDialogConstants.ENTRY_FIELD_WIDTH;
    taskOrderText.setLayoutData(gd);

    Composite buttonColumn = new Composite(orderComposite, SWT.NONE);
    layout = new GridLayout(1, false);
    layout.marginHeight = 0;
    layout.marginWidth = 0;
    buttonColumn.setLayout(layout);
    buttonColumn.setFont(font);

    orderButton = createPushButton(buttonColumn, "Order...", null);
    gd = (GridData) orderButton.getLayoutData();
    gd.verticalAlignment = GridData.BEGINNING;
    orderButton.setFont(font);
    orderButton.addSelectionListener(
        new SelectionAdapter() {
          public void widgetSelected(SelectionEvent e) {
            handleOrderPressed();
          }
        });
    clearButton = createPushButton(buttonColumn, "Clear", null);
    gd = (GridData) orderButton.getLayoutData();
    gd.verticalAlignment = GridData.BEGINNING;
    clearButton.setFont(font);
    clearButton.addSelectionListener(
        new SelectionAdapter() {
          public void widgetSelected(SelectionEvent e) {
            handleClearPressed();
          }
        });
    updateOrderedTargets();
  }
예제 #9
0
  /**
   * Creates an area to filter types.
   *
   * @param parent area to create controls in
   */
  private void createTypeFilterArea(Composite parent) {
    createLabel(parent, TypeInfoMessages.TypeSelectionDialog_filterLabel);

    Composite upperRow = new Composite(parent, SWT.NONE);
    int columns = fKnownTypes.size() > 6 ? 4 : 3;
    GridLayout upperLayout = new GridLayout(columns, true);
    upperLayout.verticalSpacing = 2;
    upperLayout.marginHeight = 0;
    upperLayout.marginWidth = 0;
    upperRow.setLayout(upperLayout);

    // The 'for' loop is here to guarantee that we always create the checkboxes in the same order.
    for (int i = 0; i < ALL_TYPES.length; ++i) {
      Integer typeObject = new Integer(ALL_TYPES[i]);
      if (fKnownTypes.contains(typeObject)) createTypeCheckbox(upperRow, typeObject);
    }

    if (showLowLevelFilter()) {
      Composite lowerRow = new Composite(parent, SWT.NONE);
      GridLayout lowerLayout = new GridLayout(1, true);
      lowerLayout.verticalSpacing = 2;
      lowerLayout.marginHeight = 0;
      upperLayout.marginWidth = 0;
      lowerRow.setLayout(lowerLayout);

      Composite composite = new Composite(lowerRow, SWT.NONE);
      GridLayout layout = new GridLayout(2, false);
      layout.marginHeight = 0;
      layout.marginWidth = 0;
      composite.setLayout(layout);

      String name = TypeInfoMessages.TypeSelectionDialog_filterLowLevelTypes;
      Button checkbox = new Button(composite, SWT.CHECK);
      checkbox.setFont(composite.getFont());
      checkbox.setText(name);
      checkbox.setSelection(fFilterMatcher.getShowLowLevelTypes());
      checkbox.addSelectionListener(
          new SelectionAdapter() {
            @Override
            public void widgetSelected(SelectionEvent e) {
              if (e.widget instanceof Button) {
                Button button = (Button) e.widget;
                fFilterMatcher.setShowLowLevelTypes(button.getSelection());
                updateElements();
              }
            }
          });
    }
  }
예제 #10
0
  public SpinnerFieldEditor(
      String name,
      String labelText,
      Composite parent,
      int min,
      int max,
      int increment,
      int pageIncrement) {
    init(name, labelText);

    GridLayout layout = new GridLayout();
    layout.numColumns = getNumberOfControls();
    layout.marginWidth = 0;
    layout.marginHeight = 0;
    layout.horizontalSpacing = HORIZONTAL_GAP;
    parent.setLayout(layout);

    // create label control
    getLabelControl(parent);

    spinner = new BigDecimalSpinner(parent, SWT.NONE, 0, min, max, increment, pageIncrement);

    spinner.addSelectionListener(
        new SelectionAdapter() {
          @Override
          public void widgetSelected(SelectionEvent event) {
            valueChanged();
          }
        });

    doFillIntoGrid(parent, layout.numColumns);
  }
 public QualifiedNameComponent(
     Composite parent,
     int style,
     final IQualifiedNameUpdating refactoring,
     IDialogSettings settings) {
   super(parent, style);
   GridLayout layout = new GridLayout();
   layout.marginWidth = 0;
   layout.marginHeight = 0;
   layout.numColumns = 2;
   setLayout(layout);
   Label label = new Label(this, SWT.NONE);
   label.setText(RefactoringMessages.QualifiedNameComponent_patterns_label);
   fPatterns = new Text(this, SWT.BORDER);
   fPatterns.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
   label = new Label(this, SWT.NONE);
   label.setText(RefactoringMessages.QualifiedNameComponent_patterns_description);
   GridData gd = new GridData(GridData.FILL_HORIZONTAL);
   gd.horizontalSpan = 2;
   label.setLayoutData(gd);
   String text = refactoring.getFilePatterns();
   if (text == null) text = settings.get(PATTERNS);
   if (text != null) {
     fPatterns.setText(text);
     refactoring.setFilePatterns(text);
   }
   fPatterns.addModifyListener(
       new ModifyListener() {
         public void modifyText(ModifyEvent e) {
           refactoring.setFilePatterns(fPatterns.getText());
         }
       });
 }
  @Override
  protected Control createTreeAreaContents(Composite parent) {
    Composite leftArea = new Composite(parent, SWT.NONE);
    leftArea.setBackground(parent.getDisplay().getSystemColor(SWT.COLOR_LIST_BACKGROUND));
    leftArea.setFont(parent.getFont());
    GridLayout leftLayout = new GridLayout();
    leftLayout.numColumns = 1;
    leftLayout.marginHeight = 0;
    leftLayout.marginTop = IDialogConstants.VERTICAL_MARGIN;
    leftLayout.marginWidth = IDialogConstants.HORIZONTAL_MARGIN;
    leftLayout.horizontalSpacing = 0;
    leftLayout.verticalSpacing = 0;
    leftArea.setLayout(leftLayout);

    // Build the tree an put it into the composite.
    TreeViewer viewer = createTreeViewer(leftArea);
    setTreeViewer(viewer);

    updateTreeFont(JFaceResources.getDialogFont());
    GridData viewerData = new GridData(GridData.FILL_BOTH | GridData.GRAB_VERTICAL);
    viewer.getControl().getParent().setLayoutData(viewerData);

    layoutTreeAreaControl(leftArea);

    return leftArea;
  }
  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;
  }
  protected Control createListChangeControl(Composite parent) {
    GridData gd;
    Control control;
    if (composite == null) composite = new Composite(parent, SWT.NONE);
    composite.setBackground(parent.getBackground());
    GridLayout gridLayout = new GridLayout(3, false);
    gridLayout.marginHeight = 0;
    gridLayout.marginWidth = 0;
    gridLayout.horizontalSpacing = 0;
    gridLayout.verticalSpacing = 0;
    composite.setLayout(gridLayout);

    Control listControl = createListControl(composite);
    gd = new GridData(GridData.FILL_BOTH);
    listControl.setLayoutData(gd);

    control = new Label(composite, SWT.NONE);
    control.setBackground(parent.getBackground());
    gd = new GridData();
    gd.widthHint = 5;
    control.setLayoutData(gd);

    control = getChangeControl(composite);

    return composite;
  }
  /** create dialog area for the user permission dialog */
  protected Control createDialogArea(final Composite parent) {
    parent
        .getShell()
        .setText(
            "Permissions for "
                + regResourceNode.getConnectionInfo().getUrl().toString()
                + regResourceNode.getRegistryResourcePath());

    GridLayout gridLayout = new GridLayout(1, true);
    gridLayout.marginWidth = 5;
    parent.setLayout(gridLayout);

    Group group = new Group(parent, SWT.FILL);
    group.setLayoutData(new GridData(GridData.FILL_BOTH));
    gridLayout = new GridLayout(1, true);
    group.setLayout(gridLayout);

    createTable(group);
    try {
      loadData();
    } catch (RemoteException e) {
      log.error(e);
    } catch (Exception e) {
      log.error(e);
    }

    return super.createDialogArea(parent);
  }
 /* (non-Javadoc)
  * @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite)
  */
 protected Control createDialogArea(Composite parent) {
   getShell().setText(Messages.getString("dialogs.OrganizeTestTextDialog.title")); // $NON-NLS-1$
   // create a composite with standard margins and spacing
   Composite composite = new Composite(parent, SWT.NONE | SWT.RESIZE);
   GridLayout layout = new GridLayout();
   layout.marginHeight = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN);
   layout.marginWidth = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN);
   layout.verticalSpacing = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING);
   layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
   layout.numColumns = 2;
   composite.setLayout(layout);
   composite.setLayoutData(new GridData(GridData.FILL_BOTH));
   applyDialogFont(composite);
   switch (type) {
     case TYPE_SAVE:
       return createDialogAreaContentsForSave(composite);
     case TYPE_LOAD:
       return createDialogAreaContentsForLoad(composite);
     case TYPE_ORGANIZE:
       return createDialogAreaContentsForOrganize(composite);
     default:
       throw new IllegalStateException(
           Messages.getString("dialogs.OrganizeTestTextDialog.errror.message1")
               + type); //$NON-NLS-1$
   }
 }
예제 #17
0
  /** (non-Javadoc) Method declared on IDialogPage. */
  public void createControl(Composite parent) {
    initializeDialogUnits(parent);
    Composite fileSelectionArea = new Composite(parent, SWT.NONE);
    GridData fileSelectionData = new GridData(GridData.GRAB_HORIZONTAL | GridData.FILL_HORIZONTAL);
    fileSelectionArea.setLayoutData(fileSelectionData);

    GridLayout fileSelectionLayout = new GridLayout();
    fileSelectionLayout.numColumns = 1;
    fileSelectionLayout.makeColumnsEqualWidth = false;
    fileSelectionLayout.marginWidth = 0;
    fileSelectionLayout.marginHeight = 0;
    fileSelectionArea.setLayout(fileSelectionLayout);

    editor =
        new FileFieldEditor(
            "fileSelect", "Select File: ", fileSelectionArea); // NON-NLS-1 //NON-NLS-2
    String[] extensions = new String[] {"*.xml"}; // NON-NLS-1
    editor.setFileExtensions(extensions);
    editor
        .getTextControl(fileSelectionArea)
        .addModifyListener(
            new ModifyListener() {
              public void modifyText(ModifyEvent e) {
                setPageComplete(validatePage());
              }
            });
    fileSelectionArea.moveAbove(null);

    // Show description on opening
    setErrorMessage(null);
    setMessage(null);
    setControl(parent);
    setPageComplete(validatePage());
  }
예제 #18
0
 /**
  * Constructs a new filtered list.
  *
  * @param parent the parent composite
  * @param style the widget style
  * @param labelProvider the label renderer
  * @param ignoreCase specifies whether sorting and folding is case sensitive
  * @param allowDuplicates specifies whether folding of duplicates is desired
  * @param matchEmptyString specifies whether empty filter strings should filter everything or
  *     nothing
  */
 public HistoryFilteredList(
     Composite parent,
     int style,
     ILabelProvider labelProvider,
     boolean ignoreCase,
     boolean allowDuplicates,
     boolean matchEmptyString) {
   super(parent, SWT.NONE);
   GridLayout layout = new GridLayout();
   layout.marginHeight = 0;
   layout.marginWidth = 0;
   setLayout(layout);
   fList = new Table(this, style);
   fList.setLayoutData(new GridData(GridData.FILL_BOTH));
   fList.setFont(parent.getFont());
   fList.addDisposeListener(
       new DisposeListener() {
         @Override
         public void widgetDisposed(DisposeEvent e) {
           fLabelProvider.dispose();
           if (fUpdateJob != null) {
             fUpdateJob.cancel();
           }
         }
       });
   fLabelProvider = labelProvider;
   fIgnoreCase = ignoreCase;
   fAllowDuplicates = allowDuplicates;
   fMatchEmptyString = matchEmptyString;
 }
예제 #19
0
  protected Control createContents(Composite parent) {
    noDefaultAndApplyButton();

    setDescription(
        "Enabled entries in the mapping table below will be used to convert Resource URIs into actual URI locations (eg URLs)");
    //        setMessage("Enabled entries in the mapping table below will be used to convert
    // Resource URIs into actual URI locations (eg URLs)");

    GridData gridData = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.FILL_BOTH);
    parent.setLayoutData(gridData);

    // Set numColumns to 2 for the buttons
    GridLayout layout = new GridLayout(2, false);
    layout.marginWidth = 4;
    parent.setLayout(layout);

    // Create the table
    createTable(parent);

    // Create and setup the TableViewer
    createTableViewer();
    tableViewer.setContentProvider(new MapListContentProvider());
    tableViewer.setLabelProvider(new MapListLabelProvider());
    mapList
        .getMaps()
        .addAll(
            TefkatPlugin.convertFromString(
                getPreferenceStore().getString(TefkatPlugin.URIMAP_PREFERENCE)));
    tableViewer.setInput(mapList);

    createButtons(parent);

    return null;
  }
예제 #20
0
  /* (non-Javadoc)
   * @see org.eclipse.jface.preference.PreferencePage#createContents(org.eclipse.swt.widgets.Composite)
   */
  @Override
  protected Control createContents(Composite parent) {
    Composite content = new Composite(parent, SWT.NONE);
    GridLayout gridLayout = new GridLayout(2, false);
    gridLayout.marginWidth = gridLayout.marginHeight = 0;
    content.setLayout(gridLayout);
    initializeDialogUnits(content);

    Label label = new Label(content, SWT.NONE);
    label.setText("Name:");
    name = new Text(content, SWT.BORDER);
    name.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));

    label = new Label(content, SWT.NONE);
    label.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 2, 1));

    label = new Label(content, SWT.NONE);
    label.setText("Target repository:");
    label.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1));
    repository = new ComboViewer(content, SWT.READ_ONLY);
    repository.getControl().setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1));
    repository.setLabelProvider(new LabelProvider());
    repository.setContentProvider(new ArrayContentProvider());
    repository.setSorter(new ViewerSorter());
    repository.setInput(getRepositoryService().getRepositories());
    repository.setSelection(new StructuredSelection(getRepositoryService().getRepository("local")));

    performDefaults();
    name.addModifyListener(modifyListener);

    return content;
  }
  protected Composite createMaxOccurComp(Composite parent, FormToolkit toolkit) {
    fMaxLabel = toolkit.createLabel(parent, PDEUIMessages.AbstractSchemaDetails_maxOccurLabel);
    fMaxLabel.setForeground(toolkit.getColors().getColor(IFormColors.TITLE));
    Composite comp = toolkit.createComposite(parent);
    GridData gd = new GridData(GridData.FILL_HORIZONTAL);
    gd.horizontalSpan = 2;
    GridLayout layout = new GridLayout(3, false);
    layout.marginHeight = layout.marginWidth = 0;
    comp.setLayout(layout);
    comp.setLayoutData(gd);

    fMaxOccurSpinner = new Spinner(comp, SWT.BORDER);
    fMaxOccurSpinner.setMinimum(1);
    fMaxOccurSpinner.setMaximum(999);
    fMaxOccurSpinner.setIncrement(1);

    fUnboundSelect =
        toolkit.createButton(comp, PDEUIMessages.AbstractSchemaDetails_unboundedButton, SWT.CHECK);
    gd = new GridData();
    gd.horizontalIndent = 10;
    fUnboundSelect.setLayoutData(gd);
    fUnboundSelect.addSelectionListener(
        new SelectionAdapter() {
          @Override
          public void widgetSelected(SelectionEvent e) {
            if (blockListeners()) return;
            fMaxOccurSpinner.setEnabled(!fUnboundSelect.getSelection() && isEditableElement());
          }
        });

    return comp;
  }
예제 #22
0
  /*
   * @see org.eclipse.jface.dialogs.TrayDialog#createButtonBar(org.eclipse.swt.widgets.Composite)
   */
  @Override
  protected Control createButtonBar(Composite parent) {
    GridLayout layout = new GridLayout(1, false);
    layout.marginWidth = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN);
    layout.marginHeight = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN);
    layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
    layout.verticalSpacing = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING);

    Composite buttonBar = new Composite(parent, SWT.NONE);
    buttonBar.setLayoutData(new GridData(SWT.FILL, SWT.BEGINNING, true, false));
    buttonBar.setLayout(layout);

    /* Info Container */
    Composite infoContainer = new Composite(buttonBar, SWT.None);
    infoContainer.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, true));
    infoContainer.setLayout(LayoutUtils.createGridLayout(2, 0, 0));
    ((GridLayout) infoContainer.getLayout()).marginRight = 10;

    Label infoImg = new Label(infoContainer, SWT.NONE);
    infoImg.setImage(OwlUI.getImage(fResources, "icons/obj16/info.gif")); // $NON-NLS-1$
    infoImg.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false));

    Label infoText = new Label(infoContainer, SWT.WRAP);
    infoText.setText(Messages.CustomizeToolbarDialog_USE_MOUSE_INFO);
    infoText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));

    applyDialogFont(infoContainer);

    /* Create Ok / Cancel Buttons */
    createButtonsForButtonBar(buttonBar);

    return buttonBar;
  }
  protected Control createDialogArea(Composite parent) {
    Composite dialogArea1 = (Composite) super.createDialogArea(parent);
    PlatformUI.getWorkbench()
        .getHelpSystem()
        .setHelp(dialogArea1, XMLCommonUIContextIds.XCUI_PROCESSING_DIALOG);

    Composite composite = new Composite(dialogArea1, SWT.NONE);
    GridLayout layout = new GridLayout();
    layout.numColumns = 2;
    layout.marginWidth = 0;
    composite.setLayout(layout);
    composite.setLayoutData(new GridData(GridData.FILL_BOTH));

    GridData gd = new GridData(GridData.FILL_HORIZONTAL);
    gd.widthHint = 250;

    Label targetLabel = new Label(composite, SWT.NONE);
    targetLabel.setText(XMLUIMessages._UI_LABEL_TARGET_COLON);

    targetField = new Text(composite, SWT.SINGLE | SWT.BORDER);
    targetField.setLayoutData(gd);
    targetField.setText(getDisplayValue(target));

    Label dataLabel = new Label(composite, SWT.NONE);
    dataLabel.setText(XMLUIMessages._UI_LABEL_DATA_COLON);

    dataField = new Text(composite, SWT.SINGLE | SWT.BORDER);
    dataField.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    dataField.setText(getDisplayValue(data));

    return dialogArea1;
  }
예제 #24
0
  protected Control createDialogArea(Composite parent) {
    Composite composite = (Composite) super.createDialogArea(parent);

    Composite inner = new Composite(composite, SWT.NONE);
    GridLayout layout = new GridLayout();
    layout.marginHeight = 0;
    layout.marginWidth = 0;
    layout.numColumns = 1;
    inner.setLayout(layout);

    int widthHint = convertWidthInCharsToPixels(50);

    GridData data = new GridData(GridData.FILL_HORIZONTAL);
    data.widthHint = widthHint;

    if (fExistingFolders.contains(fCurrProject)) {
      fContainerDialogField.doFillIntoGrid(inner, 2);
    } else {
      fUseProjectButton.doFillIntoGrid(inner, 1);
      fUseFolderButton.doFillIntoGrid(inner, 1);
      fContainerDialogField.getTextControl(inner);

      int horizontalIndent = convertWidthInCharsToPixels(3);
      data.horizontalIndent = horizontalIndent;
    }
    Text text = fContainerDialogField.getTextControl(null);
    text.setLayoutData(data);
    TextFieldNavigationHandler.install(text);

    fContainerDialogField.postSetFocusOnDialogField(parent.getDisplay());
    applyDialogFont(composite);
    return composite;
  }
예제 #25
0
  @Override
  public void createPartControl(Composite parent) {
    createActions();

    fPageContent = new Composite(parent, SWT.NONE);
    GridLayout layout = new GridLayout();
    layout.marginHeight = 0;
    layout.marginWidth = 0;
    layout.horizontalSpacing = 0;
    layout.verticalSpacing = 0;
    fPageContent.setLayout(layout);

    fDescriptionComposite = null;

    super.createPartControl(fPageContent);
    getPageBook().setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));

    fDefaultPartName = getPartName();
    initializeToolBar();
    InternalSearchUI.getInstance().getSearchManager().addQueryListener(this);
    initializePageSwitcher();

    PlatformUI.getWorkbench()
        .getHelpSystem()
        .setHelp(parent, ISearchHelpContextIds.New_SEARCH_VIEW);
    restorePageFromMemento();

    showLatestSearch();
  }
예제 #26
0
파일: View.java 프로젝트: willuhn/jameica
  /** Leert die Anzeige. Wird beim Wechsel von einem Dialog auf den naechsten aufgerufen. */
  protected void cleanContent() {
    if (content != null && !content.isDisposed()) content.dispose();

    if (scroll != null && !scroll.isDisposed()) scroll.dispose();

    if (Customizing.SETTINGS.getBoolean("application.scrollview", false)) {
      scroll = new ScrolledComposite(view, SWT.V_SCROLL | SWT.H_SCROLL);
      scroll.setLayoutData(new GridData(GridData.FILL_BOTH));
      scroll.setLayout(SWTUtil.createGrid(1, true));
      scroll.setExpandHorizontal(true);
      scroll.setExpandVertical(true);
      scroll.setMinHeight(Customizing.SETTINGS.getInt("application.scrollview.minheight", 580));

      content = new Composite(scroll, SWT.NONE);
      scroll.setContent(content);
    } else {
      content = new Composite(view, SWT.NONE);
    }

    content.setLayoutData(new GridData(GridData.FILL_BOTH));
    GridLayout l = new GridLayout();
    l.marginHeight = 6;
    l.marginWidth = 6;
    content.setLayout(l);

    if (this.titlePart != null) {
      this.titlePart.clearButtons();
      this.titlePart.addButton(new PanelButtonBack()); // Zurueckbutton ist immer dabei
    }

    if (notifications != null) notifications.reset();

    setTitle(null);
  }
  /* (non-Javadoc)
   * @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite)
   */
  public void createControl(Composite parent) {
    Composite inner = new Composite(parent, SWT.NONE);
    inner.setFont(parent.getFont());

    GridLayout layout = new GridLayout();
    layout.marginHeight = 0;
    layout.marginWidth = 0;
    layout.numColumns = 2;
    inner.setLayout(layout);
    inner.setLayoutData(new GridData(GridData.FILL_BOTH));

    fInclusionPatternList.doFillIntoGrid(inner, 3);
    LayoutUtil.setHorizontalSpan(fInclusionPatternList.getLabelControl(null), 2);
    LayoutUtil.setHorizontalGrabbing(fInclusionPatternList.getListControl(null));

    fExclusionPatternList.doFillIntoGrid(inner, 3);
    LayoutUtil.setHorizontalSpan(fExclusionPatternList.getLabelControl(null), 2);
    LayoutUtil.setHorizontalGrabbing(fExclusionPatternList.getListControl(null));

    setControl(inner);
    Dialog.applyDialogFont(inner);
    if (DLTKCore.DEBUG) {
      System.err.println("SetFilterWizardOage add help support here"); // $NON-NLS-1$
    }
    // PlatformUI.getWorkbench().getHelpSystem().setHelp(inner,
    // IDLTKHelpContextIds.INCLUSION_EXCLUSION_WIZARD_PAGE);
  }
예제 #28
0
  public AppBrowser(TabBrowser parent, Workspace workspace_) {
    super(parent, workspace_, SWT.TRANSPARENCY_ALPHA);
    this.workspace = workspace_;

    setBackgroundMode(SWT.INHERIT_DEFAULT);

    ApplicationFactory factory = new ApplicationFactory(this, "VietSpider", getClass().getName());
    //    setBackground(new Color(getDisplay(), 255, 255, 255));

    GridLayout gridLayout = new GridLayout(1, false);
    gridLayout.marginHeight = 5;
    gridLayout.horizontalSpacing = 10;
    gridLayout.verticalSpacing = 15;
    gridLayout.marginWidth = 5;
    setLayout(gridLayout);

    toolbar = new Toolbar(this, parent);
    GridData gridData = new GridData(GridData.FILL_HORIZONTAL);
    toolbar.setLayoutData(gridData);

    initIcons(factory);

    //    configLink.addHyperlinkListener(listener);

    StatusBar statusBar = new StatusBar(workspace, this, SWT.TRANSPARENCY_ALPHA);
    gridData = new GridData(GridData.FILL_HORIZONTAL);
    statusBar.setLayoutData(gridData);
    statusBar.setBackground(getBackground());
    statusBar.setComponent(this);

    //    tab.setStatusBar(statusBar);
  }
예제 #29
0
  private void createControls() {
    GridLayout gLayout = new GridLayout();
    gLayout.marginHeight = 0;
    gLayout.marginWidth = 0;
    gLayout.verticalSpacing = 0;
    shell.setLayout(gLayout);
    Utils.setShellIcon(shell);

    topPanel = new Composite(shell, SWT.NONE);
    topPanel.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
    GridLayout gLayout1 = new GridLayout();
    gLayout1.marginBottom = 10;
    topPanel.setLayout(gLayout1);
    topPanel.setBackground(shell.getDisplay().getSystemColor(SWT.COLOR_LIST_BACKGROUND));
    topPanel.setBackgroundMode(SWT.INHERIT_FORCE);

    Label separator1 = new Label(shell, SWT.SEPARATOR | SWT.HORIZONTAL);
    separator1.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));

    contentPanel = new Composite(shell, SWT.NONE);
    contentPanel.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
    contentStackLayout = new StackLayout();
    contentPanel.setLayout(contentStackLayout);

    titleLabel = new Label(topPanel, SWT.NONE);
    titleLabel.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
    Utils.setFontHeight(titleLabel, 16, SWT.NORMAL);

    descriptionLabel = new Label(topPanel, SWT.WRAP);
    GridData gData = new GridData(SWT.FILL, SWT.FILL, true, true);
    gData.horizontalIndent = 10;
    descriptionLabel.setLayoutData(gData);

    shell.layout(true, true);
  }
  @Override
  public void createUI(FormToolkit formToolkit) {
    super.createUI(formToolkit);
    GridBuilder widgetBuilder = new GridBuilder(formToolkit, getClientComposite(), 3);
    picker.setState(EControlState.MANDATORY, true);
    Composite composite = getClientComposite();
    GridLayout gl = (GridLayout) composite.getLayout();
    gl.marginWidth = 0;
    gl.marginHeight = 0;
    gl.marginTop = 0;
    gl.marginBottom = 0;
    composite.setLayout(gl);

    GridData gd = (GridData) composite.getLayoutData();
    if (gd == null) gd = GridLayoutFactory.createDefaultLayoutData();
    // calculate horizontal indent for the first widget. take care of the margin width of the grid
    // layout
    // if margin width is greater than indent -> set indent to 0
    //        gd.horizontalIndent = GridLayoutFactory.INDENT_FOR_DECORATORS < gl.marginWidth ? 0 :
    // GridLayoutFactory.INDENT_FOR_DECORATORS - gl.marginWidth;
    gd.horizontalIndent = 0;
    composite.setLayoutData(gd);
    widgetBuilder.add(picker);
    picker.getText().getRCPHyperlink().setVisible(false);
  }