Ejemplo n.º 1
0
 /** This method initializes transpositionGroup */
 private void createTranspositionGroup(Composite parent) {
   GridData transpositionKeyTextGridData = new GridData();
   transpositionKeyTextGridData.horizontalAlignment = GridData.FILL;
   transpositionKeyTextGridData.grabExcessHorizontalSpace = true;
   transpositionKeyTextGridData.verticalAlignment = GridData.CENTER;
   GridData transpositionDescriptionLabelGridData = new GridData();
   transpositionDescriptionLabelGridData.grabExcessHorizontalSpace = false;
   transpositionDescriptionLabelGridData.horizontalAlignment = GridData.BEGINNING;
   transpositionDescriptionLabelGridData.verticalAlignment = GridData.CENTER;
   transpositionDescriptionLabelGridData.grabExcessVerticalSpace = true;
   GridLayout transpositionGroupGridLayout = new GridLayout();
   transpositionGroupGridLayout.numColumns = 2;
   GridData transpositionGroupGridData = new GridData();
   transpositionGroupGridData.grabExcessHorizontalSpace = true;
   transpositionGroupGridData.horizontalAlignment = GridData.FILL;
   transpositionGroupGridData.verticalAlignment = GridData.FILL;
   transpositionGroupGridData.grabExcessVerticalSpace = true;
   transpositionGroup = new Group(parent, SWT.NONE);
   transpositionGroup.setLayoutData(transpositionGroupGridData);
   transpositionGroup.setLayout(transpositionGroupGridLayout);
   transpositionGroup.setText(Messages.AdfgvxWizardPage_step2);
   transpositionDescriptionLabel = new Label(transpositionGroup, SWT.NONE);
   transpositionDescriptionLabel.setText(Messages.AdfgvxWizardPage_enterTranspKey);
   transpositionDescriptionLabel.setLayoutData(transpositionDescriptionLabelGridData);
   transpositionKeyText = new Text(transpositionGroup, SWT.BORDER);
   transpositionKeyText.setLayoutData(transpositionKeyTextGridData);
   transpositionKeyText.setToolTipText(Messages.AdfgvxWizardPage_transpositionHint);
 }
Ejemplo n.º 2
0
  @Override
  public void createPartControl(Composite parent) {
    {
      GridLayout parentLayout = new GridLayout();
      parentLayout.makeColumnsEqualWidth = true;
      parent.setLayout(parentLayout);
      parent.setSize(557, 321);
      {
        composite1 = new Composite(parent, SWT.NONE);
        GridLayout composite1Layout = new GridLayout();
        composite1Layout.makeColumnsEqualWidth = true;
        GridData composite1LData = new GridData();
        composite1LData.grabExcessHorizontalSpace = true;
        composite1LData.horizontalAlignment = GridData.FILL;
        composite1LData.verticalAlignment = GridData.FILL;
        composite1.setLayoutData(composite1LData);
        composite1.setLayout(composite1Layout);
        {
          statusLbl = new Label(composite1, SWT.NONE);
          GridData statusLblLData = new GridData();
          statusLblLData.grabExcessHorizontalSpace = true;
          statusLblLData.horizontalAlignment = GridData.FILL;
          statusLbl.setLayoutData(statusLblLData);
          statusLbl.setText("sdfsdfsdf");
        }
      }
      {
        group1 = new Group(parent, SWT.NONE);
        GridLayout group1Layout = new GridLayout();
        group1Layout.makeColumnsEqualWidth = true;
        group1.setLayout(group1Layout);
        GridData group1LData = new GridData();
        group1LData.verticalAlignment = GridData.FILL;
        group1LData.horizontalAlignment = GridData.FILL;
        group1LData.grabExcessHorizontalSpace = true;
        group1LData.grabExcessVerticalSpace = true;
        group1.setLayoutData(group1LData);
        group1.setText("Notes");
        {
          notesTxt = new Text(group1, SWT.MULTI | SWT.WRAP | SWT.BORDER);
          GridData text1LData = new GridData();
          text1LData.grabExcessHorizontalSpace = true;
          text1LData.horizontalAlignment = GridData.FILL;
          text1LData.verticalAlignment = GridData.FILL;
          text1LData.grabExcessVerticalSpace = true;
          notesTxt.setLayoutData(text1LData);
        }
      }
      {
        archiveBtn = new Button(parent, SWT.PUSH | SWT.CENTER);
        GridData button1LData = new GridData();
        button1LData.horizontalAlignment = GridData.FILL;
        button1LData.grabExcessHorizontalSpace = true;
        archiveBtn.setLayoutData(button1LData);
        archiveBtn.setText("Archive");
      }
    }

    new KController(this);
  }
 /** This method initializes parametersGroup */
 private void createParametersGroup(Composite parent) {
   GridData gridData7 = new GridData();
   gridData7.grabExcessHorizontalSpace = true;
   gridData7.verticalAlignment = GridData.FILL;
   gridData7.grabExcessVerticalSpace = true;
   gridData7.horizontalAlignment = GridData.FILL;
   GridData gridData6 = new GridData();
   gridData6.horizontalAlignment = GridData.FILL;
   gridData6.grabExcessHorizontalSpace = true;
   gridData6.grabExcessVerticalSpace = true;
   gridData6.verticalAlignment = GridData.FILL;
   // GridData gridData8 = new GridData();
   // gridData8.horizontalAlignment = GridData.FILL;
   // gridData8.grabExcessHorizontalSpace = true;
   // gridData8.grabExcessVerticalSpace = true;
   // gridData8.verticalAlignment = GridData.FILL;
   GridData gridData5 = new GridData();
   gridData5.horizontalAlignment = GridData.FILL;
   gridData5.grabExcessHorizontalSpace = true;
   parametersGroup = new Group(parent, SWT.NONE);
   parametersGroup.setLayout(new GridLayout());
   parametersGroup.setLayoutData(gridData5);
   parametersGroup.setText(Messages.AlgorithmIntroductionPage_1);
   defaultRadioButton = new Button(parametersGroup, SWT.RADIO);
   defaultRadioButton.setText(Messages.AlgorithmIntroductionPage_2);
   defaultRadioButton.setLayoutData(gridData6);
   // if (paramGenExists) {
   // generateRadioButton = new Button(parametersGroup, SWT.RADIO);
   // generateRadioButton.setText("Generate parameters");
   // generateRadioButton.setLayoutData(gridData8);
   // }
   customRadioButton = new Button(parametersGroup, SWT.RADIO);
   customRadioButton.setText(Messages.AlgorithmIntroductionPage_3);
   customRadioButton.setLayoutData(gridData7);
 }
Ejemplo n.º 4
0
 /** This method initializes keyWordGroup. */
 private void createKeyWordGroup() {
   GridData keyWordTextGridData = new GridData();
   keyWordTextGridData.grabExcessHorizontalSpace = true;
   keyWordTextGridData.verticalAlignment = GridData.CENTER;
   keyWordTextGridData.horizontalAlignment = GridData.FILL;
   GridData keyWordDescriptionLabelGridData = new GridData();
   keyWordDescriptionLabelGridData.horizontalAlignment = GridData.FILL;
   keyWordDescriptionLabelGridData.grabExcessHorizontalSpace = false;
   keyWordDescriptionLabelGridData.grabExcessVerticalSpace = true;
   keyWordDescriptionLabelGridData.verticalAlignment = GridData.CENTER;
   GridLayout keyWordGroupGridLayout = new GridLayout();
   keyWordGroupGridLayout.numColumns = 2;
   GridData keyWordGroupGridData = new GridData();
   keyWordGroupGridData.horizontalAlignment = GridData.FILL;
   keyWordGroupGridData.grabExcessHorizontalSpace = true;
   keyWordGroupGridData.grabExcessVerticalSpace = true;
   keyWordGroupGridData.verticalAlignment = GridData.FILL;
   keyWordGroup = new Composite(substititionGroup, SWT.NONE);
   keyWordGroup.setLayoutData(keyWordGroupGridData);
   keyWordGroup.setLayout(keyWordGroupGridLayout);
   // keyWordGroup.setText(Messages.AdfgvxWizardPage_keyword);
   keyWordDescriptionLabel = new Label(keyWordGroup, SWT.NONE);
   keyWordDescriptionLabel.setText(Messages.AdfgvxWizardPage_enterkeyword);
   keyWordDescriptionLabel.setLayoutData(keyWordDescriptionLabelGridData);
   keyWordText = new Text(keyWordGroup, SWT.BORDER);
   keyWordText.setLayoutData(keyWordTextGridData);
   keyWordText.setToolTipText(Messages.AdfgvxWizardPage_substitutionHint);
 }
  private void createSequenceDiagramPart(Composite parent) {
    GridData gridData = new GridData();
    gridData.horizontalAlignment = SWT.FILL;
    gridData.verticalAlignment = SWT.FILL;
    gridData.grabExcessHorizontalSpace = true;
    gridData.grabExcessVerticalSpace = true;
    gridData.horizontalSpan = 2;

    FillLayout fillLayout = new FillLayout();
    fillLayout.marginHeight = 5;
    fillLayout.marginWidth = 5;

    Group sequenceDiagramGroup = new Group(parent, SWT.NONE);
    sequenceDiagramGroup.setText("Method Call Sequence Diagram");
    sequenceDiagramGroup.setLayoutData(gridData);
    sequenceDiagramGroup.setLayout(fillLayout);

    // TODO?
    this.sequenceDiagramEditPart = new SequenceDiagramEditPart();

    this.graphicalViewer = new ScrollingGraphicalViewer();
    this.graphicalViewer.createControl(sequenceDiagramGroup);
    this.graphicalViewer.setEditPartFactory(new SequenceDiagramEditPartFactory());

    EditDomain editDomain = new EditDomain();
    editDomain.setActiveTool(new SelectionTool());
    this.graphicalViewer.setEditDomain(editDomain);
  }
  public void createControl(Composite parent) {
    final Composite container = new Composite(parent, SWT.NULL);
    final GridLayout layout = new GridLayout();
    container.setLayout(layout);
    layout.numColumns = 3;
    layout.verticalSpacing = 9;
    final Label label = new Label(container, SWT.NULL);
    label.setText("&Target model:");

    uriText = new Text(container, SWT.BORDER | SWT.SINGLE);
    final GridData gd = new GridData(GridData.FILL_HORIZONTAL);
    uriText.setLayoutData(gd);
    // uriText.setEditable(false);
    uriText.addModifyListener(
        new ModifyListener() {
          public void modifyText(ModifyEvent e) {
            dialogChanged();
          }
        });

    final Button button = new Button(container, SWT.PUSH);
    button.setText("B&rowse...");
    button.addSelectionListener(
        new SelectionAdapter() {
          @Override
          public void widgetSelected(SelectionEvent e) {
            handleBrowse();
          }
        });

    final GridData gd1 = new GridData(GridData.FILL_HORIZONTAL);
    gd1.horizontalSpan = 3;
    final Label infoLabel = new Label(container, SWT.NULL);
    infoLabel.setLayoutData(gd1);
    infoLabel.setText("Contents of the selected resource:");
    final GridData gd2 =
        new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_FILL);
    gd2.horizontalSpan = 3;
    gd2.grabExcessHorizontalSpace = true;
    gd2.grabExcessVerticalSpace = true;

    viewer = new TreeViewer(container, SWT.BORDER | SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL);
    viewer.getTree().setLayoutData(gd2);
    viewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
    viewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
    viewer.addSelectionChangedListener(this);

    final GridData gd3 = new GridData(GridData.FILL_HORIZONTAL);
    gd3.horizontalSpan = 3;
    final Label hintLabel = new Label(container, SWT.WRAP);
    hintLabel.setLayoutData(gd3);
    hintLabel.setText(
        "Hint: You may also select a sub-model that contains ALL RELEVANT ELEMENTS for "
            + MPatchConstants.MPATCH_SHORT_NAME
            + " application (improves performance).");

    initialize();
    dialogChanged();
    setControl(container);
  }
  @Override
  protected Control createContent(FormToolkit toolkit, Composite parent) {
    attributesComposite = toolkit.createComposite(parent);
    attributesComposite.addListener(
        SWT.MouseDown,
        new Listener() {
          public void handleEvent(Event event) {
            Control focus = event.display.getFocusControl();
            if (focus instanceof Text && ((Text) focus).getEditable() == false) {
              getManagedForm().getForm().setFocus();
            }
          }
        });

    GridLayout attributesLayout = EditorUtil.createSectionClientLayout();
    attributesLayout.numColumns = 4;
    attributesLayout.horizontalSpacing = 9;
    attributesLayout.verticalSpacing = 6;
    attributesComposite.setLayout(attributesLayout);

    GridData attributesData = new GridData(GridData.FILL_BOTH);
    attributesData.horizontalSpan = 1;
    attributesData.grabExcessVerticalSpace = false;
    attributesComposite.setLayoutData(attributesData);

    createAttributeControls(attributesComposite, toolkit, attributesLayout.numColumns);
    toolkit.paintBordersFor(attributesComposite);

    return attributesComposite;
  }
Ejemplo n.º 8
0
  private void createViewer(Composite parent) {
    viewer =
        new TableViewer(
            parent, SWT.SINGLE | SWT.H_SCROLL | SWT.V_SCROLL | SWT.FULL_SELECTION | SWT.BORDER);
    createColumns(parent, viewer);
    final Table table = viewer.getTable();
    table.setHeaderVisible(true);
    table.setLinesVisible(true);

    viewer.setContentProvider(ArrayContentProvider.getInstance());
    WritableList input = new WritableList(ModelProvider.INSTANCE.getTasks(), Task.class);
    ViewerSupport.bind(
        viewer,
        input,
        BeanProperties.values(new String[] {"id", "name", "status", "date", "info"}));

    viewer.setInput(input);
    getSite().setSelectionProvider(viewer);

    MenuManager manager = fillMenu();
    viewer.getControl().setMenu(manager.createContextMenu(viewer.getControl()));

    GridData gridData = new GridData();
    gridData.verticalAlignment = GridData.FILL;
    gridData.horizontalSpan = 2;
    gridData.grabExcessHorizontalSpace = true;
    gridData.grabExcessVerticalSpace = true;
    gridData.horizontalAlignment = GridData.FILL;
    viewer.getControl().setLayoutData(gridData);
  }
Ejemplo n.º 9
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);
  }
  @Override
  protected Object createLowerView(Composite parent) {
    //	Tree viewer for variable structure ...
    fTree = new Tree(parent, SWT.BORDER);
    fTree.addSelectionListener(
        new SelectionAdapter() {

          @Override
          public void widgetSelected(SelectionEvent arg0) {
            // https://jira.jboss.org/browse/JBIDE-7107
            // update "OK" button enablement
            updateOkState();
          }
        });

    fTreeViewer = new TreeViewer(fTree);
    fTreeViewer.setContentProvider(treeContentProvider);
    fTreeViewer.setLabelProvider(new ModelTreeLabelProvider());
    fTreeViewer.setInput(null);
    fTreeViewer.setAutoExpandLevel(getAutoExpandLevel());
    // end tree viewer for variable structure
    GridData data = new GridData();
    data.grabExcessVerticalSpace = true;
    data.grabExcessHorizontalSpace = true;
    data.horizontalAlignment = GridData.FILL;
    data.verticalAlignment = GridData.FILL;
    data.minimumHeight = 200;
    fTree.setLayoutData(data);

    return fTree;
  }
  @Override
  public Control createDialogArea(Composite parent) {
    memento.readSettings();
    Control ret = super.createDialogArea(parent);

    getTreeViewer()
        .getTree()
        .addKeyListener(
            new KeyListener() {

              /** Support for deleting the current selection on del or backspace. */
              public void keyReleased(KeyEvent e) {
                if (e.keyCode == SWT.DEL || e.keyCode == SWT.BS) {
                  removeSelection();
                }
              }

              public void keyPressed(KeyEvent e) {}
            });

    Tree tree = getTreeViewer().getTree();
    GridData layoutData = (GridData) tree.getLayoutData();
    layoutData.grabExcessHorizontalSpace = true;
    layoutData.grabExcessVerticalSpace = true;
    layoutData.horizontalAlignment = GridData.FILL;
    layoutData.verticalAlignment = GridData.FILL;
    return ret;
  }
Ejemplo n.º 12
0
 private void initTextField() {
   value = new NumberText(this, SWT.NONE);
   GridData data = new GridData();
   data.horizontalAlignment = GridData.FILL;
   data.grabExcessVerticalSpace = true;
   value.setLayoutData(data);
 }
Ejemplo n.º 13
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);
  }
  @Override
  protected void createClient(Section section, FormToolkit toolkit) {
    GridData gd = new GridData(GridData.FILL_BOTH);
    gd.minimumWidth = 250;
    gd.grabExcessVerticalSpace = true;

    section.setText(Msgs.general);
    section.setDescription(Msgs.specifyPluginPackageProperties);
    section.setLayout(FormLayoutFactory.createClearTableWrapLayout(false, 1));
    section.setLayoutData(gd);

    Composite client = toolkit.createComposite(section);
    client.setLayout(FormLayoutFactory.createSectionClientGridLayout(false, 3));

    IActionBars actionBars = page.getEditor().getEditorSite().getActionBars();

    createNameEntry(client, toolkit, actionBars);
    createChangeLogEntry(client, toolkit, actionBars);
    createModuleGroupIdEntry(client, toolkit, actionBars);
    createPageUrlEntry(client, toolkit, actionBars);
    createModuleIncrementalVersionEntry(client, toolkit, actionBars);
    createAuthorEntry(client, toolkit, actionBars);
    createTagsEntry(client, toolkit, actionBars);
    createLicensesEntry(client, toolkit, actionBars);
    createShortDescriptionEntry(client, toolkit, actionBars);
    createSpeedFiltersEntry(client, toolkit, actionBars);
    toolkit.paintBordersFor(client);

    section.setClient(client);

    getModel().addModelChangedListener(this);
  }
  public FilterAdvancedComposite(
      final FilterChangedListener filterChangedListener, final Composite parent, final int style) {
    // fields
    super(parent, style);

    // widgets
    this.tabFolder = new CTabFolder(this, SWT.TOP | SWT.BORDER | SWT.CLOSE);
    this.addOrConditionButton = creteAddOrConditionButton();
    addOrCondition();

    // layout
    final GridLayout layout = new GridLayout(1, true);
    layout.marginLeft = 6;
    layout.marginRight = 6;
    layout.marginTop = 6;
    layout.marginBottom = 6;
    layout.verticalSpacing = 12;
    this.setLayout(layout);

    final GridData tabFolderLayoutData = new GridData();
    tabFolderLayoutData.horizontalAlignment = GridData.FILL;
    tabFolderLayoutData.grabExcessHorizontalSpace = true;
    tabFolderLayoutData.verticalAlignment = GridData.FILL;
    tabFolderLayoutData.grabExcessVerticalSpace = true;
    this.tabFolder.setLayoutData(tabFolderLayoutData);
    this.tabFolder.setBackgroundMode(SWT.INHERIT_FORCE);

    final GridData addOrConditionButtonLayoutdata = new GridData();
    addOrConditionButtonLayoutdata.horizontalAlignment = GridData.END;
    this.addOrConditionButton.setLayoutData(addOrConditionButtonLayoutdata);
  }
  private void createBehavioralAnalysisPart(Composite parent) {
    GridLayout gridLayout = new GridLayout();
    gridLayout.marginWidth = 0;
    gridLayout.numColumns = 3;

    Group group = new Group(parent, SWT.SHADOW_NONE);
    group.setText("Behavioral Analysis Results");
    group.setLayout(gridLayout);

    GridData gridData = new GridData();
    gridData.horizontalAlignment = SWT.FILL;
    gridData.verticalAlignment = SWT.FILL;
    gridData.grabExcessHorizontalSpace = true;
    group.setLayoutData(gridData);

    createBehavioralAnnotationPart(group);

    Label separator = new Label(group, SWT.SEPARATOR | SWT.VERTICAL);
    gridData = new GridData();
    gridData.verticalAlignment = SWT.FILL;
    gridData.grabExcessVerticalSpace = true;
    separator.setLayoutData(gridData);

    createTracePart(group);
  }
Ejemplo n.º 17
0
  /** This method initializes lookforShell. */
  protected void createLookforShell() {
    GridData gridData2 = new GridData();
    gridData2.horizontalAlignment = GridData.FILL;
    gridData2.verticalAlignment = GridData.CENTER;
    GridData gridData1 = new GridData();
    gridData1.grabExcessHorizontalSpace = false;
    gridData1.horizontalAlignment = GridData.FILL;
    gridData1.verticalAlignment = GridData.CENTER;
    gridData1.grabExcessVerticalSpace = false;
    GridLayout gridLayout1 = new GridLayout();
    gridLayout1.numColumns = 5;
    gridLayout1.makeColumnsEqualWidth = true;
    // this line has to be commented in order to open with VISUAL EDITOR
    lookforShell = new Shell(PlatformUI.getWorkbench().getDisplay().getActiveShell());

    // lookforShell = new Shell();
    lookforShell.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WHITE));
    createCTabFolder();
    lookforShell.setLayout(gridLayout1);
    lookforShell.setSize(new Point(501, 313));
    new Label(lookforShell, SWT.NONE);
    new Label(lookforShell, SWT.NONE);
    new Label(lookforShell, SWT.NONE);
    OKbutton = new Button(lookforShell, SWT.NONE);
    OKbutton.setText(Messages.AbstractLookForEditorShell_OK);
    OKbutton.setLayoutData(gridData1);
    OKbutton.setEnabled(false);
    cancelbutton = new Button(lookforShell, SWT.NONE);
    cancelbutton.setText(Messages.AbstractLookForEditorShell_Cancel);
    cancelbutton.setLayoutData(gridData2);
  }
Ejemplo n.º 18
0
 /**
  * Create the dialog, delegate to factory.
  *
  * @param parent The area to create in
  * @return The created area
  */
 @Override
 protected Control createDialogArea(final Composite parent) {
   final Composite container = (Composite) super.createDialogArea(parent);
   final GridLayout layout = new GridLayout();
   layout.numColumns = 1;
   // layout.horizontalAlignment = GridData.FILL;
   parent.setLayout(layout);
   final Composite c = new Composite(container, SWT.None);
   final GridData gd = new GridData();
   gd.grabExcessHorizontalSpace = true;
   gd.grabExcessVerticalSpace = true;
   gd.horizontalAlignment = GridData.CENTER;
   gd.verticalAlignment = GridData.BEGINNING;
   c.setLayoutData(gd);
   if (chooser != null) {
     chooser.createContents(c);
     if (selectedVariables.size() > 0) {
       chooser.setSelectedVariables(selectedVariables);
     }
     if (maxEntries < Short.MAX_VALUE) {
       chooser.setMaximumNumberOfEntries(maxEntries);
     }
   }
   return parent;
 }
 /**
  * Create a drop-down combo box specific for this application
  *
  * @param parent the parent of the new combo box
  * @return the new combo box
  */
 protected Combo createDropDownCombo(Composite parent) {
   Combo combo = new Combo(parent, SWT.DROP_DOWN);
   GridData comboData = new GridData(GridData.FILL_HORIZONTAL);
   comboData.verticalAlignment = GridData.CENTER;
   comboData.grabExcessVerticalSpace = false;
   comboData.widthHint = IDialogConstants.ENTRY_FIELD_WIDTH;
   combo.setLayoutData(comboData);
   return combo;
 }
 /**
  * Create a text field specific for this application
  *
  * @param parent the parent of the new text field
  * @return the new text field
  */
 protected Text createTextField(Composite parent) {
   Text text = new Text(parent, SWT.SINGLE | SWT.BORDER);
   GridData data = new GridData(GridData.FILL_HORIZONTAL);
   data.verticalAlignment = GridData.CENTER;
   data.grabExcessVerticalSpace = false;
   data.widthHint = IDialogConstants.ENTRY_FIELD_WIDTH;
   text.setLayoutData(data);
   return text;
 }
Ejemplo n.º 21
0
 protected static GridData gridDataForText(int span) {
   GridData gd = new GridData();
   gd.horizontalAlignment = GridData.FILL;
   gd.verticalAlignment = GridData.FILL;
   gd.grabExcessHorizontalSpace = true;
   gd.grabExcessVerticalSpace = true;
   gd.horizontalSpan = span;
   return gd;
 }
Ejemplo n.º 22
0
  public SelectFileControl(
      Composite parentComposite,
      String fileName,
      String defaultFileName,
      boolean onlyExisting,
      IFilter resourceFilter) {
    super(parentComposite, SWT.NULL);
    myResourceFilter = resourceFilter;
    mySelectionListeners = new ArrayList<ISelectionListener>();
    myOnlyExisting = onlyExisting;

    myDefaultFileName = defaultFileName == null ? DEFAULT_FNAME : defaultFileName;
    myFileName = fileName == null ? myDefaultFileName : fileName;

    myCreatedFiles = new HashSet<IFile>();

    IResource root = ResourcesPlugin.getWorkspace().getRoot();

    setLayout(new GridLayout());

    myViewer = new TreeViewer(this, SWT.SINGLE | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);

    Label secondLabel = new Label(this, SWT.LEFT);
    secondLabel.setText(Messages.SelectFileControl_SelectedFile);

    myFileNameText = new Text(this, SWT.BORDER);
    myFileNameText.setEnabled(!myOnlyExisting);
    myFileNameText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    myFileNameText.setText(myFileName);
    myFileNameText.addModifyListener(FNAME_LISTENER);

    myViewer.setContentProvider(CONTENT_PROVIDER);
    myViewer.setLabelProvider(new WorkbenchLabelProvider());
    myViewer.setAutoExpandLevel(DEFAUL_AUTO_EXPAND_LEVEL);
    myViewer.addFilter(VIEWER_FILTER);
    myViewer.setSorter(VIEWER_SORTER);
    myViewer.addSelectionChangedListener(VIEWER_LISTENER);

    myViewer.setColumnProperties(new String[] {NAME_COLUMN});
    Tree tree = (Tree) myViewer.getControl();
    myViewer.setCellEditors(
        new CellEditor[] {
          new TextCellEditor(tree, SWT.BORDER | SWT.SINGLE),
        });
    myViewer.setCellModifier(FILE_CELL_MODIFIER);

    GridData data = new GridData();
    data.horizontalAlignment = GridData.FILL;
    data.verticalAlignment = GridData.FILL;
    data.grabExcessVerticalSpace = true;
    data.heightHint = 250;
    data.widthHint = 350;
    myViewer.getControl().setLayoutData(data);
    myViewer.setInput(root);

    hookContextMenu();
  }
Ejemplo n.º 23
0
  /**
   * Constructs an axis canvas with the specified axis and layout.
   *
   * @param axis the axis to associate with the canvas.
   * @param layout the plot layout.
   */
  public AxisRangeCanvas(
      final Composite parent,
      final IPlot plot,
      final IAxis axis,
      final AxisPlacement placement,
      final CanvasLayoutModel layoutModel) {
    super(parent, plot, SWT.NONE);
    _renderer = new DefaultAxisRangeRenderer(this, plot, axis, placement, layoutModel);
    _axis = axis;
    _placement = placement;
    Font font = new Font(null, "SansSerif", 8, SWT.NORMAL);
    _textProperties.setFont(font);
    font.dispose();

    GridData constraints = new GridData();
    constraints.horizontalSpan = 1;
    constraints.verticalSpan = 1;
    constraints.horizontalAlignment = SWT.FILL;
    constraints.verticalAlignment = SWT.FILL;
    if (placement.equals(AxisPlacement.TOP)) {
      constraints.grabExcessHorizontalSpace = true;
      constraints.grabExcessVerticalSpace = false;
      constraints.heightHint = layoutModel.getTopAxisHeight();
    } else if (placement.equals(AxisPlacement.LEFT)) {
      constraints.grabExcessHorizontalSpace = false;
      constraints.grabExcessVerticalSpace = true;
      constraints.widthHint = layoutModel.getLeftAxisWidth();
    } else if (placement.equals(AxisPlacement.RIGHT)) {
      constraints.grabExcessHorizontalSpace = false;
      constraints.grabExcessVerticalSpace = true;
      constraints.widthHint = layoutModel.getRightAxisWidth();
    } else if (placement.equals(AxisPlacement.BOTTOM)) {
      constraints.grabExcessHorizontalSpace = true;
      constraints.grabExcessVerticalSpace = false;
      constraints.heightHint = layoutModel.getBottomAxisHeight();
    } else {
      throw new IllegalArgumentException("Invalid axis placement: " + placement);
    }
    setLayoutData(constraints);
    //    _formatter.setMaximumIntegerDigits(1);
    //    _formatter.setMinimumIntegerDigits(1);
    //    _formatter.setMaximumIntegerDigits(5);
    //    _formatter.setMinimumIntegerDigits(1);
  }
Ejemplo n.º 24
0
Archivo: View.java Proyecto: shader/gdr
  /** Initialize the canvas in the appropriate part of the window */
  public void initCanvas() {
    canvas = new Canvas(shell, SWT.NO_BACKGROUND | SWT.BORDER);

    GridData gridData = new GridData();
    gridData.horizontalAlignment = GridData.FILL;
    gridData.verticalAlignment = GridData.FILL;
    gridData.grabExcessHorizontalSpace = true;
    gridData.grabExcessVerticalSpace = true;
    canvas.setLayoutData(gridData);
  }
Ejemplo n.º 25
0
 /** This method initializes diagramfilteredTree. */
 private void createDiagramfilteredTree() {
   GridData gridData6 = new GridData();
   gridData6.horizontalAlignment = GridData.FILL;
   gridData6.grabExcessHorizontalSpace = true;
   gridData6.grabExcessVerticalSpace = true;
   gridData6.verticalAlignment = GridData.FILL;
   diagramfilteredTree =
       new FilteredTree(diagramListcomposite, SWT.BORDER, new PatternFilter(), true);
   diagramfilteredTree.setLayoutData(gridData6);
 }
 /** This method initializes cTabFolder. */
 private void createCTabFolder() {
   GridData gridData = new GridData();
   gridData.horizontalAlignment = GridData.FILL;
   gridData.grabExcessHorizontalSpace = true;
   gridData.grabExcessVerticalSpace = true;
   gridData.horizontalSpan = 14;
   gridData.verticalAlignment = GridData.FILL;
   cTabFolder = new CTabFolder(hyperLinkShell, SWT.NONE);
   cTabFolder.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WHITE));
   cTabFolder.setLayoutData(gridData);
 }
  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;
  }
Ejemplo n.º 28
0
 /** This method initializes filteredTree. */
 private void createModelFilteredTree() {
   GridData gridData3 = new GridData();
   gridData3.horizontalAlignment = GridData.FILL;
   gridData3.grabExcessHorizontalSpace = true;
   gridData3.grabExcessVerticalSpace = true;
   gridData3.verticalSpan = 3;
   gridData3.verticalAlignment = GridData.FILL;
   modeFilteredTree = new FilteredTree(treeViewcomposite, SWT.BORDER, new PatternFilter(), true);
   modeFilteredTree.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WHITE));
   modeFilteredTree.setLayoutData(gridData3);
 }
Ejemplo n.º 29
0
  private void createLeftPane(final Composite contents) {
    final Composite choiceComposite = new Composite(contents, SWT.NONE);
    final GridData data = new GridData(SWT.FILL, SWT.FILL, true, true);
    data.horizontalAlignment = SWT.END;
    choiceComposite.setLayoutData(data);

    final GridLayout layout = new GridLayout();
    data.horizontalAlignment = SWT.FILL;
    layout.marginHeight = 0;
    layout.marginWidth = 0;
    layout.numColumns = 1;
    choiceComposite.setLayout(layout);

    final Label choiceLabel = new Label(choiceComposite, SWT.NONE);
    choiceLabel.setText(Messages.LoadCustomizationsDialog_AvailiableCustom);

    final GridData choiceLabelGridData = new GridData();
    choiceLabelGridData.verticalAlignment = SWT.FILL;
    choiceLabelGridData.horizontalAlignment = SWT.FILL;
    choiceLabel.setLayoutData(choiceLabelGridData);

    final Text patternText = createFilterText(choiceComposite);

    final Tree availableCustomizationsTree = new Tree(choiceComposite, SWT.MULTI | SWT.BORDER);
    final GridData availableCustomizationsGridData = new GridData();
    availableCustomizationsGridData.widthHint = LoadCustomizationsDialog.TREE_WIDTH;
    availableCustomizationsGridData.heightHint = LoadCustomizationsDialog.TREE_HEIGHT;
    availableCustomizationsGridData.horizontalAlignment = SWT.FILL;
    availableCustomizationsGridData.verticalAlignment = SWT.FILL;
    availableCustomizationsGridData.grabExcessHorizontalSpace = true;
    availableCustomizationsGridData.grabExcessVerticalSpace = true;
    availableCustomizationsTree.setLayoutData(availableCustomizationsGridData);

    this.availableCustomizationsTreeViewer = new TreeViewer(availableCustomizationsTree);
    this.availableCustomizationsTreeViewer.setContentProvider(this.contentProvider);
    this.availableCustomizationsTreeViewer.setLabelProvider(this.labelProvider);
    final PatternFilter filter = new PatternFilter();
    this.availableCustomizationsTreeViewer.addFilter(filter);

    this.availableCustomizationsTreeViewer.setInput(this.availableCustoms);

    // TODO Remove before to commit
    //		final TreeItem treeItem = new TreeItem(availableCustomizationsTree, SWT.NONE);
    //		treeItem.setText(Messages.LoadCustomizationsDialog_Loading);
    // TODO (end) Remove before to commit

    patternText.addModifyListener(
        new ModifyListener() {
          public void modifyText(final ModifyEvent event) {
            filter.setPattern(patternText.getText());
            LoadCustomizationsDialog.this.availableCustomizationsTreeViewer.refresh();
          }
        });
  }
Ejemplo n.º 30
0
  private void createContentComposite(Composite parent) {
    Composite contentComposite = new Composite(parent, SWT.NONE);

    GridData gridData = new GridData();
    gridData.grabExcessHorizontalSpace = true;
    gridData.horizontalAlignment = GridData.FILL;
    gridData.grabExcessVerticalSpace = true;
    gridData.verticalAlignment = GridData.FILL;
    contentComposite.setLayoutData(gridData);

    initialize(contentComposite);
  }