/**
   * Creates the file sets area.
   *
   * @param fileSetsContainer the container to add the file sets area to
   */
  private Control createFileSetsArea(Composite fileSetsContainer) throws CheckstylePluginException {

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

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

    mFileSetsEditor.setFileSets(mProjectConfig.getFileSets());

    Control editor = mFileSetsEditor.createContents(mFileSetsContainer);

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

    return fileSetsContainer;
  }
  /** {@inheritDoc} */
  public void createControls(Composite parent, TabbedPropertySheetPage tabbedPropertySheetPage) {
    super.createControls(parent, tabbedPropertySheetPage);
    /*
     * We set the color as it's a InterpretedExpression
     */
    text.setBackground(SiriusEditor.getColorRegistry().get("yellow"));

    text.setToolTipText(getToolTipText());

    help = getWidgetFactory().createCLabel(composite, "");
    FormData data = new FormData();
    data.top = new FormAttachment(text, 0, SWT.TOP);
    data.left = new FormAttachment(nameLabel);
    help.setLayoutData(data);
    help.setImage(getHelpIcon());
    help.setToolTipText(getToolTipText());
    nameLabel.setFont(SiriusEditor.getFontRegistry().get("required"));

    TypeContentProposalProvider.bindPluginsCompletionProcessors(this, text);

    // Start of user code create controls

    // End of user code create controls

  }
  /** Creates content Composite. */
  Composite eswtConstructContent(int style) {
    Composite comp = super.eswtConstructContent(SWT.VERTICAL);

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

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

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

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

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

    eswtUpdateProgressbar(comp, false, false);

    return comp;
  }
  /** @param form2 */
  private Composite getPageHeader(Composite parent) {
    final Composite header = new Composite(parent, SWT.FILL);
    final FormLayout layout = new FormLayout();
    layout.marginHeight = 5;
    layout.marginWidth = 5;
    header.setLayout(layout);
    GridDataFactory.fillDefaults().align(SWT.FILL, SWT.FILL).grab(true, false).applyTo(header);

    header.setBackground(parent.getBackground());

    final Label titleImage = new Label(header, SWT.FILL);
    final ImageDescriptor imageDescriptor =
        ImageDescriptor.createFromURL(
            Activator.getDefault().getBundle().getResource("icons/view.png")); // $NON-NLS-1$
    titleImage.setImage(new Image(parent.getDisplay(), imageDescriptor.getImageData()));
    final FormData titleImageData = new FormData();
    final int imageOffset = -titleImage.computeSize(SWT.DEFAULT, SWT.DEFAULT).y / 2;
    titleImageData.top = new FormAttachment(50, imageOffset);
    titleImageData.left = new FormAttachment(0, 10);
    titleImage.setLayoutData(titleImageData);

    final Label title = new Label(header, SWT.WRAP);
    title.setText("View Editor"); // $NON-NLS-1$
    titleFont = new Font(title.getDisplay(), getDefaultFontName(title), 12, SWT.BOLD);
    title.setFont(titleFont);
    title.setForeground(getTitleColor(parent));
    final FormData titleData = new FormData();
    title.setLayoutData(titleData);
    titleData.left = new FormAttachment(titleImage, 5, SWT.DEFAULT);

    return header;
  }
Beispiel #5
0
  @Override
  protected Control createContents(Composite parent) {

    Composite rootArea = new Composite(parent, SWT.NONE);
    m_timeChooserContent = new TimeChooserContent(rootArea, m_displayDate, getEnvironment());
    m_timeChooserContent.addTimeChangedListener(
        new AbstractDateSelectionListener() {
          @Override
          public void dateChanged(DateSelectionEvent e) {
            m_returnDate = (Date) e.getData();
            getShell()
                .getDisplay()
                .asyncExec(
                    new Runnable() {
                      @Override
                      public void run() {
                        close();
                      }
                    });
          }
        });
    m_timeChooserContent.setDate(m_displayDate);
    // layout
    rootArea.setLayout(new FormLayout());
    FormData data = new FormData();
    data.top = new FormAttachment(0, 0);
    data.left = new FormAttachment(0, 0);
    data.right = new FormAttachment(100, 0);
    data.bottom = new FormAttachment(100, 0);
    m_timeChooserContent.setLayoutData(data);
    return rootArea;
  }
 /**
  * Update ProgressBar widget.<br>
  * Try to reuse the old ProgressBar if possible, otherwise dispose it and create a new one.
  *
  * @param parent
  * @param indeterminate
  * @param visible
  */
 void eswtUpdateProgressbar(Composite parent, boolean indeterminate, boolean visible) {
   // Only dispose old ProgressBar if it has wrong style
   if (eswtProgressBar != null) {
     boolean isIndeterminate = (eswtProgressBar.getStyle() & SWT.INDETERMINATE) != 0;
     if (indeterminate != isIndeterminate) {
       eswtProgressBar.setLayoutData(null);
       eswtProgressBar.dispose();
       eswtProgressBar = null;
     }
   }
   // create new ProgressBar
   if (eswtProgressBar == null) {
     int newStyle = indeterminate ? SWT.INDETERMINATE : SWT.NONE;
     eswtProgressBar = new ProgressBar(parent, newStyle);
     eswtProgressBar.setLayoutData(eswtProgbarLD);
     // update ScrolledText's layoutdata
     FormData imageLD = (FormData) eswtImgLabel.getLayoutData();
     imageLD.bottom = new FormAttachment(eswtProgressBar);
   }
   // set Progressbar visibility
   if (eswtProgressBar != null) {
     eswtProgbarLD.top = (visible ? null : new FormAttachment(100));
     eswtProgressBar.setVisible(visible);
   }
 }
  public void createControl(Composite parent) {
    // create the composite to hold the widgets
    Composite composite = new Composite(parent, SWT.NONE);
    props.setLook(composite);

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

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

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

    // set the composite as the control for this page
    setControl(composite);
  }
  /**
   * Create widgets for join type selection
   *
   * @param lsMod
   */
  private void createJoinTypeWidget(final ModifyListener lsMod) {
    Label joinTypeLabel = new Label(shell, SWT.LEFT);
    joinTypeLabel.setText(BaseMessages.getString(PKG, "MultiMergeJoinDialog.Type.Label"));
    props.setLook(joinTypeLabel);
    FormData fdlType = new FormData();
    fdlType.left = new FormAttachment(0, 0);
    fdlType.right = new FormAttachment(15, -margin);
    if (wInputStepArray.length > 0) {
      fdlType.top = new FormAttachment(wInputStepArray[wInputStepArray.length - 1], margin);
    } else {
      fdlType.top = new FormAttachment(wStepname, margin);
    }
    joinTypeLabel.setLayoutData(fdlType);
    joinTypeCombo = new CCombo(shell, SWT.BORDER);
    props.setLook(joinTypeCombo);

    joinTypeCombo.setItems(MultiMergeJoinMeta.join_types);

    joinTypeCombo.addModifyListener(lsMod);
    FormData fdType = new FormData();
    if (wInputStepArray.length > 0) {
      fdType.top = new FormAttachment(wInputStepArray[wInputStepArray.length - 1], margin);
    } else {
      fdType.top = new FormAttachment(wStepname, margin);
    }
    fdType.left = new FormAttachment(15, 0);
    fdType.right = new FormAttachment(35, 0);
    joinTypeCombo.setLayoutData(fdType);
  }
Beispiel #9
0
  protected void createControl(Composite parent, int treeStyle) {
    super.createControl(parent, treeStyle);

    // add 2px margin around filter text

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

    FormData data = new FormData();
    data.left = new FormAttachment(0, 0);
    data.right = new FormAttachment(100, 0);
    data.bottom = new FormAttachment(100, 0);
    if (showFilterControls) {
      FormData filterData = new FormData();
      filterData.top = new FormAttachment(0, 2);
      filterData.left = new FormAttachment(0, 2);
      filterData.right = new FormAttachment(100, -2);
      filterComposite.setLayoutData(filterData);
      data.top = new FormAttachment(filterComposite, 2);
    } else {
      data.top = new FormAttachment(0, 0);
    }
    treeComposite.setLayoutData(data);
  }
  public static void positionControlBelow(
      Control control, Control widgetAbove, int topMarginHint, int leftMarginHint) {

    int topMargin = DEFAULT_LABEL_INPUT_MARGIN;
    if (topMarginHint >= 0) {
      topMargin = topMarginHint;
    }

    int leftMargin = LEFT_MARGIN_OFFSET;
    if (leftMarginHint >= 0) {
      leftMargin = leftMarginHint;
    }

    FormData fd = new FormData();
    if (control.getLayoutData() != null && control.getLayoutData() instanceof FormData) {
      fd = (FormData) control.getLayoutData();
    }

    fd.left = new FormAttachment(0, leftMargin);
    if (widgetAbove != null) {
      fd.top = new FormAttachment(widgetAbove, topMargin);
    } else {
      fd.top = new FormAttachment(0);
    }
    control.setLayoutData(fd);
  }
Beispiel #11
0
  @SuppressWarnings({"unchecked", "rawtypes"})
  @Override
  public void createControls(Composite parent, TabbedPropertySheetPage aTabbedPropertySheetPage) {
    super.createControls(parent, aTabbedPropertySheetPage);
    Composite composite = getWidgetFactory().createFlatFormComposite(parent);
    TableColumnLayout tableColumnLayout = new TableColumnLayout();
    composite.setLayout(tableColumnLayout);
    FormData data;

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

    columns = new ArrayList();

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

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

    data = new FormData();
    data.left = new FormAttachment(0, 0);
    data.right = new FormAttachment(100, 0);
    data.top = new FormAttachment(0, 0);
    data.bottom = new FormAttachment(100, 0);
    table.setLayoutData(data);
  }
  @Override
  public void build() {
    IWorkbench workbench = PlatformUI.getWorkbench();
    IWorkbenchWindow workbenchWindow = workbench.getActiveWorkbenchWindow();
    workbenchWindow.addPerspectiveListener(perspectiveAdapter);

    IPerspectiveDescriptor[] descriptors = load();
    for (int i = 0; i < descriptors.length; i++) {
      createPerspectiveButton(descriptors[i]);
    }

    // Button for the perspective dialog
    Composite otherBg = new Composite(background, SWT.NONE);
    otherBg.setLayout(new FormLayout());
    otherButton = new Button(otherBg, SWT.PUSH | SWT.FLAT);
    FormData fdOther = new FormData();
    otherButton.setLayoutData(fdOther);
    fdOther.left = new FormAttachment(0, left.getBounds().width);
    FormData buttonPos = getLayoutSet().getPosition(ILayoutSetConstants.PERSP_BUTTON_POS);
    fdOther.top = buttonPos.top;
    otherButton.setData(RWT.CUSTOM_VARIANT, "perspective"); // $NON-NLS-1$
    otherButton.setText(Messages.get().PerspectiveSwitcherBuilder_Other);
    IWorkbenchWindow activeWindow = workbench.getActiveWorkbenchWindow();
    final IWorkbenchAction perspectiveAction =
        ActionFactory.OPEN_PERSPECTIVE_DIALOG.create(activeWindow);
    otherButton.addSelectionListener(
        new SelectionAdapter() {
          @Override
          public void widgetSelected(SelectionEvent e) {
            perspectiveAction.run();
          }
        });
  }
  public RequestResponseViewer(SashForm parentForm) {
    imageCache = new ImageCache(Activator.PLUGIN_ID);
    this.parentForm = parentForm;
    parentComposite = new Composite(parentForm, SWT.NONE);
    parentComposite.setLayout(new FormLayout());
    optionsMenu = createOptionsMenu(parentForm.getShell());
    toolbarComposite = createToolbarComposite(parentComposite);

    FormData fd = new FormData();
    fd.left = new FormAttachment(0);
    fd.right = new FormAttachment(100);
    fd.top = new FormAttachment(0);
    toolbarComposite.setLayoutData(fd);
    setTabbedMode();

    IModel model = Activator.getDefault().getModel();
    model.addWorkspaceListener(
        new IEventHandler() {
          @Override
          public void handleEvent(IEvent event) {
            if (event instanceof WorkspaceCloseEvent || event instanceof WorkspaceResetEvent) {
              handleWorkspaceCloseOrReset();
            }
          }
        });
  }
Beispiel #14
0
  public TagItem(Composite parent, int style, int index, Tag tag, TagPanel parentTagPanel) {
    super(parent, style);
    this.tag = tag;
    this.index = index;
    this.parentTagPanel = parentTagPanel;
    FormLayout layout = new FormLayout();
    setLayout(layout);
    imageLabel = new Label(this, SWT.None);
    imageLabel.setImage(image);
    FormData data = new FormData();
    data.left = new FormAttachment(0, 15);
    imageLabel.setLayoutData(data);
    textLabel = new Label(this, SWT.None);
    textLabel.setText(tag.getName());
    int rgb[] = ColorMap.get().getRGB(tag.getColorName());
    if (rgb == null) {
      rgb = ColorMap.get().getRGB("Black");
    }
    unselectedBackground = getBackground();
    textLabel.setForeground(new Color(getDisplay(), rgb[0], rgb[1], rgb[2]));
    data = new FormData();
    data.left = new FormAttachment(imageLabel, 5);
    data.top = new FormAttachment(imageLabel, 0, SWT.CENTER);
    data.right = new FormAttachment(100, 0);
    textLabel.setLayoutData(data);

    imageLabel.addMouseListener(this);
    textLabel.addMouseListener(this);
    addMouseListener(this);
  }
 /**
  * Create the layout data for the message area.
  *
  * @return FormData for the message area.
  */
 private FormData createMessageAreaData() {
   FormData messageData = new FormData();
   messageData.top = new FormAttachment(0);
   messageData.bottom = new FormAttachment(100);
   messageData.right = new FormAttachment(100);
   messageData.left = new FormAttachment(0);
   return messageData;
 }
  public static FormData fillingParentFormLayoutData() {
    final FormData fd = new FormData();
    fd.top = new FormAttachment(0, 0);
    fd.left = new FormAttachment(0, 0);
    fd.right = new FormAttachment(100, 0);

    return fd;
  }
Beispiel #17
0
 private FormData createLayoutDataForExampleParent() {
   FormData layoutData = new FormData();
   layoutData.top = new FormAttachment(header, 0);
   layoutData.left = new FormAttachment(tree, 10);
   layoutData.right = new FormAttachment(100, 0);
   layoutData.bottom = new FormAttachment(100, 0);
   return layoutData;
 }
Beispiel #18
0
 private FormData createLayoutDataForTree() {
   FormData layoutData = new FormData();
   layoutData.top = new FormAttachment(header, 0);
   layoutData.left = new FormAttachment(0, 0);
   layoutData.bottom = new FormAttachment(100, 0);
   layoutData.width = 190;
   return layoutData;
 }
Beispiel #19
0
 private FormData createLayoutDataForHeader() {
   FormData layoutData = new FormData();
   layoutData.left = new FormAttachment(0, 0);
   layoutData.right = new FormAttachment(100, 0);
   layoutData.top = new FormAttachment(0, 0);
   layoutData.height = 80;
   return layoutData;
 }
  /**
   * Set the major UI features of this basic view composite
   *
   * @param textEditor
   * @param parentComposite
   * @param styleBit
   */
  public Transition(final XMLEditor textEditor, final Composite parentComposite, int styleBit) {
    super(parentComposite, SWT.BORDER);
    setBackground(SWTResourceManager.getColor(SWT.COLOR_DARK_MAGENTA));
    this.textEditor = textEditor;
    addDisposeListener(
        new DisposeListener() {
          @Override
          public void widgetDisposed(DisposeEvent e) {
            toolkit.dispose();
          }
        });
    toolkit.adapt(this);
    toolkit.paintBordersFor(this);
    setLayout(new FormLayout());
    setLayoutData(new GridData(GridData.FILL_BOTH));

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

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

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

    // create a THumanInteractions object if humanInteractions variable is
    // null
    if (textEditor.getRootElement() == null) {
      humanInteractions = new THumanInteractions();
      textEditor.setRootElement(humanInteractions);
    }
    try {
      // create the biggest xml element- UI section
      humanInteractionsUI =
          new THumanInteractionsUI(
              textEditor, baseContainer, this, SWT.NONE, textEditor.getRootElement(), 0, 0);
    } catch (JAXBException e1) {
      LOG.info(e1.getMessage());
    }
  }
  /**
   * Constructor for TabbedPropertyTitle.
   *
   * @param parent the parent composite.
   * @param factory the widget factory for the tabbed property sheet
   */
  public TabbedPropertyTitle(Composite parent, TabbedPropertySheetWidgetFactory factory) {
    super(parent, SWT.NO_FOCUS);
    this.factory = factory;

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

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

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

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

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

    /*
     * setImage(PlatformUI.getWorkbench().getSharedImages().getImage(
     * ISharedImages.IMG_OBJ_ELEMENT));
     */
  }
Beispiel #22
0
  @Override
  public void createPartControl(Composite parent) {
    Composite container = new Composite(parent, SWT.NONE);
    container.setBackground(parent.getDisplay().getSystemColor(SWT.COLOR_WHITE));

    container.setLayout(new FormLayout());

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

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

    form.setLayoutData(data);

    // form.setText(Messages.IntroTitle);

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

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

    StringBuilder buf = new StringBuilder();
    buf.append("<form>"); // $NON-NLS-1$
    buf.append("<p><img href=\"logo\"/></p>"); // $NON-NLS-1$
    buf.append("<p><span color=\"header\" font=\"header\">") // $NON-NLS-1$
        .append(Messages.IntroTitle) //
        .append("</span></p>"); // $NON-NLS-1$
    addLink(buf, "action:open", Messages.IntroOpenFile, Messages.IntroOpenFileText); // $NON-NLS-1$
    addLink(buf, "action:new", Messages.IntroNewFile, Messages.IntroNewFileText); // $NON-NLS-1$
    addLink(
        buf,
        "action:sample",
        Messages.IntroOpenSample,
        Messages.IntroOpenSampleText); // $NON-NLS-1$
    addLink(
        buf,
        "action:daxsample",
        Messages.IntroOpenDaxSample,
        Messages.IntroOpenDaxSampleText); // $NON-NLS-1$
    addLink(
        buf,
        "http://buchen.github.com/portfolio/new_and_noteworthy.html", //$NON-NLS-1$
        Messages.IntroReadNews,
        Messages.IntroReadNewsText);
    buf.append("</form>"); // $NON-NLS-1$
    text.setText(buf.toString(), true, false);
    text.setImage("logo", PortfolioPlugin.image(PortfolioPlugin.IMG_LOGO)); // $NON-NLS-1$
    text.setColor("header", toolkit.getColors().getColor(IFormColors.TITLE)); // $NON-NLS-1$
    text.setFont("header", JFaceResources.getHeaderFont()); // $NON-NLS-1$
    text.addHyperlinkListener(this);
  }
  protected void localOptionsComposite(Class<?> PKG, String prefix) {

    Label localDescriptionLabel = new Label(localOptionsComposite, SWT.NONE);
    props.setLook(localDescriptionLabel);
    localDescriptionLabel.setText(BaseMessages.getString(PKG, prefix + ".LocalHost.Label"));
    FormData fd_localDescriptionLabel = new FormData();
    fd_localDescriptionLabel.left = new FormAttachment(environmentSeparator, 5);
    fd_localDescriptionLabel.top = new FormAttachment(0, 12);
    localDescriptionLabel.setLayoutData(fd_localDescriptionLabel);
  }
Beispiel #24
0
  public NyiEntryRow(Composite parent, String rowLabel) {
    super(parent, rowLabel);

    lblNotYet = new Label(this, SWT.NONE);
    FormData fd_lblNotYet = new FormData();
    fd_lblNotYet.top = new FormAttachment(lblTitle, 0, SWT.TOP);
    fd_lblNotYet.left = new FormAttachment(lblTitle, 20);
    lblNotYet.setLayoutData(fd_lblNotYet);
    lblNotYet.setText("( Not Yet Implemented )");
  }
  private void setLayoutData(Control c, int left, int right, int top, int bottom) {
    FormData location = new FormData();

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

    c.setLayoutData(location);
  }
Beispiel #26
0
 /** Creates text area for displaying application environment info */
 private void createTextEnvironment() {
   textEnvironment = new Text(shell, SWT.MULTI | SWT.WRAP | SWT.V_SCROLL | SWT.BORDER);
   textEnvironment.setFont(SharedStyle.FONT_FIXED);
   textEnvironment.setText(Version.getEnvironmentReport());
   textEnvironment.setEditable(false);
   final FormData layout = SharedStyle.relativeTo(labelEnvironment, null, buttonClose, null);
   layout.width = 500;
   layout.height = 150;
   textEnvironment.setLayoutData(layout);
 }
 private CLabel createLabel(
     Composite parent, String text, Control control, TabbedPropertySheetWidgetFactory factory) {
   CLabel label = factory.createCLabel(parent, text); // $NON-NLS-1$
   FormData data = new FormData();
   data.left = new FormAttachment(0, 0);
   data.right = new FormAttachment(control, -HSPACE);
   data.top = new FormAttachment(control, 0, SWT.TOP);
   label.setLayoutData(data);
   return label;
 }
Beispiel #28
0
  public TextVarWarning(VariableSpace space, Composite composite, int flags) {
    super(composite, SWT.NONE);

    warningInterfaces = new ArrayList<WarningInterface>();

    FormLayout formLayout = new FormLayout();
    formLayout.marginWidth = 0;
    formLayout.marginHeight = 0;
    formLayout.marginTop = 0;
    formLayout.marginBottom = 0;

    this.setLayout(formLayout);

    // add a text field on it...
    wText = new TextVar(space, this, flags);

    warningControlDecoration = new ControlDecoration(wText, SWT.CENTER | SWT.RIGHT);
    Image warningImage = GUIResource.getInstance().getImageWarning();
    warningControlDecoration.setImage(warningImage);
    warningControlDecoration.setDescriptionText(
        BaseMessages.getString(PKG, "TextVar.tooltip.FieldIsInUse"));
    warningControlDecoration.hide();

    // If something has changed, check the warning interfaces
    //
    wText.addModifyListener(
        new ModifyListener() {
          public void modifyText(ModifyEvent arg0) {

            // Verify all the warning interfaces.
            // Show the first that has a warning to show...
            //
            boolean foundOne = false;
            for (WarningInterface warningInterface : warningInterfaces) {
              WarningMessageInterface warningSituation =
                  warningInterface.getWarningSituation(wText.getText(), wText, this);
              if (warningSituation.isWarning()) {
                foundOne = true;
                warningControlDecoration.show();
                warningControlDecoration.setDescriptionText(warningSituation.getWarningMessage());
                break;
              }
            }
            if (!foundOne) {
              warningControlDecoration.hide();
            }
          }
        });

    FormData fdText = new FormData();
    fdText.top = new FormAttachment(0, 0);
    fdText.left = new FormAttachment(0, 0);
    fdText.right = new FormAttachment(100, -warningImage.getBounds().width);
    wText.setLayoutData(fdText);
  }
 private void createDropWidget(final Composite parent) {
   parent.setLayout(new FormLayout());
   Combo combo = new Combo(parent, SWT.READ_ONLY);
   combo.setItems(
       new String[] {
         "Toggle Button",
         "Radio Button",
         "Checkbox",
         "Canvas",
         "Label",
         "List",
         "Table",
         "Tree",
         "Text"
       });
   combo.select(LABEL);
   dropControlType = combo.getSelectionIndex();
   dropControl = createWidget(dropControlType, parent, "Drop Target");
   combo.addSelectionListener(
       new SelectionAdapter() {
         @Override
         public void widgetSelected(final SelectionEvent e) {
           Object data = dropControl.getLayoutData();
           Composite parent = dropControl.getParent();
           dropControl.dispose();
           Combo c = (Combo) e.widget;
           dropControlType = c.getSelectionIndex();
           dropControl = createWidget(dropControlType, parent, "Drop Target");
           dropControl.setLayoutData(data);
           updateDropTarget();
           parent.layout();
         }
       });
   Button b = new Button(parent, SWT.CHECK);
   b.setText("DropTarget");
   b.addSelectionListener(
       new SelectionAdapter() {
         @Override
         public void widgetSelected(final SelectionEvent e) {
           dropEnabled = ((Button) e.widget).getSelection();
           updateDropTarget();
         }
       });
   b.setSelection(dropEnabled);
   FormData data = new FormData();
   data.top = new FormAttachment(0, 10);
   data.bottom = new FormAttachment(combo, -10);
   data.left = new FormAttachment(0, 10);
   data.right = new FormAttachment(100, -10);
   dropControl.setLayoutData(data);
   data = new FormData();
   data.bottom = new FormAttachment(100, -10);
   data.left = new FormAttachment(0, 10);
   combo.setLayoutData(data);
   data = new FormData();
   data.bottom = new FormAttachment(100, -10);
   data.left = new FormAttachment(combo, 10);
   b.setLayoutData(data);
   updateDropTarget();
 }
Beispiel #30
0
  /**
   * Provide layout and listeners for the controls.
   *
   * @param parent
   */
  private void addLayout(Composite parent) {
    FormData data;

    // http://www.eclipse.org/forums/index.php/t/202738/
    final FormLayout layout = new FormLayout();
    layout.marginWidth = 4;
    layout.marginHeight = 0;
    layout.spacing = 10; // 100;
    parent.setLayout(layout);

    data = new FormData();
    data.left = new FormAttachment(0, 0);
    data.top = new FormAttachment(nameTextVal, 0, SWT.CENTER);
    valueLabel.setLayoutData(data);

    data = new FormData();
    data.left = new FormAttachment(valueLabel, 0);
    // data.right = new FormAttachment(100, 0);
    // data.right = new FormAttachment(50, 0);
    data.width = 200;
    data.top = new FormAttachment(0, VSPACE);
    // data.width = SWT.BORDER;
    nameTextVal.setLayoutData(data);

    data = new FormData();
    data.left = new FormAttachment(0, 0);
    data.width = 200;
    // data.right = new FormAttachment(100, 0);
    // data.right = new FormAttachment(50, 0);
    data.top = new FormAttachment(nameTextVal, VSPACE);
    // data.width = SWT.BORDER;
    allowedModes.setLayoutData(data);
  }