/**
   * Creates an area to filter types.
   *
   * @param parent area to create controls in
   */
  private void createTypeFilterArea(Composite parent) {
    createLabel(parent, TypeInfoMessages.TypeSelectionDialog_filterLabel);

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

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

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

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

      String name = TypeInfoMessages.TypeSelectionDialog_filterLowLevelTypes;
      Button checkbox = new Button(composite, SWT.CHECK);
      checkbox.setFont(composite.getFont());
      checkbox.setText(name);
      checkbox.setSelection(fFilterMatcher.getShowLowLevelTypes());
      checkbox.addSelectionListener(
          new SelectionAdapter() {
            @Override
            public void widgetSelected(SelectionEvent e) {
              if (e.widget instanceof Button) {
                Button button = (Button) e.widget;
                fFilterMatcher.setShowLowLevelTypes(button.getSelection());
                updateElements();
              }
            }
          });
    }
  }
  protected Control createButtonBar(Composite parent) {
    Composite composite = new Composite(parent, SWT.NONE);
    GridLayout layout = new GridLayout();
    layout.numColumns = 0; // create
    layout.marginHeight = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN);
    layout.marginWidth = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN);
    layout.verticalSpacing = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING);
    layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);

    composite.setLayout(layout);
    composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

    // create help control if needed
    if (isHelpAvailable()) {
      createHelpControl(composite);
    }
    fCustomizeButton =
        createButton(composite, CUSTOMIZE_ID, SearchMessages.SearchDialog_customize, true);

    Label filler = new Label(composite, SWT.NONE);
    filler.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.GRAB_HORIZONTAL));
    layout.numColumns++;

    fReplaceButton =
        createActionButton(composite, REPLACE_ID, SearchMessages.SearchDialog_replaceAction, true);
    fReplaceButton.setVisible(fCurrentPage instanceof IReplacePage);
    Button searchButton =
        createActionButton(composite, SEARCH_ID, SearchMessages.SearchDialog_searchAction, true);
    searchButton.setEnabled(fDescriptors.size() > 0);
    super.createButtonsForButtonBar(composite); // cancel button

    return composite;
  }
Beispiel #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);
  }
Beispiel #4
0
  @Override
  public void createPartControl(Composite parent) {
    createActions();

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

    fDescriptionComposite = null;

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

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

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

    showLatestSearch();
  }
  @Override
  public void createPartControl(Composite parent) {

    FormToolkit toolkit = new FormToolkit(parent.getDisplay());
    m_sform = toolkit.createScrolledForm(parent);
    m_sform.setText("FIAT News Search");
    m_sform.getBody().setLayout(new GridLayout());
    Composite editorComposite = m_sform.getBody();

    GridLayout layout = new GridLayout();
    layout.marginBottom = 10;
    layout.marginTop = 10;
    layout.marginLeft = 10;
    layout.marginRight = 10;
    layout.numColumns = 1;
    layout.makeColumnsEqualWidth = true;
    layout.verticalSpacing = 5;
    layout.horizontalSpacing = 5;
    editorComposite.setLayout(layout);
    editorComposite.setLayoutData(new GridData(GridData.FILL_BOTH));
    createContent(editorComposite, toolkit);
    m_sform.reflow(true);
    m_sform.setFocus();

    m_selectionProvider = new FiatNewsSearchViewSelectionProvider();
    getSite().setSelectionProvider(m_selectionProvider);
    m_SparqlQueryHelper = new SparqlQueryHelper();
  }
  @Override
  public void createControl(Composite parent) {
    Composite container = new Composite(parent, SWT.NONE);
    GridLayout layout = new GridLayout();
    layout.numColumns = 3;
    layout.makeColumnsEqualWidth = false;
    layout.horizontalSpacing = 5;
    layout.verticalSpacing = 10;
    container.setLayout(layout);

    createScrollArea(container);
    createAvailableList(container).setLayoutData(new GridData(GridData.FILL_BOTH));
    createButtonArea(container);
    createImportList(container).setLayoutData(new GridData(GridData.FILL_BOTH));
    updateCount();

    // create container for buttons
    Composite optionComp =
        SWTFactory.createComposite(container, 1, 3, GridData.FILL_HORIZONTAL, 5, 0);
    createComputationsOption(optionComp);
    createFilterOptions(optionComp);

    addViewerListeners();
    initialize();
    addFilters();
    setControl(container);
    Dialog.applyDialogFont(container);
    PlatformUI.getWorkbench()
        .getHelpSystem()
        .setHelp(container, IHelpContextIds.PLUGIN_IMPORT_SECOND_PAGE);
  }
Beispiel #7
0
  public AppBrowser(TabBrowser parent, Workspace workspace_) {
    super(parent, workspace_, SWT.TRANSPARENCY_ALPHA);
    this.workspace = workspace_;

    setBackgroundMode(SWT.INHERIT_DEFAULT);

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

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

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

    initIcons(factory);

    //    configLink.addHyperlinkListener(listener);

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

    //    tab.setStatusBar(statusBar);
  }
  /*
   * @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;
  }
Beispiel #9
0
  @Override
  protected Control createContents(Composite parent) {
    ColorController.assignMethodColors(parent.getDisplay(), mReader.getMethods());
    SelectionController selectionController = new SelectionController();

    GridLayout gridLayout = new GridLayout(1, false);
    gridLayout.marginWidth = 0;
    gridLayout.marginHeight = 0;
    gridLayout.horizontalSpacing = 0;
    gridLayout.verticalSpacing = 0;
    parent.setLayout(gridLayout);

    Display display = parent.getDisplay();
    Color darkGray = display.getSystemColor(SWT.COLOR_DARK_GRAY);

    // Create a sash form to separate the timeline view (on top)
    // and the profile view (on bottom)
    SashForm sashForm1 = new SashForm(parent, SWT.VERTICAL);
    sashForm1.setBackground(darkGray);
    sashForm1.SASH_WIDTH = 3;
    GridData data = new GridData(GridData.FILL_BOTH);
    sashForm1.setLayoutData(data);

    // Create the timeline view
    new TimeLineView(sashForm1, mReader, selectionController);

    // Create the profile view
    new ProfileView(sashForm1, mReader, selectionController);
    return sashForm1;
  }
  /* (non-Javadoc)
   * @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite)
   */
  public void createControl(Composite parent) {
    Composite control = new Composite(parent, SWT.NONE);
    control.setLayoutData(new GridData(GridData.FILL_BOTH));
    GridLayout layout = new GridLayout();
    layout.marginHeight = layout.marginWidth = 15;
    layout.verticalSpacing = 8;
    control.setLayout(layout);

    model.addMember(wizard.getMainShell().getMyModel());
    viewer =
        new TableViewer(control, SWT.V_SCROLL | SWT.FULL_SELECTION | SWT.BORDER | SWT.H_SCROLL);
    viewer.setContentProvider(new ListContentProvider<User>(model.getMembers()));
    viewer.setLabelProvider(new FriendModelLabelProvider());
    viewer.setSorter(new UserQQSorter());

    Table t = viewer.getTable();
    TableColumn tc = new TableColumn(t, SWT.LEFT);
    tc.setText(member_select_qq);
    tc.setWidth(90);
    tc = new TableColumn(t, SWT.CENTER);
    tc.setText(member_select_nick);
    tc.setWidth(150);
    tc = new TableColumn(t, SWT.CENTER);
    tc.setText(member_select_from);
    tc.setWidth(100);
    t.setHeaderVisible(true);
    t.setLinesVisible(false);

    t.setLayoutData(new GridData(GridData.FILL_BOTH));

    viewer.setInput(this);

    setControl(control);
  }
Beispiel #11
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));
  }
  @Override
  protected Control createContent(FormToolkit toolkit, Composite parent) {
    attributesComposite = toolkit.createComposite(parent);
    attributesComposite.addListener(
        SWT.MouseDown,
        new Listener() {
          public void handleEvent(Event event) {
            Control focus = event.display.getFocusControl();
            if (focus instanceof Text && ((Text) focus).getEditable() == false) {
              getManagedForm().getForm().setFocus();
            }
          }
        });

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

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

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

    return attributesComposite;
  }
  /*
   * @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);

    /* Status Label */
    fStatusLabel = new Link(buttonBar, SWT.NONE);
    applyDialogFont(fStatusLabel);
    fStatusLabel.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, true));
    if (StringUtils.isSet(fBookmark.getName())) fStatusLabel.setText(fBookmark.getName());

    /* Close */
    Button closeButton =
        createButton(buttonBar, IDialogConstants.CLOSE_ID, IDialogConstants.CLOSE_LABEL, false);
    closeButton.addSelectionListener(
        new SelectionAdapter() {
          @Override
          public void widgetSelected(SelectionEvent e) {
            close();
          }
        });

    return buttonBar;
  }
 private GridLayout getDialogLayout() {
   GridLayout layout = new GridLayout();
   layout.marginWidth = 0;
   layout.marginHeight = 0;
   layout.verticalSpacing = 0;
   return layout;
 }
  /**
   * Create contents of the dialog.
   *
   * @param parent
   */
  @Override
  protected Control createDialogArea(Composite parent) {
    Composite container = (Composite) super.createDialogArea(parent);
    GridLayout gridLayout = (GridLayout) container.getLayout();
    gridLayout.verticalSpacing = 2;
    gridLayout.horizontalSpacing = 2;
    gridLayout.marginHeight = 2;
    gridLayout.marginWidth = 2;

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

    tadpoleEditor =
        new TadpoleEditorWidget(
            compositeBody, SWT.BORDER, EditorDefine.EXT_JSON, JSONUtil.getPretty(content), "");
    tadpoleEditor.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));

    initUI();

    // google analytic
    AnalyticCaller.track(this.getClass().getName());

    return container;
  }
Beispiel #16
0
  /** @param tabFolder */
  private void createControl(CTabFolder tabFolder) {
    // Create Container
    ScrolledComposite scrolledContainer =
        new ScrolledComposite(tabFolder, SWT.BORDER | SWT.V_SCROLL);

    Composite container = new Composite(scrolledContainer, SWT.NONE);
    GridLayout glayout = new GridLayout();
    glayout.numColumns = 1;
    glayout.marginTop = 0;
    glayout.marginBottom = 0;
    glayout.marginRight = 4;
    glayout.verticalSpacing = 20;
    container.setLayout(glayout);

    // General
    createGeneralGroup(container);

    // SSL
    createSSLGroup(container);

    // HA
    createHAGroup(container);

    // LWT
    createLWTGroup(container);

    scrolledContainer.setContent(container);
    scrolledContainer.setExpandHorizontal(true);
    scrolledContainer.setExpandVertical(true);
    // scrolledContainer.setMinWidth( 1600 );
    scrolledContainer.setMinHeight(900);

    setControl(scrolledContainer);
  }
  @Override
  public void createControl(Composite parent) {
    Composite container = new Composite(parent, SWT.NONE);
    GridLayout layout = new GridLayout();
    layout.numColumns = 2;
    layout.verticalSpacing = 1;
    container.setLayout(layout);
    container.setLayoutData(new GridData(GridData.FILL_BOTH));

    super.createControl(container);

    Label categoryLabel = new Label(container, SWT.NONE);
    categoryCb = new Combo(container, SWT.DROP_DOWN | SWT.READ_ONLY);
    categoryLabel.setText(BundleInternationalization.getString("CategoryLabel") + ":");
    String[] items = new String[Categories.values().length];
    for (int i = 0; i < Categories.values().length; i++) items[i] = Categories.values()[i].name();
    categoryCb.setItems(items);
    categoryCb.addSelectionListener(
        new SelectionAdapter() {
          @Override
          public void widgetSelected(SelectionEvent e) {
            wizardChanged();
          }
        });
    container.layout();
    wizardChanged();
  }
  @Override
  protected Control createContents(Composite parent) {
    project = (IProject) getElement().getAdapter(IProject.class);
    settings = TeaVMEclipsePlugin.getDefault().getSettings(project);

    Composite container = new Composite(parent, SWT.NONE);
    GridLayout layout = new GridLayout(1, false);
    layout.verticalSpacing = 10;
    layout.marginWidth = 10;
    container.setLayout(layout);

    natureButton = new Button(container, SWT.CHECK);
    natureButton.setText("Enable TeaVM");
    natureButton.setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, false, false));

    Control profilesContainer = createProfilesContainer(container);
    profilesContainer.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));

    try {
      natureButton.setSelection(project.hasNature(TeaVMEclipsePlugin.NATURE_ID));
    } catch (CoreException e) {
      reportStatus(e.getStatus());
    }
    loadProfiles();

    return container;
  }
  @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;
  }
 GridLayoutConfig() {
   layout = new GridLayout();
   layout.marginHeight = 0;
   layout.marginWidth = 0;
   layout.verticalSpacing = 0;
   layout.horizontalSpacing = 0;
 }
  @Override
  protected Control createTreeAreaContents(Composite parent) {
    Composite leftArea = new Composite(parent, SWT.NONE);
    leftArea.setBackground(parent.getDisplay().getSystemColor(SWT.COLOR_LIST_BACKGROUND));
    leftArea.setFont(parent.getFont());
    GridLayout leftLayout = new GridLayout();
    leftLayout.numColumns = 1;
    leftLayout.marginHeight = 0;
    leftLayout.marginTop = IDialogConstants.VERTICAL_MARGIN;
    leftLayout.marginWidth = IDialogConstants.HORIZONTAL_MARGIN;
    leftLayout.horizontalSpacing = 0;
    leftLayout.verticalSpacing = 0;
    leftArea.setLayout(leftLayout);

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

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

    layoutTreeAreaControl(leftArea);

    return leftArea;
  }
  @Override
  protected Control createDialogArea(final Composite parent) {
    // parent has GridLayout with 1 column

    ScrolledComposite scrolledComposite =
        new ScrolledComposite(parent, SWT.V_SCROLL | SWT.H_SCROLL);
    scrolledComposite.setLayoutData(SWTHelper.getFillGridData(1, true, 1, true));

    Composite mainArea = new Composite(scrolledComposite, SWT.NONE);

    scrolledComposite.setContent(mainArea);

    GridLayout gridLayout = new GridLayout(1, false);
    gridLayout.verticalSpacing = 10;
    mainArea.setLayout(gridLayout);

    /*
     * createViewer(mainArea);
     */
    createWidgetRows(mainArea);

    // 1)
    // mainArea.setSize(mainArea.computeSize(SWT.DEFAULT, SWT.DEFAULT));
    // 2)
    scrolledComposite.setExpandHorizontal(true);
    scrolledComposite.setExpandVertical(true);
    scrolledComposite.setMinSize(mainArea.computeSize(SWT.DEFAULT, SWT.DEFAULT));

    return scrolledComposite;
  }
  public void createControl(Composite parent) {
    final Composite container = new Composite(parent, SWT.NULL);
    final GridLayout layout = new GridLayout();
    container.setLayout(layout);
    layout.numColumns = 3;
    layout.verticalSpacing = 9;
    final Label label = new Label(container, SWT.NULL);
    label.setText("&Target model:");

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

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

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

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

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

    initialize();
    dialogChanged();
    setControl(container);
  }
  protected Control createListChangeControl(Composite parent) {
    GridData gd;
    Control control;
    if (composite == null) composite = new Composite(parent, SWT.NONE);
    composite.setBackground(parent.getBackground());
    GridLayout gridLayout = new GridLayout(3, false);
    gridLayout.marginHeight = 0;
    gridLayout.marginWidth = 0;
    gridLayout.horizontalSpacing = 0;
    gridLayout.verticalSpacing = 0;
    composite.setLayout(gridLayout);

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

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

    control = getChangeControl(composite);

    return composite;
  }
  private void createFlagsGroup(Composite parent) {
    Font font = parent.getFont();

    Group group = new Group(parent, SWT.NONE);
    GridLayout layout = new GridLayout();
    layout.verticalSpacing = 0;
    layout.numColumns = 1;
    group.setLayout(layout);
    group.setLayoutData(new GridData(GridData.FILL_BOTH));
    group.setFont(font);
    group.setText("Flags");

    rd_button = new Button(group, SWT.CHECK);
    rd_button.setFont(font);
    rd_button.setText("Data read");
    rd_button.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    rd_button.setEnabled(enable_editing);

    wr_button = new Button(group, SWT.CHECK);
    wr_button.setFont(font);
    wr_button.setText("Data write");
    wr_button.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    wr_button.setEnabled(enable_editing);

    ex_button = new Button(group, SWT.CHECK);
    ex_button.setFont(font);
    ex_button.setText("Instructions read");
    ex_button.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    ex_button.setEnabled(enable_editing);
  }
 /* (non-Javadoc)
  * @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite)
  */
 protected Control createDialogArea(Composite parent) {
   getShell().setText(Messages.getString("dialogs.OrganizeTestTextDialog.title")); // $NON-NLS-1$
   // create a composite with standard margins and spacing
   Composite composite = new Composite(parent, SWT.NONE | SWT.RESIZE);
   GridLayout layout = new GridLayout();
   layout.marginHeight = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN);
   layout.marginWidth = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN);
   layout.verticalSpacing = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING);
   layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
   layout.numColumns = 2;
   composite.setLayout(layout);
   composite.setLayoutData(new GridData(GridData.FILL_BOTH));
   applyDialogFont(composite);
   switch (type) {
     case TYPE_SAVE:
       return createDialogAreaContentsForSave(composite);
     case TYPE_LOAD:
       return createDialogAreaContentsForLoad(composite);
     case TYPE_ORGANIZE:
       return createDialogAreaContentsForOrganize(composite);
     default:
       throw new IllegalStateException(
           Messages.getString("dialogs.OrganizeTestTextDialog.errror.message1")
               + type); //$NON-NLS-1$
   }
 }
  public FilterAdvancedComposite(
      final FilterChangedListener filterChangedListener, final Composite parent, final int style) {
    // fields
    super(parent, style);

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

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

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

    final GridData addOrConditionButtonLayoutdata = new GridData();
    addOrConditionButtonLayoutdata.horizontalAlignment = GridData.END;
    this.addOrConditionButton.setLayoutData(addOrConditionButtonLayoutdata);
  }
Beispiel #28
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;
  }
  /** @see IDialogPage#createControl(Composite) */
  public void createControl(Composite parent) {
    Composite container = new Composite(parent, SWT.NULL);
    GridLayout layout = new GridLayout();
    container.setLayout(layout);
    layout.numColumns = 2;
    layout.verticalSpacing = 9;
    Label lblprojectName = new Label(container, SWT.NULL);
    lblprojectName.setText("&Project name:");

    projectName = new Text(container, SWT.BORDER | SWT.SINGLE);
    projectName.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));
    projectName.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    projectName.addModifyListener(
        new ModifyListener() {
          public void modifyText(ModifyEvent e) {
            dialogChanged();
          }
        });

    Label lblExamples = new Label(container, SWT.NULL);
    lblExamples.setText("&Create example data");

    examples = new Button(container, SWT.CHECK);
    examples.setSelection(false);

    dialogChanged();
    setControl(container);
  }
Beispiel #30
0
  private void createBundleTreeViewer(Composite container) {

    GridLayout gridLayout = new GridLayout();
    gridLayout.numColumns = 1;
    gridLayout.horizontalSpacing = 0;
    gridLayout.verticalSpacing = 0;
    gridLayout.marginWidth = 0;
    gridLayout.marginHeight = 0;

    bundleTreeViewerComposite = new Composite(container, SWT.NONE);
    bundleTreeViewerComposite.setLayout(gridLayout);

    bundleTreeViewer =
        new TreeViewer(
            bundleTreeViewerComposite,
            SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER | SWT.FULL_SELECTION);
    bundleTreeViewer.setUseHashlookup(true);

    GridData gd = new GridData(GridData.FILL, GridData.FILL, true, true);

    bundleTreeViewer.getTree().setLayoutData(gd);
    bundleTreeViewer.getTree().setHeaderVisible(true);

    TreeViewerColumn treeColumn = new TreeViewerColumn(bundleTreeViewer, SWT.NONE);
    treeColumn.getColumn().setText(Messages.symbNameResources);
    treeColumn.getColumn().setWidth(610);
    treeColumn.setLabelProvider(new TreeLabelProvider());

    bundleTreeViewer.setContentProvider(bundleTreeViewerProvider);
    bundleTreeViewer.setAutoExpandLevel(3);
  }