@Override
  public void createCompositeContent(
      Composite parent, TabbedPropertySheetPage aTabbedPropertySheetPage) {
    parent.setLayout(new FillLayout(SWT.VERTICAL | SWT.V_SCROLL));
    super.createCompositeContent(parent, aTabbedPropertySheetPage);

    GridData layoutData;
    TabbedPropertySheetWidgetFactory toolkit = aTabbedPropertySheetPage.getWidgetFactory();
    Composite content = new LayoutComposite(parent);
    Composite outputComposite = toolkit.createFlatFormComposite(content);

    outputComposite.setLayout(new GridLayout(1, true));
    outputLocationPane.createControl(outputComposite, Messages.outputLocationPaneTitle, toolkit);
    layoutData =
        new GridData(GridData.FILL_BOTH | GridData.GRAB_HORIZONTAL | GridData.GRAB_VERTICAL);
    outputLocationPane.getControl().setLayoutData(layoutData);

    Composite root = new LayoutComposite(parent);
    Composite rootComposite = toolkit.createFlatFormComposite(root);
    rootComposite.setLayout(new GridLayout(1, true));
    createRootSection(rootComposite, toolkit);

    rootComposite.layout();
    outputComposite.layout();
  }
  public FeatureSelectionTable(Composite parent, FeatureLayer featureLayer, IPanel panel) {
    BatikApplication.instance().getContext().propagate(this);
    this.featureLayer = featureLayer;
    this.fs = featureLayer.featureSource();
    this.panel = panel;

    parent.setLayout(FormLayoutFactory.defaults().create());

    // topbar
    Composite topbar = on(tk().createComposite(parent)).fill().noBottom().height(36).control();
    topbar.setLayout(FormLayoutFactory.defaults().spacing(10).margins(3).create());

    // closeBtn
    Button closeBtn = tk().createButton(topbar, "", SWT.PUSH, SWT.FLAT);
    closeBtn.setToolTipText("Close table");
    closeBtn.setImage(
        BatikPlugin.images()
            .svgImage(
                "close.svg", SvgImageRegistryHelper.NORMAL12)); // P4Plugin.TOOLBAR_ICON_CONFIG ) );
    on(closeBtn).left(0).top(0).height(26).width(28);
    closeBtn.addSelectionListener(
        selectionListener(
            ev -> {
              close();
            }));

    // title
    Label title = tk().createLabel(topbar, abbreviate(featureLayer.layer().label.get(), 20));
    title.setFont(MdAppDesign.font(FontStyle.Title));
    on(title).top(0, 1).left(closeBtn, -8);

    // seach
    createTextSearch(topbar);
    on(searchText.getControl()).left(title).top(0).width(250);

    // toolbar
    toolbar = tk().createToolbar(topbar, SWT.FLAT);
    on(toolbar.getControl()).fill().noLeft().right(100);
    ContributionManager.instance().contributeTo(toolbar, panel, TOOLBAR_TAG);

    // table viewer
    createTableViewer(parent);
    on(viewer.getTable()).fill().top(topbar);

    // listen to commit events
    EventManager.instance()
        .subscribe(
            this,
            TypeEventFilter.ifType(
                FeatureEvent.class,
                ev -> ev.getType() == Type.COMMIT && ev.getFeatureSource() == fs));

    // listen to click events
    EventManager.instance()
        .subscribe(
            this,
            TypeEventFilter.ifType(
                FeatureClickEvent.class,
                ev -> ev.getSource() == this.featureLayer && ev.clicked.isPresent()));
  }
  @Override
  protected void createMasterPart(IManagedForm managedForm, Composite parent) {
    // TODO Auto-generated method stub
    fManagedForm = managedForm;

    FormToolkit toolkit = managedForm.getToolkit();

    Composite composite = toolkit.createComposite(parent);
    composite.setLayout(new GridLayout(1, false));

    Section section = toolkit.createSection(composite, Section.TITLE_BAR);
    section.setText("overlay");

    Composite viewercomposite = toolkit.createComposite(composite, SWT.NONE);
    viewercomposite.setLayout(new GridLayout(2, false));
    viewercomposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));

    final Tree tree = toolkit.createTree(viewercomposite, SWT.BORDER);
    fTreeViewer = new TreeViewer(tree);
    // fTreeViewer.setContentProvider(new XULTreeContentProvider());
    // fTreeViewer.setLabelProvider(new XULLabelProvider());

    MenuManager menu_manager = new MenuManager();

    // final Action addmenu = new AddAction("add");
    // menu_manager.add(addmenu);

  }
Exemple #4
0
  public void build(final Composite root) {
    this.shell = root.getShell();
    final Composite body = new Composite(root, SWT.BORDER);
    body.setLayout(LayoutUtil.container(2));
    body.setLayoutData(LayoutUtil.hBox(150));

    table = new Table(body, SWT.SINGLE | SWT.FULL_SELECTION | SWT.BORDER);
    table.setHeaderVisible(true);
    table.setLinesVisible(true);
    table.setLayoutData(new GridData(700, 120));

    TableUtil.addColumn(table, "프로젝트 소스", 330);
    TableUtil.addColumn(table, "클래스 수", 100);
    TableUtil.addColumn(table, "전체 라인", 70);
    TableUtil.addColumn(table, "평균 라인", 70);
    TableUtil.addColumn(table, "최대 라인", 70);
    TableUtil.addColumn(table, "최소 라인", 70);

    final Composite btns = new Composite(body, SWT.NONE);
    btns.setLayout(LayoutUtil.container(1));
    btns.setLayoutData(LayoutUtil.FULL);

    addDirectory = BuildUtil.addButton(btns, "디렉토리 추가");
    removeDirectory = BuildUtil.addButton(btns, "디렉토리 삭제");

    final Composite bot = new Composite(root, SWT.BORDER);
    bot.setLayout(new GridLayout());
    bot.setLayoutData(LayoutUtil.FULL);

    dependencyTree = new Tree(bot, SWT.SINGLE | SWT.BORDER | SWT.FULL_SELECTION);
    dependencyTree.setLayoutData(LayoutUtil.FULL);

    addListener();
    initialize();
  }
Exemple #5
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);
  }
  /*
   * @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;
  }
Exemple #7
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);
  }
  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));
  }
Exemple #9
0
  @Override
  protected Control createDialogArea(Composite parent) {
    Composite composite = (Composite) super.createDialogArea(parent);

    composite.setLayout(new FillLayout());

    toolkit = new FormToolkit(composite.getDisplay());
    form = toolkit.createScrolledForm(composite);

    FormColors colors = toolkit.getColors();
    colors.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_INFO_BACKGROUND));

    toolkit.getHyperlinkGroup().setHyperlinkUnderlineMode(HyperlinkSettings.UNDERLINE_HOVER);

    //
    //	toolkit.getHyperlinkGroup().setActiveForeground(Display.getCurrent().getSystemColor(SWT.COLOR_BLUE));
    //		toolkit.getHyperlinkGroup().setForeground(colors.getColor("Categorytitle"));
    toolkit
        .getHyperlinkGroup()
        .setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_INFO_BACKGROUND));

    body = form.getBody();
    GridLayout bodyLayout = new GridLayout();
    bodyLayout.verticalSpacing = 3;
    body.setLayout(bodyLayout);
    //		body.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_INFO_BACKGROUND));
    toolkit.paintBordersFor(body);

    return composite;
  }
  /**
   * This sets the layout of the UI elements in the viewer.
   *
   * @param isMultiline
   */
  private void setLayout(boolean isMultiline) {
    if (isMultiline) {
      MigLayout layout = new MigLayout("insets 0", "[][][][][][][grow]", "[grow][]");
      control.setLayout(layout);

      text.setLayoutData("span,grow,width 200:100%:100%,height 60:100%:100%");
      setPreferredTextSize(40, 5);

      lblAttribute.setLayoutData("cell 0 1,alignx trailing,gapx related");
      attribute.setLayoutData("cell 1 1,wmin 60,alignx left,gapx rel");

      lblOperation.setLayoutData("cell 2 1,alignx trailing,gapx related");
      operation.setLayoutData("cell 3 1,wmin 60,alignx left,gapx rel");

      lblValue.setLayoutData("cell 4 1,alignx trailing,gapx related");
      value.setLayoutData("cell 5 1,wmin 60,alignx left,gapx related");

      insert.setLayoutData("cell 6 1,alignx left,gapx unrel");
    } else {
      control.setLayout(new MigLayout("insets 0, flowx", "", ""));

      text.setLayoutData("grow,width 200:70%:100%, gap unrelated");
      attribute.setLayoutData("width 90:20%:100%, gap related");
      operation.setLayoutData("width 60:10%:100%, gap related");
      value.setLayoutData("width 60:10%:100%, gap related");
      insert.setLayoutData("gap related");
    }
  }
    public Setting(Composite comp, String title) {
      final Composite settingComp = new Composite(comp, SWT.BORDER);
      settingComp.setLayout(new FillLayout(SWT.VERTICAL));

      final RowLayout infoLayout = new RowLayout();
      infoLayout.center = true;

      final Composite infoComp = new Composite(settingComp, SWT.NONE);
      infoComp.setLayout(infoLayout);

      final Label settingLabel = new Label(infoComp, SWT.CENTER);
      settingLabel.setText(title);

      settingValue = new Text(infoComp, SWT.BORDER | SWT.SINGLE);
      settingValue.setText("000");

      settingScale = new Scale(settingComp, SWT.BORDER);
      settingScale.setSize(200, 64);
      settingScale.setMaximum(50);
      settingScale.addListener(
          SWT.Selection,
          new Listener() {
            @Override
            public void handleEvent(Event e) {
              settingValue.setText("" + settingScale.getSelection());
            }
          });
    }
Exemple #12
0
  @Override
  protected Control createDialogArea(Composite parent) {
    final int count = deletables.size();

    setTitle(Messages.DeleteDialog_Title);
    setTitleImage(Activator.getImage("icons/delete_wiz.png")); // $NON-NLS-1$
    setMessage(
        Messages.DeleteDialog_Message_AreYouSure
            + count
            + Messages.DeleteDialog_Message_element
            + (count == 1 ? "" : Messages.DeleteDialog_Message_element_plural)
            + "?"); //$NON-NLS-1$ //$NON-NLS-2$

    final Composite area = (Composite) super.createDialogArea(parent);
    final Composite container = new Composite(area, SWT.NONE);
    container.setLayout(new GridLayout(1, false));
    container.setLayoutData(new GridData(GridData.FILL_BOTH));

    final Composite composite = new Composite(container, SWT.NONE);
    composite.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
    composite.setLayout(new GridLayout(1, false));

    // Button btnDontAskAgain = new Button(composite, SWT.CHECK);
    // btnDontAskAgain.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, true, false, 1, 1));
    // btnDontAskAgain.setText("Don't ask again");

    return area;
  }
  /*
   * (non-Javadoc)
   *
   * @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite)
   */
  @Override
  protected Control createDialogArea(Composite parent) {
    checkNetworkStatus();
    GridData layoutData = new GridData(GridData.FILL_BOTH);
    Composite composite = new Composite(parent, SWT.BORDER);
    GridLayout layout = new GridLayout();
    composite.setLayout(layout);
    composite.setLayoutData(layoutData);
    tableViewerCreator = new TableViewerCreator<ModuleToInstall>(composite);
    tableViewerCreator.setCheckboxInFirstColumn(false);
    tableViewerCreator.setColumnsResizableByDefault(true);
    tableViewerCreator.setLinesVisible(true);
    tableViewerCreator.setLayoutMode(LAYOUT_MODE.CONTINUOUS);

    tableViewerCreator.createTable();

    createJarNameColumn();
    createModuleNameColumn();
    createContextColumn();
    createRequiredColumn();
    createLicenseColumn();

    urlcolumn = createMoreInformationColumn();

    installcolumn = createActionColumn();

    tableViewerCreator.init(inputList);
    addInstallButtons();
    layoutData = new GridData(GridData.FILL_BOTH);
    tableViewerCreator.getTable().setLayoutData(layoutData);
    tableViewerCreator.getTable().pack();

    Composite footComposite = new Composite(composite, SWT.NONE);
    layoutData = new GridData(GridData.FILL_HORIZONTAL);
    footComposite.setLayoutData(layoutData);
    layout = new GridLayout();
    layout.numColumns = 2;
    footComposite.setLayout(layout);

    final Link moreInfor = new Link(footComposite, SWT.NONE);
    layoutData = new GridData(GridData.FILL_HORIZONTAL);
    layoutData.widthHint = 200;
    moreInfor.setText(Messages.getString("ExternalModulesInstallDialog_MoreInfor")); // $NON-NLS-1$
    moreInfor.setLayoutData(layoutData);
    moreInfor.addSelectionListener(
        new SelectionAdapter() {

          @Override
          public void widgetSelected(SelectionEvent e) {
            //
            // Program.launch(Messages.getString("download.external.dialog.help.url"));
            // //$NON-NLS-1$
            openURL(Messages.getString("download.external.dialog.help.url")); // $NON-NLS-1$
          }
        });
    setupColumnSortListener();
    createFooter(composite);
    setTitle(title);
    return composite;
  }
  @Override
  public Composite createContents(Composite parent) {
    composite = new Composite(parent, SWT.NONE);
    final GridLayout layout = new GridLayout();
    layout.marginHeight = 10;
    layout.verticalSpacing = 20;
    composite.setLayout(layout);
    composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));

    Label label = new Label(composite, SWT.WRAP);
    label.setText("Filter out information displayed in the Requests table within the Proxy.");
    label.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));

    Composite treePanel = new Composite(composite, SWT.NONE);
    treePanel.setLayout(new GridLayout(2, false));
    final GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true);
    treePanel.setLayoutData(gd);

    createTreeViewer(treePanel);
    createTreeViewerButtons(treePanel);

    final IWorkspace workspace = Activator.getDefault().getModel().getCurrentWorkspace();
    if (workspace != null) {
      conditionManager = workspace.getHttpConditionMananger();
      conditionSet = conditionManager.getConditionSetCopy("filter");

    } else {
      conditionManager = null;
      conditionSet = null;
    }
    treeViewer.setInput(conditionSet);
    return composite;
  }
Exemple #15
0
  private void fillBody(IManagedForm managedForm, FormToolkit toolkit) {
    Composite body = managedForm.getForm().getBody();
    body.setLayout(FormLayoutFactory.createFormTableWrapLayout(true, 2));

    Composite left = toolkit.createComposite(body);
    left.setLayout(FormLayoutFactory.createFormPaneTableWrapLayout(false, 1));
    left.setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB));
    //		if (isFragment())
    //		fInfoSection = new FragmentMonitorInfoSection(this, left);
    //		else
    //		fInfoSection = new PluginMonitorInfoSection(this, left);

    fInfoSection = new SimpleMonitorInfoSection(this, left);
    //		fInfoSection = new PluginMonitorInfoSection(this, left);
    managedForm.addPart(fInfoSection);
    if (isBundle()) managedForm.addPart(new MonitorExecutionEnvironmentSection(this, left));

    Composite right = toolkit.createComposite(body);
    right.setLayout(FormLayoutFactory.createFormPaneTableWrapLayout(false, 1));
    right.setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB));
    createContentSection(managedForm, right, toolkit);
    if (isEditable() || getPDEEditor().hasInputContext(PluginInputContext.CONTEXT_ID))
      createExtensionSection(managedForm, right, toolkit);
    if (isEditable()) {
      createTestingSection(managedForm, isBundle() ? right : left, toolkit);
    }
    if (isEditable()) createExportingSection(managedForm, right, toolkit);
  }
  public void createControl(Composite parent) {
    Composite composite = new Composite(parent, SWT.NULL);
    composite.setLayout(new GridLayout());
    composite.setLayoutData(
        new GridData(GridData.VERTICAL_ALIGN_FILL | GridData.HORIZONTAL_ALIGN_FILL));
    setControl(composite);

    initializeDialogUnits(parent);

    // Actual contents
    Composite appSettings = new Composite(composite, SWT.NULL);
    appSettings.setLayout(new GridLayout(2, false));

    Label label = new Label(appSettings, SWT.NONE);
    label.setText(Messages.HerokuDeployWizardPage_ApplicationNameLabel);

    appName = new Text(appSettings, SWT.SINGLE | SWT.BORDER);
    appName.setLayoutData(new GridData(250, SWT.DEFAULT));
    // Set default name to project name
    appName.setText(getProjectName());
    appName.addModifyListener(
        new ModifyListener() {

          public void modifyText(ModifyEvent e) {
            getContainer().updateButtons();
          }
        });

    publishButton = new Button(composite, SWT.CHECK);
    publishButton.setText(Messages.HerokuDeployWizardPage_PublishApplicationLabel);
    publishButton.setSelection(
        Platform.getPreferencesService()
            .getBoolean(
                HerokuPlugin.getPluginIdentifier(),
                IPreferenceConstants.HEROKU_AUTO_PUBLISH,
                true,
                null));

    if (doesntHaveGitRepo()) {
      Label note = new Label(composite, SWT.WRAP);
      // We need this italic, we may need to set a font explicitly here to get it
      Font dialogFont = JFaceResources.getDialogFont();
      FontData[] data = SWTUtils.italicizedFont(JFaceResources.getDialogFont());
      final Font italic = new Font(dialogFont.getDevice(), data);
      note.setFont(italic);
      note.addDisposeListener(
          new DisposeListener() {
            public void widgetDisposed(DisposeEvent e) {
              if (!italic.isDisposed()) {
                italic.dispose();
              }
            }
          });

      note.setLayoutData(new GridData(400, SWT.DEFAULT));
      note.setText(Messages.HerokuDeployWizardPage_NoGitRepoNote);
    }

    Dialog.applyDialogFont(composite);
  }
  @Override
  public Control createExampleControl(Composite parent) {
    Composite panel = new Composite(parent, SWT.NONE);
    GridLayout layout = new GridLayout();
    layout.marginHeight = 0;
    layout.marginWidth = 0;
    panel.setLayout(layout);
    GridDataFactory.fillDefaults().grab(true, true).applyTo(panel);

    Composite gridPanel = new Composite(panel, SWT.NONE);
    gridPanel.setLayout(layout);
    GridDataFactory.fillDefaults().grab(true, true).applyTo(gridPanel);

    Composite buttonPanel = new Composite(panel, SWT.NONE);
    buttonPanel.setLayout(new GridLayout());
    GridDataFactory.fillDefaults().grab(true, false).applyTo(buttonPanel);

    // property names of the Person class
    String[] propertyNames = {"firstName", "lastName", "gender", "married", "birthday"};

    // mapping from property to label, needed for column header labels
    Map<String, String> propertyToLabelMap = new HashMap<String, String>();
    propertyToLabelMap.put("firstName", "Firstname");
    propertyToLabelMap.put("lastName", "Lastname");
    propertyToLabelMap.put("gender", "Gender");
    propertyToLabelMap.put("married", "Married");
    propertyToLabelMap.put("birthday", "Birthday");

    IDataProvider bodyDataProvider =
        new DefaultBodyDataProvider<Person>(PersonService.getPersons(100), propertyNames);
    DataLayer bodyDataLayer = new DataLayer(bodyDataProvider);
    SelectionLayer selectionLayer = new SelectionLayer(bodyDataLayer);
    ViewportLayer viewportLayer = new ViewportLayer(selectionLayer);

    // add the PrintCommandHandler to the ViewportLayer in order to make
    // printing work
    viewportLayer.registerCommandHandler(new PrintCommandHandler(viewportLayer));

    final NatTable natTable = new NatTable(gridPanel, viewportLayer, false);

    // adding this configuration adds the styles and the painters to use
    natTable.addConfiguration(new DefaultNatTableStyleConfiguration());
    natTable.addConfiguration(new DefaultPrintBindings());

    natTable.configure();

    GridDataFactory.fillDefaults().grab(true, true).applyTo(natTable);

    Button addColumnButton = new Button(buttonPanel, SWT.PUSH);
    addColumnButton.setText("Print");
    addColumnButton.addSelectionListener(
        new SelectionAdapter() {
          @Override
          public void widgetSelected(SelectionEvent e) {
            natTable.doCommand(new PrintCommand(natTable.getConfigRegistry(), natTable.getShell()));
          }
        });

    return panel;
  }
  public PerspectiveSwitcherBuilder(final Composite parent, final String subSetId) {
    super(parent, subSetId);
    GridLayout glayout = new GridLayout();
    glayout.marginBottom = 0;
    glayout.marginHeight = 0;

    parent.setLayout(glayout);
    background = new Composite(parent, SWT.NONE);
    background.setData(RWT.CUSTOM_VARIANT, ICSSConstants.COMP_TRANS); // $NON-NLS-1$
    background.setLayoutData(new GridData(SWT.RIGHT, SWT.BOTTOM, true, true, 1, 1));
    RowLayout layout = new RowLayout();
    background.setLayout(layout);
    layout.spacing = 4;
    layout.marginBottom = 0;
    layout.marginRight = 10;
    layout.marginTop = 0;
    layout.wrap = false;
    layout.pack = false;
    perspectiveButtonMap = new HashMap<IPerspectiveDescriptor, Button>();
    buttonPerspectiveMap = new HashMap<Button, IPerspectiveDescriptor>();
    buttonList = new ArrayList<Button>();
    perspectiveList = new ArrayList<String>();
    // images
    bgActive = getImage(ILayoutSetConstants.PERSP_BG_ACTIVE);
  }
  @Override
  protected void createContent(Composite parent) {
    final Composite content = new Composite(parent, SWT.NONE);
    content.setLayout(new GridLayout(2, false));
    content.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));

    final Group animGroup = new Group(content, SWT.NONE);
    animGroup.setLayout(new GridLayout(1, false));
    animGroup.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
    animGroup.setText(Messages.AnimationEditor_Animation);

    final TabFolder animationTabs = new TabFolder(animGroup, SWT.TOP);
    final AnimationFrameSelector animationFrameSelector =
        createAnimationFrameSelector(animationTabs);
    final AnimationRenderer animationRenderer = createAnimationRenderer(animationTabs);

    final AnimationProperties animationProperties =
        new AnimationProperties(animationList, animationRenderer);
    animationList.addListener(animationProperties);
    final AnimationPlayer animationPlayer = new AnimationPlayer(animationList, animationRenderer);
    animationPlayer.createAnimationPlayer(animationRenderer.getParent().getParent());

    animationFrameSelector.setAnimationList(animationList);
    animationFrameSelector.setAnimationProperties(animationProperties);
    animationProperties.setAnimationFrameSelector(animationFrameSelector);
    animationRenderer.setAnimationPlayer(animationPlayer);

    final Composite properties = new Composite(content, SWT.NONE);
    properties.setLayout(new GridLayout(1, false));
    properties.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));

    animationList.create(properties);
    animationProperties.create(properties);
    animationList.loadAnimations();
  }
  @Override
  protected Control createContents(Composite parent) {
    Composite container = new Composite(parent, SWT.NONE);

    GridLayout gridLayout = new GridLayout(2, false);

    container.setLayout(gridLayout);

    // Initialize and populate list
    final List list = new List(container, SWT.NONE);
    list.setLayoutData(new GridData(SWT.FILL));
    populateList(list);
    list.setSelection(0);
    list.setSize(10, 20);
    list.addSelectionListener(new SomeSelectionListener(list));

    Composite selectorContainer = new Composite(container, SWT.NONE);
    selectorContainer.setLayout(new GridLayout(1, false));

    // Add color editor
    Composite colorContainer = new Composite(selectorContainer, SWT.NONE);
    color = new ColorFieldEditor(SYNTAXCOLOR_COLOR + SYNTAXCOLOR_KEYWORD, "Color", colorContainer);

    // Create and add style group
    Group styleContainer = new Group(selectorContainer, SWT.NONE);
    styleContainer.setText("Style");

    GridLayout gridLayout2 = new GridLayout(1, false);
    styleContainer.setLayout(gridLayout2);

    Composite styleBoldContainer = new Composite(styleContainer, SWT.NONE);
    Composite styleItalicContainer = new Composite(styleContainer, SWT.NONE);
    Composite styleUnderlineContainer = new Composite(styleContainer, SWT.NONE);
    Composite styleStrikethroughContainer = new Composite(styleContainer, SWT.NONE);

    styleBold =
        new BooleanFieldEditor(SYNTAXCOLOR_BOLD + SYNTAXCOLOR_KEYWORD, "Bold", styleBoldContainer);
    styleItalic =
        new BooleanFieldEditor(
            SYNTAXCOLOR_ITALIC + SYNTAXCOLOR_KEYWORD, "Italic", styleItalicContainer);
    styleUnderline =
        new BooleanFieldEditor(
            SYNTAXCOLOR_UNDERLINE + SYNTAXCOLOR_KEYWORD, "Underline", styleUnderlineContainer);
    styleStrikethrough =
        new BooleanFieldEditor(
            SYNTAXCOLOR_STRIKETHROUGH + SYNTAXCOLOR_KEYWORD,
            "Strike through",
            styleStrikethroughContainer);

    // Link editors with the default preferenceStore
    color.setPreferenceStore(getDefaultPreferenceStore());
    styleBold.setPreferenceStore(getDefaultPreferenceStore());
    styleItalic.setPreferenceStore(getDefaultPreferenceStore());
    styleUnderline.setPreferenceStore(getDefaultPreferenceStore());
    styleStrikethrough.setPreferenceStore(getDefaultPreferenceStore());

    // Load values for keyword
    updateEditors(SYNTAXCOLOR_KEYWORD);
    return container;
  }
 @Override
 protected final Control createContents(final Composite parent) {
   parent.setLayout(noLayout());
   final Composite composite = (Composite) super.createContents(parent);
   composite.setLayout(noLayout());
   return composite;
 }
  @Override
  protected Control createContents(Composite parent) {
    prefAreaComposite = new Composite(parent, SWT.NONE);
    prefAreaComposite.setLayout(new GridLayout());

    Button addBtn = new Button(prefAreaComposite, SWT.PUSH);
    addBtn.setText(Messages.WebLinkPreferencePage_0);
    addBtn.addSelectionListener(
        new SelectionListener() {

          @Override
          public void widgetSelected(SelectionEvent e) {
            elements.add(
                new WebLinkElement(Long.toString(Calendar.getInstance().getTimeInMillis())));
            refreshEditors();
          }

          @Override
          public void widgetDefaultSelected(SelectionEvent e) {}
        });

    editorsComposite = new Composite(prefAreaComposite, SWT.NONE);
    editorsComposite.setLayout(new GridLayout());
    editorsComposite.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));

    refreshEditors();

    return prefAreaComposite;
  }
Exemple #23
0
  /** Create contents of the window. */
  protected void createContents() {
    shell = new Shell(SWT.NO_TRIM | SWT.BORDER);
    shell.setSize(850, 560);
    shell.setLayout(new FillLayout(SWT.HORIZONTAL));
    LayoutUtil.centerShell(Display.getCurrent(), shell);
    Composite composite = new Composite(shell, SWT.NONE);
    composite.setBackgroundImage(SWTResourceManager.getImage(getClass(), "/res/bg.jpg"));
    composite.setBackgroundMode(SWT.INHERIT_FORCE);
    RowLayout rowLayout = new RowLayout(SWT.HORIZONTAL);
    rowLayout.marginTop = 0;
    rowLayout.marginRight = 0;
    rowLayout.marginLeft = 0;
    rowLayout.spacing = 5;
    composite.setLayout(rowLayout);

    winTitle = createWinTitle(composite);
    winToolbar = createWinToolBar(composite);

    Composite winMainContent = new Composite(composite, SWT.NONE);
    winMainContent.setLayout(new StackLayout());
    winMainContent.setLayoutData(new RowData(850, 407));

    winStatusbar = createWinStatusBar(composite);
    addShellListener(winTitle, winToolbar, winStatusbar);
  }
  /* (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;
  }
  /** {@inheritDoc} */
  @Override
  protected void createFieldEditors() {
    disableResolvers =
        new BooleanFieldEditor(
            EMFCompareUIPreferences.DISABLE_RESOLVERS_PREFERENCE,
            EMFCompareIDEUIMessages.getString(
                "ModelResolutionPreferencesPage.disableResolvers"), //$NON-NLS-1$
            getFieldEditorParent());
    addField(disableResolvers);
    useThreads =
        new BooleanFieldEditor(
            EMFCompareUIPreferences.DISABLE_THREADING_PREFERENCE,
            EMFCompareIDEUIMessages.getString(
                "ModelResolutionPreferencesPage.disableThreading"), //$NON-NLS-1$
            getFieldEditorParent());
    addField(useThreads);

    final Composite resolutionScopeComposite = new Composite(getFieldEditorParent(), SWT.BORDER);
    resolutionScopeComposite.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
    resolutionScopeComposite.setLayout(new GridLayout(2, false));

    resolutionScopeMainDescription = new Label(resolutionScopeComposite, SWT.WRAP);
    resolutionScopeMainDescription.setText(
        EMFCompareIDEUIMessages.getString(
            "ModelResolutionPreferencesPage.resolutionScope.description")); //$NON-NLS-1$
    final GridData layoutData = new GridData(GridData.FILL_HORIZONTAL);
    layoutData.widthHint = 400;
    layoutData.horizontalSpan = 2;
    resolutionScopeMainDescription.setLayoutData(layoutData);

    // Use a composite for the combo editor field alone, to prevent it from grabbing all horizontal
    // space.
    resolutionScopeComboComposite = new Composite(resolutionScopeComposite, SWT.NONE);
    resolutionScopeComboComposite.setLayout(new GridLayout(2, false));
    resolutionScope =
        new ComboFieldEditor(
            EMFCompareUIPreferences.RESOLUTION_SCOPE_PREFERENCE,
            EMFCompareIDEUIMessages.getString(
                "ModelResolutionPreferencesPage.resolutionScope"), //$NON-NLS-1$
            scopeNamesAndValues,
            resolutionScopeComboComposite);
    addField(resolutionScope);
    resolutionScopeComboComposite.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false));

    resolutionScopeDescriptionComposite = new Composite(resolutionScopeComposite, SWT.BORDER);
    resolutionScopeDescriptionComposite.setLayout(new GridLayout(1, true));
    GridData descriptionData = new GridData(SWT.FILL, SWT.FILL, true, false);
    descriptionData.widthHint = 200;
    resolutionScopeDescriptionComposite.setLayoutData(descriptionData);

    resolutionScopeDescriptionLabel = new Label(resolutionScopeDescriptionComposite, SWT.WRAP);
    GridData labelData = new GridData(SWT.FILL, SWT.FILL, true, true);
    resolutionScopeDescriptionLabel.setLayoutData(labelData);

    updateFieldEnablement(
        getPreferenceStore().getBoolean(EMFCompareUIPreferences.DISABLE_RESOLVERS_PREFERENCE));
    updateScopeDescription(
        getPreferenceStore().getString(EMFCompareUIPreferences.RESOLUTION_SCOPE_PREFERENCE));
  }
  /**
   * Create contents of the dialog.
   *
   * @param parent
   */
  @Override
  protected Control createDialogArea(Composite parent) {
    setTitle("Select version");
    Composite area = (Composite) super.createDialogArea(parent);
    Composite container = new Composite(area, SWT.NONE);
    container.setLayout(new GridLayout(3, false));
    container.setLayoutData(new GridData(GridData.FILL_BOTH));

    Composite composite = new Composite(container, SWT.NONE);
    composite.setLayout(new FillLayout(SWT.HORIZONTAL));
    composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));

    treeViewer = new TreeViewer(composite);
    treeViewer.setContentProvider(new VersionContentProvider());
    treeViewer.setLabelProvider(new VersionLabelProvider());
    treeViewer.addSelectionChangedListener(
        new ISelectionChangedListener() {
          @Override
          public void selectionChanged(SelectionChangedEvent event) {
            if (((IStructuredSelection) event.getSelection()).getFirstElement()
                instanceof IFileRevision) {
              IFileRevision fileRev =
                  (IFileRevision) (((IStructuredSelection) event.getSelection()).getFirstElement());
              Date date = new Date(fileRev.getTimestamp());
              rsVersion = date.toString();
              requirementSourceSelected =
                  versionManager.loadResource(
                      fileRev,
                      requirementSource.getDataModelURI(),
                      requirementSource.getDefaultScope(),
                      requirementSource.getName());
            } else if (((IStructuredSelection) event.getSelection()).getFirstElement()
                instanceof IFileState) {
              IFileState fileState =
                  (IFileState) (((IStructuredSelection) event.getSelection()).getFirstElement());
              Date date = new Date(fileState.getModificationTime());
              rsVersion = date.toString();
              requirementSourceSelected =
                  versionManager.loadLocalHistoryResource(
                      fileState,
                      requirementSource.getDataModelURI(),
                      requirementSource.getDefaultScope(),
                      requirementSource.getName());
            } else if (((IStructuredSelection) event.getSelection())
                .getFirstElement()
                .equals("Current")) {
              requirementSourceSelected = EcoreUtil.copy(requirementSource);
              rsVersion = "Current";
            } else {
              requirementSourceSelected = null;
            }
            validateInput();
          }
        });
    treeViewer.addDoubleClickListener(this);
    treeViewer.setInput(history.keySet());

    return area;
  }
 private void createRight(final Composite parent) {
   parent.setLayout(new FillLayout());
   Group styleGroup = new Group(parent, SWT.NONE);
   styleGroup.setText("Styles and Parameters");
   styleGroup.setLayout(new FillLayout());
   styleComp = new Composite(styleGroup, SWT.NONE);
   styleComp.setLayout(new RowLayout(SWT.VERTICAL));
 }
  /**
   * Create contents of the wizard.
   *
   * @param parent
   */
  public void createControl(Composite parent) {
    Composite container = new Composite(parent, SWT.NULL);

    setControl(container);
    container.setLayout(new GridLayout(1, false));

    Composite composite = new Composite(container, SWT.NONE);
    composite.setLayout(new GridLayout(2, false));

    Label lblMetaModelThe = new Label(composite, SWT.NONE);
    GridData gd_lblMetaModelThe = new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1);
    gd_lblMetaModelThe.widthHint = 270;
    lblMetaModelThe.setLayoutData(gd_lblMetaModelThe);
    lblMetaModelThe.setText("Meta model the Helper conforms to:");

    comboMM = new Combo(composite, SWT.NONE);
    GridData gd_comboMM = new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1);
    gd_comboMM.widthHint = 330;
    comboMM.setLayoutData(gd_comboMM);

    Composite composite_1 = new Composite(container, SWT.NONE);
    composite_1.setLayout(new GridLayout(2, false));

    Label lblMetaModelType = new Label(composite_1, SWT.NONE);
    GridData gd_lblMetaModelType = new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1);
    gd_lblMetaModelType.widthHint = 270;
    lblMetaModelType.setLayoutData(gd_lblMetaModelType);
    lblMetaModelType.setText("Meta model type of the input port:");

    comboInput = new Combo(composite_1, SWT.NONE);
    comboInput.setEnabled(false);
    GridData gd_comboInput = new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1);
    gd_comboInput.widthHint = 330;
    comboInput.setLayoutData(gd_comboInput);

    Composite composite_2 = new Composite(container, SWT.NONE);
    composite_2.setLayout(new GridLayout(2, false));

    Label lblMetaModelType_1 = new Label(composite_2, SWT.NONE);
    GridData gd_lblMetaModelType_1 = new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1);
    gd_lblMetaModelType_1.widthHint = 270;
    lblMetaModelType_1.setLayoutData(gd_lblMetaModelType_1);
    lblMetaModelType_1.setText("Meta model type of the output port:");

    comboOutput = new Combo(composite_2, SWT.NONE);
    comboOutput.setEnabled(false);
    GridData gd_comboOutput = new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1);
    gd_comboOutput.widthHint = 330;
    comboOutput.setLayoutData(gd_comboOutput);

    setComboMM();
    comboMM.setFocus();
    comboMM.addListener(SWT.Modify, this);
    comboInput.addListener(SWT.Modify, this);
    comboOutput.addListener(SWT.Modify, this);

    this.setPageComplete(false);
  }
  /**
   * 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;
  }
Exemple #30
0
  private void createNonChangingAttributeTypeSelectArea(Composite parent) {
    Group group = new Group(parent, SWT.NONE);
    group.setText("Options");
    group.setLayout(new GridLayout(1, false));
    group.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));

    Composite updateComp = new Composite(group, SWT.NULL);
    updateComp.setLayout(ALayout.getZeroMarginLayout(2, false));
    updateComp.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));

    updateExistingArtifacts = new Button(updateComp, SWT.CHECK);
    updateExistingArtifacts.setText("Update existing child artifacts");
    updateExistingArtifacts.setToolTipText(
        "All imported artifacts will be checked against the root\n"
            + "import artifact and the content will be placed on the artifact\n"
            + "that has the same identifying attributes and level from the root");
    updateExistingArtifacts.setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, false, false));
    updateExistingArtifacts.setSelection(false);

    updateByGuid = new Button(updateComp, SWT.CHECK);
    updateByGuid.setText("by GUID");
    updateByGuid.setToolTipText("Match imported artifacts based on user-supplied GUIDs");
    updateByGuid.setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, false, false));
    updateByGuid.setSelection(false);
    updateByGuid.setEnabled(false);

    deleteUnmatchedArtifacts = new Button(group, SWT.CHECK);
    deleteUnmatchedArtifacts.setText("Delete unmatched artifacts");
    deleteUnmatchedArtifacts.setToolTipText(
        "Any child artifacts that cannot be matched to an imported artifact will be deleted.");
    deleteUnmatchedArtifacts.setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, false, false));
    deleteUnmatchedArtifacts.setSelection(false);
    deleteUnmatchedArtifacts.setEnabled(false);

    final Composite composite = new Composite(group, SWT.NONE);
    composite.setLayout(ALayout.getZeroMarginLayout(1, false));
    composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
    composite.setEnabled(false);
    attributeTypeSelectPanel.createControl(composite);
    attributeTypeSelectPanel.addListener(this);

    updateExistingArtifacts.addListener(SWT.Selection, this);
    updateExistingArtifacts.addSelectionListener(
        new SelectionAdapter() {

          @Override
          public void widgetSelected(SelectionEvent e) {
            boolean isNowSelected = updateExistingArtifacts.getSelection();
            widgetEnabledHelper(composite, isNowSelected);
            deleteUnmatchedArtifacts.setEnabled(isNowSelected);
            deleteUnmatchedArtifacts.setSelection(false);
            updateByGuid.setEnabled(isNowSelected);
            updateByGuid.setSelection(false);
          }
        });
    updateByGuid.addListener(SWT.Selection, this);
    widgetEnabledHelper(composite, false);
  }