예제 #1
0
  public BackBoard(Composite parent, int style) {
    super(parent, SWT.NONE);

    this.display = parent.getDisplay();

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

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

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

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

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

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

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

    titleBar.addPaintListener(paintListener);

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

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

    toolBar = new ToolBar(titleBar, SWT.FLAT);
    toolBar.setLayoutData(gridData);
    toolBar.setBackgroundImage(
        Activator.getImageDescriptor("/icons/titleback.gif").createImage(display));
  }
예제 #2
0
  /*
   * @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;
  }
예제 #3
0
  private void createControls() {
    GridLayout gLayout = new GridLayout();
    gLayout.marginHeight = 0;
    gLayout.marginWidth = 0;
    gLayout.verticalSpacing = 0;
    shell.setLayout(gLayout);
    Utils.setShellIcon(shell);

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

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

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

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

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

    shell.layout(true, true);
  }
  @Override
  public 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;
  }
예제 #5
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;
  }
  @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();
  }
예제 #7
0
파일: CodeLine.java 프로젝트: co2y/mypojo
  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();
  }
  @Override
  protected void createSearchControl(
      Composite searchComposite, HashMap<String, Control> bindedControls) {
    searchComposite.setLayout(new FormLayout());

    FormData searchCompositeData = (FormData) searchComposite.getLayoutData();
    searchCompositeData.bottom = new FormAttachment(0, 65);
    searchComposite.setLayoutData(searchCompositeData);

    Composite mainSearch = new Composite(searchComposite, SWT.NONE);
    FormData formData = new FormData();
    formData.left = new FormAttachment(0, 0);
    formData.top = new FormAttachment(0, 0);
    formData.right = new FormAttachment(100, 0);
    formData.bottom = new FormAttachment(100, 0);
    mainSearch.setLayoutData(formData);

    String modelFilePath = "com/hhh/platform/ops/ui/run/LogRunViewSearcher.xml";

    InputStream xmlis = getClass().getClassLoader().getResourceAsStream(modelFilePath);
    XMLModelControlsCreator controlsCreator = new XMLModelControlsCreator(xmlis);

    controlsCreator.createContents(mainSearch);
    bindedControls.putAll(controlsCreator.getBindedControls());
  }
  /*
   * (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;
  }
예제 #10
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);
  }
  /** {@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));
  }
  /* (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;
  }
예제 #13
0
  /**
   * 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;
  }
예제 #14
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);
  }
  /**
   * 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;
  }
  private void createDestinationGroup(Composite parent) {
    GridData gd;
    Font font = parent.getFont();
    // destination specification group
    Composite destinationSelectionGroup = new Composite(parent, SWT.NONE);
    destinationSelectionGroup.setLayout(new GridLayout(2, false));
    destinationSelectionGroup.setLayoutData(
        new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_FILL));
    destinationSelectionGroup.setFont(font);

    Label destinationLabel = new Label(destinationSelectionGroup, SWT.NONE);
    destinationLabel.setText(Messages.TeamProjectIndexExportWizardPage_destinationLabel);
    destinationLabel.setFont(font);
    destinationLabel.setLayoutData(gd = new GridData());
    gd.horizontalSpan = 2;

    // destination name entry field
    fDestinationField = new Text(destinationSelectionGroup, SWT.BORDER);
    fDestinationField.addListener(SWT.Modify, this);
    fDestinationField.addListener(SWT.Selection, this);
    fDestinationField.setFont(font);
    fDestinationField.setLayoutData(gd = new GridData());
    gd.grabExcessHorizontalSpace = true;
    gd.horizontalAlignment = GridData.FILL;
    gd.widthHint = SIZING_TEXT_FIELD_WIDTH;

    Button button =
        createButton(
            destinationSelectionGroup,
            IDialogConstants.CLIENT_ID,
            Messages.TeamProjectIndexExportWizardPage_variableButton,
            false);
    SelectionAdapter listener =
        new SelectionAdapter() {
          @Override
          public void widgetSelected(SelectionEvent e) {
            onInsertVariable();
          }
        };
    button.addSelectionListener(listener);

    // resource snapshot destination group
    Composite resourceSnapshotDestinationGroup = new Composite(parent, SWT.NONE);
    resourceSnapshotDestinationGroup.setLayout(new GridLayout(1, false));
    resourceSnapshotDestinationGroup.setLayoutData(
        new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_FILL));
    resourceSnapshotDestinationGroup.setFont(font);

    fResourceSnapshotButton = new Button(resourceSnapshotDestinationGroup, SWT.CHECK);
    fResourceSnapshotButton.setText(
        Messages.TeamProjectIndexExportWizardPage_resourceSnapshotButton);
    fResourceSnapshotButton.setFont(font);
    fResourceSnapshotButton.setLayoutData(gd = new GridData());
    gd.grabExcessHorizontalSpace = true;
    gd.horizontalAlignment = GridData.FILL;
  }
  public void createControl(Composite parent) {
    mProjectChooserHelper =
        new ProjectChooserHelper(parent.getShell(), new NonLibraryProjectOnlyFilter());
    mDisplay = parent.getDisplay();

    GridLayout gl = null;
    GridData gd = null;

    mTopComposite = new Composite(parent, SWT.NONE);
    mTopComposite.setLayoutData(new GridData(GridData.FILL_BOTH));
    mTopComposite.setLayout(new GridLayout(1, false));

    // composite for the project selection.
    Composite projectComposite = new Composite(mTopComposite, SWT.NONE);
    projectComposite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    projectComposite.setLayout(gl = new GridLayout(3, false));
    gl.marginHeight = gl.marginWidth = 0;

    Label label = new Label(projectComposite, SWT.NONE);
    label.setLayoutData(gd = new GridData(GridData.FILL_HORIZONTAL));
    gd.horizontalSpan = 3;
    label.setText("Select the project to export:");

    new Label(projectComposite, SWT.NONE).setText("Project:");
    mProjectText = new Text(projectComposite, SWT.BORDER);
    mProjectText.setLayoutData(gd = new GridData(GridData.FILL_HORIZONTAL));
    mProjectText.addModifyListener(
        new ModifyListener() {
          public void modifyText(ModifyEvent e) {
            handleProjectNameChange();
          }
        });

    Button browseButton = new Button(projectComposite, SWT.PUSH);
    browseButton.setText("Browse...");
    browseButton.addSelectionListener(
        new SelectionAdapter() {
          @Override
          public void widgetSelected(SelectionEvent e) {
            IJavaProject javaProject =
                mProjectChooserHelper.chooseJavaProject(
                    mProjectText.getText().trim(), "Please select a project to export");

            if (javaProject != null) {
              IProject project = javaProject.getProject();

              // set the new name in the text field. The modify listener will take
              // care of updating the status and the ExportWizard object.
              mProjectText.setText(project.getName());
            }
          }
        });

    setControl(mTopComposite);
  }
예제 #18
0
  public void createControl(Composite parent) {

    Composite main = new Composite(parent, SWT.NONE);
    main.setLayout(new GridLayout(1, false));
    main.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, true));

    new Label(main, SWT.NONE).setText("Choose a script directory to save this script to:");

    scriptDirCombo = new ComboField(main, SWT.BORDER | SWT.DROP_DOWN);
    boolean selected = false;
    for (File dir : ScriptConfiguration.instance().getScriptDirectories()) {
      scriptDirCombo.getCombo().add(dir.getAbsolutePath());

      if (!selected) {
        scriptDirCombo.getCombo().select(0);
        selected = true;
      }
    }
    scriptDirCombo.getCombo().setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

    Label scriptName = new Label(main, SWT.NONE);
    scriptName.setText("Script name:");
    GridData data = new GridData();
    data.verticalIndent = 10;
    scriptName.setLayoutData(data);

    Composite scriptNameComposite = new Composite(main, SWT.NONE);
    GridLayout layout = new GridLayout(2, false);
    layout.horizontalSpacing = 0;
    layout.verticalSpacing = 0;
    layout.marginWidth = 0;
    layout.marginHeight = 0;
    scriptNameComposite.setLayout(layout);
    scriptNameComposite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

    scriptNameText = new TextField(scriptNameComposite, SWT.BORDER);
    scriptExtCombo = new ComboField(scriptNameComposite, SWT.DROP_DOWN);
    selected = false;
    for (IScriptEngine engine : ScriptEngineRegistry.getScriptEngines()) {
      for (String extension :
          ScriptConfiguration.instance().getEngineExtensions(engine.getScriptEngineId())) {
        scriptExtCombo.getCombo().add("." + extension);
        if (!selected) {
          scriptExtCombo.getCombo().select(0);
          selected = true;
        }
      }
    }

    scriptNameText.getTextControl().setLayoutData(new GridData(SWT.FILL, SWT.DEFAULT, true, false));
    scriptExtCombo.getCombo().setLayoutData(new GridData(SWT.DEFAULT, SWT.DEFAULT, false, false));

    setControl(main);
  }
  @Override
  protected void createContent(final Composite parent) {
    mainComposite = getWidgetFactory().createComposite(parent);
    mainComposite.setLayout(createMainCompositeLayout());
    mainComposite.setLayoutData(GridDataFactory.fillDefaults().grab(true, true).create());

    final Composite dataComposite = getWidgetFactory().createComposite(mainComposite);
    dataComposite.setLayoutData(GridDataFactory.fillDefaults().grab(true, true).create());
    dataComposite.setLayout(GridLayoutFactory.fillDefaults().numColumns(2).margins(0, 0).create());
    createDataComposite(dataComposite);
  }
  /** Inhalt der View aufbauen */
  public void createPartControl(Composite parent) {
    parent.setLayoutData(SWTHelper.getFillGridData(1, true, 1, true));
    parent.setLayout(new GridLayout(1, false));

    // SuchForm
    searchForm = new WeisseSeitenSearchForm(parent, SWT.NONE);
    searchForm.addResultChangeListener(
        new Listener() {
          public void handleEvent(Event event) {
            showResult();
          }
        });

    // Liste
    Composite listArea = new Composite(parent, SWT.NONE);
    listArea.setLayoutData(SWTHelper.getFillGridData(1, true, 1, true));
    listArea.setLayout(new GridLayout(1, false));

    searchInfoText = new Text(listArea, SWT.NONE);
    searchInfoText.setEnabled(false);
    searchInfoText.setLayoutData(SWTHelper.getFillGridData(1, true, 1, false));

    Table table = new Table(listArea, SWT.V_SCROLL | SWT.FULL_SELECTION | SWT.MULTI | SWT.BORDER);
    TableColumn nameTc = new TableColumn(table, SWT.CENTER);
    nameTc.setText(Messages.getString("WeisseSeitenSearchView.header.Name")); // $NON-NLS-1$
    nameTc.setWidth(250);
    TableColumn adrTc = new TableColumn(table, SWT.LEFT);
    adrTc.setText(Messages.getString("WeisseSeitenSearchView.header.Adresse")); // $NON-NLS-1$
    adrTc.setWidth(140);
    TableColumn plzTc = new TableColumn(table, SWT.LEFT);
    plzTc.setText(Messages.getString("WeisseSeitenSearchView.header.Plz")); // $NON-NLS-1$
    plzTc.setWidth(40);
    TableColumn ortTc = new TableColumn(table, SWT.LEFT);
    ortTc.setText(Messages.getString("WeisseSeitenSearchView.header.Ort")); // $NON-NLS-1$
    ortTc.setWidth(150);
    TableColumn telTc = new TableColumn(table, SWT.LEFT);
    telTc.setText(Messages.getString("WeisseSeitenSearchView.header.Tel")); // $NON-NLS-1$
    telTc.setWidth(90);

    table.setLayoutData(SWTHelper.getFillGridData(1, true, 1, true));
    table.setHeaderVisible(true);
    table.setLinesVisible(true);

    kontakteTableViewer = new TableViewer(table);
    kontakteTableViewer.setContentProvider(new WhitePageContentProvider());
    kontakteTableViewer.setLabelProvider(new WhitePageLabelProvider());
    kontakteTableViewer.setSorter(new KontaktSorter());
    getSite().setSelectionProvider(kontakteTableViewer);

    makeActions();
    hookContextMenu();
    hookDoubleClickAction();
    contributeToActionBars();
  }
예제 #21
0
  @Override
  protected void createBlockArea(final Composite pageComposite) {
    final Map<Preference<?>, String> prefs = new HashMap<>();

    prefs.put(TaskTagsPreferences.PREF_TAGS, TaskTagsPreferences.GROUP_ID);
    prefs.put(TaskTagsPreferences.PREF_PRIORITIES, TaskTagsPreferences.GROUP_ID);

    setupPreferenceManager(prefs);

    createImages();

    { // Table area
      final Composite composite = new Composite(pageComposite, SWT.NONE);
      composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
      composite.setLayout(LayoutUtil.createCompositeGrid(2));

      final Composite table = createTable(composite);
      table.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));

      this.listButtons =
          new ButtonGroup<TaskTag>(composite) {
            @Override
            protected TaskTag edit1(
                final TaskTag item, final boolean newItem, final Object parent) {
              final TaskTagsInputDialog dialog =
                  new TaskTagsInputDialog(
                      getShell(), item, newItem, TaskTagsConfigurationBlock.this.list);
              if (dialog.open() == Dialog.OK) {
                return dialog.getResult();
              }
              return null;
            }

            @Override
            public void updateState() {
              super.updateState();
              saveTaskTags();
            }
          };
      this.listButtons.setLayoutData(new GridData(SWT.FILL, SWT.TOP, false, true));
      this.listButtons.addAddButton(null);
      this.listButtons.addCopyButton(null);
      this.listButtons.addEditButton(null);
      this.listButtons.addDeleteButton(null);
      this.listButtons.addSeparator();
      this.listButtons.addDefaultButton(null);

      this.listButtons.connectTo(this.listViewer, this.list, this.defaultValue);
      this.listViewer.setInput(this.list);
    }

    updateControls();
  }
예제 #22
0
  Composite createControl(final Composite parent, final PreferencePage prefParent) {
    Composite composite = new Composite(parent, SWT.NONE);
    Font parentFont = parent.getFont();

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

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

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

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

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

    viewer.setInput(impls);

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

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

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

    return composite;
  }
  @Override
  protected void createResultSection(Composite parent) {
    resultSection =
        createSection(
            form,
            parent,
            DefaultMessagesImpl.getString("ColumnAnalysisResultPage.analysisResult"),
            null); //$NON-NLS-1$
    chartTableComposite = toolkit.createComposite(resultSection);
    chartTableComposite.setLayout(new GridLayout());
    chartTableComposite.setLayoutData(new GridData(GridData.FILL_BOTH));

    final ModelElementIndicator[] modelElementIndicatores =
        masterPage.getCurrentModelElementIndicators();

    // ~ MOD mzhao 2009-04-20, Do pagination. Bug 6512.
    uiPagination = new UIPagination(toolkit, chartTableComposite);
    int pageSize = IndicatorPaginationInfo.getPageSize();
    int totalPages = modelElementIndicatores.length / pageSize;
    List<ModelElementIndicator> modelElementIndLs = null;
    for (int index = 0; index < totalPages; index++) {
      modelElementIndLs = new ArrayList<ModelElementIndicator>();
      for (int idx = 0; idx < pageSize; idx++) {
        modelElementIndLs.add(modelElementIndicatores[index * pageSize + idx]);
      }
      IndicatorPaginationInfo pginfo =
          new ResultPaginationInfo(form, modelElementIndLs, masterPage, uiPagination);
      uiPagination.addPage(pginfo);
    }

    int left = modelElementIndicatores.length % pageSize;
    if (left != 0) {
      modelElementIndLs = new ArrayList<ModelElementIndicator>();
      for (int leftIdx = 0; leftIdx < left; leftIdx++) {
        modelElementIndLs.add(modelElementIndicatores[totalPages * pageSize + leftIdx]);
      }
      IndicatorPaginationInfo pginfo =
          new ResultPaginationInfo(form, modelElementIndLs, masterPage, uiPagination);
      uiPagination.addPage(pginfo);
    }
    chartComposite = toolkit.createComposite(chartTableComposite);
    chartComposite.setLayout(new GridLayout());
    chartComposite.setLayoutData(new GridData(GridData.FILL_BOTH));
    // ~
    resultSection.setClient(chartTableComposite);

    uiPagination.setChartComposite(chartComposite);
    uiPagination.init();
    chartComposite.layout();
    chartComposite.pack();
    form.reflow(true);
  }
예제 #24
0
  @Override
  protected Control createDialogArea(final Composite parent) {
    final Composite area = new Composite(parent, SWT.NONE);
    area.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, true));
    area.setLayout(LayoutUtil.applyDialogDefaults(new GridLayout(), 1));

    final Composite checkboxComposite = createCheckboxComposite(area, "&R projects:");
    checkboxComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));

    applyDialogFont(area);

    return area;
  }
예제 #25
0
 private Composite createToolbarComposite(Composite parent) {
   final Composite c = new Composite(parentComposite, SWT.NONE);
   final GridLayout layout = new GridLayout(2, false);
   layout.marginWidth = 0;
   layout.marginHeight = 0;
   layout.horizontalSpacing = 0;
   c.setLayout(layout);
   Composite tb = createLayoutToolBar(c);
   tb.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
   tb = createConfigureToolBar(c);
   tb.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, true));
   return c;
 }
예제 #26
0
  @Override
  protected Control createDialogArea(Composite parent) {
    Composite area = (Composite) super.createDialogArea(parent);
    Composite container = new Composite(area, SWT.NONE);
    container.setLayoutData(new GridData(GridData.FILL_BOTH));
    GridLayout layout = new GridLayout(2, false);
    container.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
    container.setLayout(layout);

    createTextField(container);

    return area;
  }
예제 #27
0
  private void createPlatformSpecificSection(FormToolkit toolkit, Composite parent) {
    fPlatformSectionControls = new ArrayList();
    // Create the section
    Section section = toolkit.createSection(parent, Section.EXPANDED | Section.TWISTIE);
    GridData gd = new GridData(GridData.FILL_BOTH);
    gd.horizontalSpan = 3;
    section.setText(SOAMessages.PlatformSpecificPropLabel);
    section.setLayoutData(gd);

    Composite separator = toolkit.createCompositeSeparator(section);
    gd = new GridData(GridData.FILL_BOTH);
    gd.heightHint = 3;
    separator.setLayoutData(gd);

    Composite client = toolkit.createComposite(section, SWT.WRAP);
    GridLayout layout = new GridLayout();
    layout.numColumns = 1;
    layout.marginWidth = 2;
    layout.marginHeight = 2;
    client.setLayout(layout);

    // Fill the section with components
    Composite fieldComposite = toolkit.createComposite(client);
    layout = new GridLayout(2, false);
    gd = new GridData(GridData.FILL_HORIZONTAL);
    fieldComposite.setLayout(layout);
    fieldComposite.setLayoutData(gd);

    Label cicsUriLabel = toolkit.createLabel(fieldComposite, SOAMessages.CICSURILabel);
    fPlatformSectionControls.add(cicsUriLabel);
    fCICSURIText = toolkit.createText(fieldComposite, "", SWT.SINGLE); // $NON-NLS-1$
    gd = new GridData(GridData.FILL_HORIZONTAL);
    fCICSURIText.setLayoutData(gd);
    fCICSURIText.addModifyListener(
        new ModifyListener() {
          public void modifyText(ModifyEvent e) {
            HandleCICSURIModified();
          }
        });
    fPlatformSectionControls.add(fCICSURIText);
    fSOAPServiceSectionControls.add(fCICSURIText);

    toolkit.paintBordersFor(fieldComposite);
    section.setClient(client);

    if (!EDTCoreIDEPlugin.SUPPORT_SOAP) {
      section.setExpanded(false);
      section.setVisible(false);
    }
  }
예제 #28
0
  private Control createContentsMultiSearch(Composite parent) {
    boolean separateFromTop = false;

    Composite container = new Composite(parent, SWT.NONE);
    container.setLayout(LayoutUtils.createGridLayout(2, 10, 10));

    /* Location */
    IFolder sameParent = getSameParent(fEntities);
    if (sameParent != null) {
      separateFromTop = true;

      Label locationLabel = new Label(container, SWT.None);
      locationLabel.setLayoutData(new GridData(SWT.END, SWT.CENTER, false, false));
      locationLabel.setText(Messages.SearchMarkPropertyPage_LOCATION);

      fFolderChooser = new FolderChooser(container, sameParent, null, SWT.BORDER, true);
      fFolderChooser.setLayoutData(new GridData(SWT.FILL, SWT.BEGINNING, true, false));
      fFolderChooser.setLayout(LayoutUtils.createGridLayout(1, 0, 0, 2, 5, false));
      fFolderChooser.setBackground(
          container.getDisplay().getSystemColor(SWT.COLOR_LIST_BACKGROUND));
    }

    /* Other Settings */
    Composite otherSettingsContainer = new Composite(container, SWT.NONE);
    otherSettingsContainer.setLayout(LayoutUtils.createGridLayout(1, 0, 0));
    otherSettingsContainer.setLayoutData(new GridData(SWT.FILL, SWT.BEGINNING, true, true, 2, 1));

    if (separateFromTop) ((GridLayout) otherSettingsContainer.getLayout()).marginTop = 15;

    /* Name */
    Label nameLabel = new Label(otherSettingsContainer, SWT.None);
    nameLabel.setLayoutData(new GridData(SWT.BEGINNING, SWT.BEGINNING, true, false, 2, 1));
    nameLabel.setText(NLS.bind(Messages.SearchMarkPropertyPage_ADD_TO_ALL, fEntities.size()));

    Composite conditionsContainer = new Composite(otherSettingsContainer, SWT.BORDER);
    conditionsContainer.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 2, 1));
    conditionsContainer.setLayout(LayoutUtils.createGridLayout(1));
    conditionsContainer.setBackground(
        container.getDisplay().getSystemColor(SWT.COLOR_LIST_BACKGROUND));
    conditionsContainer.setBackgroundMode(SWT.INHERIT_FORCE);

    /* Search Conditions List */
    fSearchConditionList =
        new SearchConditionList(conditionsContainer, SWT.None, getDefaultConditions());
    fSearchConditionList.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
    fSearchConditionList.setVisibleItemCount(3);

    return container;
  }
  public Control createContents(Composite parent) {
    main = new Group(parent, SWT.NONE);
    main.setText(Messages.JiraPreferencePageProvider_LBL_Jira);
    main.setLayout(GridLayoutFactory.fillDefaults().create());

    loginComposite = createLoginComponents(main);
    boolean isLoggedOut = isLoggedOut();
    loginComposite.setLayoutData(
        GridDataFactory.fillDefaults().grab(true, false).exclude(!isLoggedOut).create());
    logoutComposite = createLogoutComponents(main);
    logoutComposite.setLayoutData(
        GridDataFactory.fillDefaults().grab(true, false).exclude(isLoggedOut).create());

    return main;
  }
예제 #30
0
  protected void createRESTServicePropertiesSection(FormToolkit toolkit, Composite parent) {
    fRESTServiceSectionControls = new ArrayList();
    // Create the section
    Section section = toolkit.createSection(parent, Section.EXPANDED | Section.TWISTIE);
    section.setText(SOAMessages.TitleSectionRestService);
    GridData gd = new GridData(GridData.FILL_BOTH);
    gd.horizontalSpan = 3;
    section.setLayoutData(gd);

    Composite separator = toolkit.createCompositeSeparator(section);
    gd = new GridData(GridData.FILL_BOTH);
    gd.heightHint = 3;
    separator.setLayoutData(gd);

    Composite client = toolkit.createComposite(section, SWT.WRAP);
    GridLayout layout = new GridLayout();
    layout.numColumns = 1;
    layout.marginWidth = 2;
    layout.marginHeight = 2;
    client.setLayout(layout);

    // Fill the section with components
    Composite fieldComposite = toolkit.createComposite(client);
    int layoutColumn = 3;
    layout = new GridLayout(layoutColumn, false);
    gd = new GridData(GridData.FILL_HORIZONTAL);
    fieldComposite.setLayout(layout);
    fieldComposite.setLayoutData(gd);

    fRestUriLabel = toolkit.createLabel(fieldComposite, SOAMessages.LabelURI);
    fRESTServiceSectionControls.add(fRestUriLabel);
    fRestUri = toolkit.createText(fieldComposite, "", SWT.SINGLE); // $NON-NLS-1$
    gd = new GridData(GridData.FILL_HORIZONTAL);
    gd.horizontalSpan = layoutColumn - 1;
    fRestUri.setLayoutData(gd);
    fRestUri.addModifyListener(
        new ModifyListener() {
          public void modifyText(ModifyEvent e) {
            HandleRestURIModified();
          }
        });
    fRESTServiceSectionControls.add(fRestUri);

    createSpacer(toolkit, fieldComposite, layoutColumn);
    toolkit.paintBordersFor(fieldComposite);

    section.setClient(client);
  }