Exemple #1
0
  public void remove(MUFModule module) {
    if (playing) {
      delayRemove.offer(module);
      return;
    }

    // set to true
    playing = true;
    adding = false;
    moduleToBeRemoved = module;

    // exclude from layout
    modules.remove(module.getId());
    GridData data = (GridData) module.self.getLayoutData();
    data.exclude = true;
    module.self.setLayoutData(data);
    module.self.setVisible(false);

    if (content.isVisible()) {
      // get destination size
      frame = 1;
      Point newSize = content.computeSize(SWT.DEFAULT, SWT.DEFAULT);
      dx = Math.min(0, (newSize.x - oldSize.x) / FRAMES);
      dy = Math.min(0, (newSize.y - oldSize.y) / FRAMES);
      Display.getCurrent().timerExec(0, runnable);
    } else {
      oldSize = content.computeSize(SWT.DEFAULT, SWT.DEFAULT);
      playing = false;
      delayDispose.offer(module.self);
    }
    module.dispose();
  }
  @Override
  public void build() {
    IWorkbench workbench = PlatformUI.getWorkbench();
    IWorkbenchWindow workbenchWindow = workbench.getActiveWorkbenchWindow();
    workbenchWindow.addPerspectiveListener(perspectiveAdapter);

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

    // Button for the perspective dialog
    Composite otherBg = new Composite(background, SWT.NONE);
    otherBg.setLayout(new FormLayout());
    otherButton = new Button(otherBg, SWT.PUSH | SWT.FLAT);
    FormData fdOther = new FormData();
    otherButton.setLayoutData(fdOther);
    fdOther.left = new FormAttachment(0, left.getBounds().width);
    FormData buttonPos = getLayoutSet().getPosition(ILayoutSetConstants.PERSP_BUTTON_POS);
    fdOther.top = buttonPos.top;
    otherButton.setData(RWT.CUSTOM_VARIANT, "perspective"); // $NON-NLS-1$
    otherButton.setText(Messages.get().PerspectiveSwitcherBuilder_Other);
    IWorkbenchWindow activeWindow = workbench.getActiveWorkbenchWindow();
    final IWorkbenchAction perspectiveAction =
        ActionFactory.OPEN_PERSPECTIVE_DIALOG.create(activeWindow);
    otherButton.addSelectionListener(
        new SelectionAdapter() {
          @Override
          public void widgetSelected(SelectionEvent e) {
            perspectiveAction.run();
          }
        });
  }
Exemple #3
0
  public PriceConfigComposite(Composite parent, IDirtyStateManager dirtyStateManager) {
    super(parent, SWT.NONE, LayoutMode.TIGHT_WRAPPER);

    this.dirtyStateManager = dirtyStateManager;

    stackWrapper = new XComposite(this, SWT.NONE);
    stackLayout = new StackLayout();
    stackWrapper.setLayout(stackLayout);
    stackWrapper.setLayoutData(new GridData(GridData.FILL_BOTH));

    //		priceConfigEditComposite = createPriceConfigEditComposite(stackWrapper);
    //		noPriceConfigAssignedComposite = createNoPriceConfigAssignedComposite(stackWrapper);
    //		stackLayout.topControl = priceConfigEditComposite;
    productTypeNotSetComposite = new XComposite(stackWrapper, SWT.NONE);
    new Label(productTypeNotSetComposite, SWT.NONE)
        .setText(
            Messages.getString(
                "org.nightlabs.jfire.trade.admin.ui.gridpriceconfig.PriceConfigComposite.label.text")); //$NON-NLS-1$
    stackLayout.topControl = productTypeNotSetComposite;

    // Forces the composites to be created.
    getPriceConfigEditComposite();

    // Incorporates the inactivity-timeout, to check if formula is valid while idle after typing.
    initKeyTimeOutListener();
  }
Exemple #4
0
  /**
   * Creates a new ProxyControl as a child of the given parent. This is an invisible dummy control.
   * If given a target, the ProxyControl will update the bounds of the target to match the bounds of
   * the dummy control.
   *
   * @param parent parent composite
   */
  public ProxyControl(Composite parent) {
    // Create the invisible dummy composite
    control = new Composite(parent, SWT.NO_BACKGROUND);
    control.setVisible(false);

    // Attach a layout to the dummy composite. This is used to make the preferred
    // size of the dummy match the preferred size of the target.
    control.setLayout(
        new Layout() {
          protected void layout(Composite composite, boolean flushCache) {
            ProxyControl.this.layout();
            // does nothing. The bounds of the target are updated by the controlListener
          }

          protected Point computeSize(
              Composite composite, int wHint, int hHint, boolean flushCache) {
            if (target == null) {
              // Note: If we returned (0,0), SWT would ignore the result and use a default value.
              return new Point(1, 1);
            }

            return target.computeSize(wHint, hHint);
          }
        });

    // Attach listeners to the dummy
    control.addDisposeListener(disposeListener);
    control.addListener(SWT.Show, visibilityListener);
    control.addListener(SWT.Hide, visibilityListener);
  }
Exemple #5
0
  public void createControl(Composite parent) {
    final Composite panel = new Composite(parent, SWT.NULL);
    panel.setLayout(new GridLayout());

    specsPanel = new RefSpecPanel(panel, pushPage);
    specsPanel.getControl().setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
    specsPanel.addRefSpecTableListener(
        new SelectionChangeListener() {
          public void selectionChanged() {
            checkPage();
          }
        });

    if (!pushPage) {
      final Group tagsGroup = new Group(panel, SWT.NULL);
      tagsGroup.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
      tagsGroup.setText(UIText.RefSpecPage_annotatedTagsGroup);
      tagsGroup.setLayout(new GridLayout());
      tagsAutoFollowButton = new Button(tagsGroup, SWT.RADIO);
      tagsAutoFollowButton.setText(UIText.RefSpecPage_annotatedTagsAutoFollow);
      tagsFetchTagsButton = new Button(tagsGroup, SWT.RADIO);
      tagsFetchTagsButton.setText(UIText.RefSpecPage_annotatedTagsFetchTags);
      tagsNoTagsButton = new Button(tagsGroup, SWT.RADIO);
      tagsNoTagsButton.setText(UIText.RefSpecPage_annotatedTagsNoTags);
    }

    saveButton = new Button(panel, SWT.CHECK);
    saveButton.setLayoutData(new GridData(SWT.LEFT, SWT.FILL, true, false));

    Dialog.applyDialogFont(panel);
    setControl(panel);
    checkPage();
  }
 protected void showTextOnly(boolean show) {
   treeText.setVisible(show);
   ((GridData) treeText.getLayoutData()).exclude = !show;
   dateComposite.setVisible(!show);
   ((GridData) dateComposite.getLayoutData()).exclude = show;
   treeText.getParent().layout(true, true);
 }
  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);
  }
  /**
   * @param parent
   * @return
   */
  public Control createContents(Composite parent) {
    final FormToolkit toolkit = new FormToolkit(parent.getDisplay());
    ScrolledForm sf = toolkit.createScrolledForm(parent);
    Composite comp = sf.getForm().getBody();
    comp.setLayout(new GridLayout(1, true));
    comp.setBackground(parent.getBackground());

    Section brandSection = toolkit.createSection(comp, Section.TITLE_BAR);
    GridData gridData = new GridData(GridData.FILL_HORIZONTAL);
    brandSection.setLayoutData(gridData);
    brandSection.setText("Supported Interaction Types");

    Table table = new Table(comp, SWT.BORDER | SWT.FULL_SELECTION | SWT.CHECK | SWT.SINGLE);
    table.setHeaderVisible(true);
    TableLayout layout = new TableLayout();
    layout.addColumnData(new ColumnWeightData(1));
    table.setLayout(layout);
    TableColumn column = new TableColumn(table, SWT.NONE);
    column.setText("Interaction Type");
    column.setWidth(100);
    column.setResizable(true);
    GridData gd = new GridData(GridData.FILL_HORIZONTAL);
    gd.heightHint = 200;
    table.setLayoutData(gd);

    viewer = new CheckboxTableViewer(table);
    viewer.setContentProvider(new InteractionTypeContentProvider());
    InteractionTypeLabelProvider labelProvider = new InteractionTypeLabelProvider();
    viewer.setLabelProvider(labelProvider);
    viewer.setCheckStateProvider(labelProvider);
    viewer.addCheckStateListener(this);
    viewer.setInput(this);

    return comp;
  }
  @Override
  protected Control createDialogArea(Composite ancestor) {
    Composite parent = (Composite) super.createDialogArea(ancestor);

    final int nOfColumns = 4;

    initializeDialogUnits(ancestor);

    GridLayout layout = (GridLayout) parent.getLayout();
    layout.numColumns = nOfColumns;
    parent.setLayout(layout);

    createAccessorPart(parent, nOfColumns, convertWidthInCharsToPixels(40));

    Separator s = new Separator(SWT.SEPARATOR | SWT.HORIZONTAL);
    s.doFillIntoGrid(parent, nOfColumns);

    createPropertyPart(parent, nOfColumns, convertWidthInCharsToPixels(40));

    Dialog.applyDialogFont(parent);
    PlatformUI.getWorkbench()
        .getHelpSystem()
        .setHelp(parent, IJavaHelpContextIds.EXTERNALIZE_WIZARD_PROPERTIES_FILE_PAGE);
    validateAll();
    return parent;
  }
    /**
     * {@inheritDoc}
     *
     * @see
     *     org.eclipse.jface.dialogs.MessageDialog#createCustomArea(org.eclipse.swt.widgets.Composite)
     */
    @Override
    protected Control createCustomArea(final Composite parent) {
      final Composite panel = new Composite(parent, SWT.NONE);
      panel.setLayout(new GridLayout(2, false));
      panel.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));

      final Label lbl = new Label(panel, SWT.NONE);
      lbl.setText(RestClientI18n.serverPagePasswordLabel);

      final Text txt = new Text(panel, SWT.BORDER);
      txt.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
      txt.setToolTipText(RestClientI18n.serverPagePasswordToolTip);
      txt.addModifyListener(
          new ModifyListener() {

            /**
             * {@inheritDoc}
             *
             * @see
             *     org.eclipse.swt.events.ModifyListener#modifyText(org.eclipse.swt.events.ModifyEvent)
             */
            @Override
            public void modifyText(final ModifyEvent e) {
              handlePasswordChanged(((Text) e.widget).getText());
            }
          });

      return super.createCustomArea(parent);
    }
Exemple #11
0
  public void createControl(Composite parent, IActionBars actionbars) {

    this.content = new Composite(parent, SWT.NONE);
    content.setLayout(new GridLayout(1, false));
    GridUtils.removeMargins(content);
    content.setBackground(Display.getDefault().getSystemColor(SWT.COLOR_WHITE));

    // Make some sashes
    final SashForm horiz = new SashForm(content, SWT.VERTICAL);
    horiz.setBackground(Display.getDefault().getSystemColor(SWT.COLOR_WHITE));
    horiz.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
    final SashForm top = new SashForm(horiz, SWT.HORIZONTAL);
    final SashForm bottom = new SashForm(horiz, SWT.HORIZONTAL);

    // Fill the sashes
    topSystem.createPlotPart(top, "Integration", null, PlotType.XY, getPart());
    Label label = new Label(top, SWT.NONE);
    label.setBackground(Display.getDefault().getSystemColor(SWT.COLOR_WHITE));

    super.createControl(bottom, actionbars);
    rightSystem.createPlotPart(bottom, "Integration", null, PlotType.XY, getPart());

    horiz.setWeights(new int[] {30, 70});
    top.setWeights(new int[] {70, 30});
    bottom.setWeights(new int[] {70, 30});

    topSystem.setShowLegend(false);
    rightSystem.setShowLegend(false);
    profilePlottingSystem.setShowIntensity(false);
  }
  @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();
  }
  public void createControl(Composite parent) {

    Composite pageContent = new Composite(parent, SWT.NONE);
    GridLayout layout = new GridLayout();
    layout.numColumns = 3;
    pageContent.setLayout(layout);
    pageContent.setLayoutData(new GridData(GridData.FILL_BOTH));

    // variable never used ... is pageContent.getLayoutData() needed?
    // GridData outerFrameGridData = (GridData)
    pageContent.getLayoutData();

    //		outerFrameGridData.horizontalAlignment = GridData.HORIZONTAL_ALIGN_FILL;
    //		outerFrameGridData.verticalAlignment = GridData.VERTICAL_ALIGN_FILL;

    //    WorkbenchHelp.setHelp(
    //        pageContent,
    //        B2BGUIContextIds.BTBG_SELECT_MULTI_FILE_PAGE);

    createLabels(pageContent);
    createSourceViewer(pageContent);
    createButtonPanel(pageContent);
    createSelectedListBox(pageContent);
    createImportButton(pageContent);

    setControl(pageContent);
    if (isFileMandatory) setPageComplete(false);
  }
  protected void testQuery() {
    try {
      // ClassArrayShell whether model is null
      if (sqlPredicate == null) {
        MessageDialog.openWarning(top.getShell(), "Warning!", "The predicate is null");
        //		return;
      }
      // ClassArrayShell whether there is a name
      if (textName.getText() == null || textName.getText().trim().length() == 0) {
        MessageDialog.openWarning(top.getShell(), "Warning!", "The predicate should have a name");
        //		return;
      }
      // ClassArrayShell whether there is a data source
      if (sqlPredicate.getDataSource() == null) {
        MessageDialog.openWarning(top.getShell(), "Warning!", "There is no datasource set");
        //		return;
      }

      // ClassArrayShell SQL
      DataSource ds = sqlPredicate.getDataSource();
      Connection con = ds.getConnection();
      java.sql.Statement stmt = con.createStatement();
      final ResultSet rs = stmt.executeQuery(sqlPredicate.getQuery());

      QueryResultsDialog dialog = new QueryResultsDialog(getSite().getShell(), sqlPredicate, rs);
      dialog.create();
      if (dialog.open() != InputDialog.OK) return;
    } catch (Exception x) {
      MessageDialog.openError(top.getShell(), "Error!", "Test has failed");
    }
  }
  /** Creates the GUI. */
  public void createGUI(Composite parent) {

    /** * Create principal GUI layout elements ** */
    Composite displayArea = new Composite(parent, SWT.NONE);
    GridLayout gridLayout = new GridLayout();
    gridLayout.numColumns = 1;
    displayArea.setLayout(gridLayout);

    // Creating these elements here avoids the need to instantiate the GUI elements
    // in strict layout order.  The natural layout ordering is an artifact of using
    // SWT layouts, but unfortunately it is not the same order as that required to
    // instantiate all of the non-GUI application elements to satisfy referential
    // dependencies.  It is possible to reorder the initialization to some extent, but
    // this can be very tedious.

    // paint canvas
    Canvas paintCanvas =
        new Canvas(
            displayArea,
            SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL | SWT.NO_REDRAW_RESIZE | SWT.NO_BACKGROUND);
    GridData gridData = new GridData(GridData.FILL_HORIZONTAL | GridData.FILL_VERTICAL);
    paintCanvas.setLayoutData(gridData);
    // paintCanvas.setBackground(paintColorWhite);

    // status text
    // final Text statusText = new Text(displayArea, SWT.BORDER | SWT.SINGLE | SWT.READ_ONLY);
    // gridData = new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_FILL);
    // statusText.setLayoutData(gridData);

    /** * Create the remaining application elements inside the principal GUI layout elements ** */
    // paintSurface
    // paintSurface = new SWTPaintSurface(paintCanvas, statusText, paintColorWhite, imageBundle);
    paintSurface = new PaintSurface(paintCanvas, imageBundle);
  }
  private void createWidgets() {
    composite.setLayout(GridLayoutFactory.fillDefaults().create());

    tree = new Tree(composite, SWT.NONE);
    applySmallSize(tree);
    tree.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));

    composite.layout();

    TreeItem item = new TreeItem(tree, SWT.NONE);
    item.setText("Special street magic");
    treeViewer = new TreeViewer(tree);
    treeViewer.setLabelProvider(new FileLabelProvider());
    treeViewer.setContentProvider(new FileContentProvider());
    treeViewer.addFilter(
        new ViewerFilter() {

          @Override
          public boolean select(Viewer viewer, Object parentElement, Object element) {
            File file = (File) element;
            return !isBogusFile(file.getName());
          }
        });
    treeViewer.addPostSelectionChangedListener(
        new ISelectionChangedListener() {
          public void selectionChanged(SelectionChangedEvent event) {
            IStructuredSelection selection = (IStructuredSelection) event.getSelection();
            File file = (File) selection.getFirstElement();
            if (file != null) if (!file.isDirectory()) callback.openFile(file);
          }
        });
  }
  @Override
  public Composite createContents(final Composite parent) {
    if (mainComposite != null) {
      return mainComposite;
    }

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

    objects =
        new MyFileListControl(
            mainComposite,
            project.getLocation().toOSString(),
            "additional object files ",
            "object");
    libraries = new MyListControl(mainComposite, "Libraries (-l)", "library");
    librarySearchPath =
        new MyFolderListControl(
            mainComposite,
            project.getLocation().toOSString(),
            "Library search path (-L)",
            "search path");

    disablePredefinedExtrnalDirs = new Button(mainComposite, SWT.CHECK);
    disablePredefinedExtrnalDirs.setText("Disable the entries of predefined libraries");
    disablePredefinedExtrnalDirs.setToolTipText(
        "Right now the OPENSSL_DIR and XMLDIR entries.\n"
            + " Please note that these folders are mandatory for the proper operation of TITAN.");

    return mainComposite;
  }
Exemple #18
0
  private Composite createFileTreeArea(Composite parent) {
    Composite top = new Composite(parent, SWT.NULL);
    top.setLayout(new FormLayout());

    fileBar = new ConfigFileBar(top, SWT.NULL);
    Composite tree = createModePropertyTree(top);

    fileBar.getNewFileButton().addSelectionListener(this);
    fileBar.getDeleteFileButton().addSelectionListener(this);

    FormData layoutData = new FormData();
    layoutData.top = new FormAttachment(0, 0);
    layoutData.left = new FormAttachment(0, 5);
    layoutData.right = new FormAttachment(100, -5);
    fileBar.setLayoutData(layoutData);

    layoutData = new FormData();
    layoutData.top = new FormAttachment(fileBar, 3);
    layoutData.left = new FormAttachment(0, 5);
    layoutData.right = new FormAttachment(100, -5);
    layoutData.bottom = new FormAttachment(100, 5);
    tree.setLayoutData(layoutData);

    return top;
  }
  @SuppressWarnings({"unchecked", "rawtypes"})
  @Override
  public void createControls(Composite parent, TabbedPropertySheetPage aTabbedPropertySheetPage) {
    super.createControls(parent, aTabbedPropertySheetPage);
    Composite composite = getWidgetFactory().createFlatFormComposite(parent);
    TableColumnLayout tableColumnLayout = new TableColumnLayout();
    composite.setLayout(tableColumnLayout);
    FormData data;

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

    columns = new ArrayList();

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

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

    data = new FormData();
    data.left = new FormAttachment(0, 0);
    data.right = new FormAttachment(100, 0);
    data.top = new FormAttachment(0, 0);
    data.bottom = new FormAttachment(100, 0);
    table.setLayoutData(data);
  }
Exemple #20
0
 private Composite createModePropertyTree(Composite parent) {
   Composite top = new Composite(parent, SWT.BORDER);
   top.setLayout(new FillLayout());
   fileTree = new ModePropertyTree(top);
   fileTree.addSelectionChangedListener(new ModePropertyTreeListener());
   return top;
 }
  /**
   * @param composite
   * @return
   */
  private Composite createBooleanConfigurationComposite(Composite composite) {

    Composite booleanComposite = new Composite(composite, SWT.NONE);
    booleanComposite.setLayout(new GridLayout(2, false));
    Label nameLabel = new Label(booleanComposite, SWT.NONE);
    nameLabel.setText(Messages.AddSimulationDataWizardPage_ProbabilityOfTrueLabel);
    Text labelText = new Text(booleanComposite, SWT.BORDER);
    labelText.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
    //        ControlDecoration controlDecoration = new ControlDecoration(labelText,
    // SWT.LEFT|SWT.TOP);
    //        FieldDecoration fieldDecoration = FieldDecorationRegistry.getDefault()
    //                .getFieldDecoration(FieldDecorationRegistry.DEC_ERROR);
    //        controlDecoration.setImage(fieldDecoration.getImage());
    //        controlDecoration.setDescriptionText(Messages.mustBeAPercentage);
    UpdateValueStrategy targetToModel = new UpdateValueStrategy();
    targetToModel.setConverter(
        StringToNumberConverter.toDouble(BonitaNumberFormat.getPercentInstance(), true));
    targetToModel.setAfterGetValidator(
        new ProbabilityValidator(
            new StringToDoubleValidator(
                StringToNumberConverter.toDouble(BonitaNumberFormat.getPercentInstance(), false))));

    Binding provider =
        context.bindValue(
            SWTObservables.observeText(labelText, SWT.Modify),
            PojoObservables.observeValue(this, "probabilityOfTrue"),
            targetToModel,
            new UpdateValueStrategy()
                .setConverter(
                    NumberToStringConverter.fromDouble(
                        BonitaNumberFormat.getPercentInstance(), true)));

    ControlDecorationSupport.create(provider, SWT.TOP | SWT.LEFT);
    return booleanComposite;
  }
  @Override
  public void createControls(Composite parent) {
    AutotoolsConfigurationManager.getInstance().clearTmpConfigurations(page.getProject());
    syncClones();

    super.createControls(parent);
    Composite composite = usercomp;

    settingsStore = AutotoolsConfigurePrefStore.getInstance();
    configToPageListMap = new HashMap<>();

    // assume parent page uses griddata
    GridData gd =
        new GridData(
            GridData.HORIZONTAL_ALIGN_CENTER
                | GridData.VERTICAL_ALIGN_FILL
                | GridData.FILL_HORIZONTAL
                | GridData.FILL_VERTICAL);
    composite.setLayoutData(gd);
    GridLayout layout = new GridLayout();
    composite.setLayout(layout);

    // Create the sash form
    sashForm = new SashForm(usercomp, SWT.NONE);
    sashForm.setOrientation(SWT.HORIZONTAL);
    sashForm.setLayoutData(new GridData(GridData.FILL_BOTH));

    layout = new GridLayout(2, true);
    layout.marginHeight = 5;
    sashForm.setLayout(layout);
    createSelectionArea(sashForm);
    createEditArea(sashForm);
  }
Exemple #23
0
  private void createButtonBarComposite(Composite parent) {
    Composite buttonBarComposite = new Composite(parent, SWT.NONE);

    GridData gridData = new GridData();
    gridData.grabExcessHorizontalSpace = true;
    gridData.horizontalAlignment = GridData.CENTER;
    buttonBarComposite.setLayoutData(gridData);

    RowLayout rowLayout = new RowLayout();
    rowLayout.pack = false;
    buttonBarComposite.setLayout(rowLayout);

    Button okButton = new Button(buttonBarComposite, SWT.PUSH);
    okButton.setText("OK");
    okButton.addSelectionListener(
        new SelectionAdapter() {
          public void widgetSelected(SelectionEvent e) {
            okPressed();
          }
        });

    this.shell.setDefaultButton(okButton);

    Button cancelButton = new Button(buttonBarComposite, SWT.PUSH);
    cancelButton.setText("Cancel");
    cancelButton.addSelectionListener(
        new SelectionAdapter() {
          public void widgetSelected(SelectionEvent e) {
            cancelPressed();
          }
        });
  }
Exemple #24
0
  @Override
  protected Control createUI(Composite parent) {
    Composite composite = UIUtil.createGridComposite(parent, 2);
    composite.setLayoutData(UIUtil.createGridData());

    new Label(composite, SWT.NONE)
        .setText(Messages.getString("BuddiesPreferencePage_0")); // $NON-NLS-1$
    connectorDescription = new Text(composite, SWT.BORDER);
    connectorDescription.setLayoutData(UIUtil.createGridData(true, false));

    new Label(composite, SWT.NONE)
        .setText(Messages.getString("BuddiesPreferencePage_1")); // $NON-NLS-1$
    userID = new Text(composite, SWT.BORDER);
    userID.setLayoutData(new GridData(100, SWT.DEFAULT));

    new Label(composite, SWT.NONE)
        .setText(Messages.getString("BuddiesPreferencePage_2")); // $NON-NLS-1$
    password = new Text(composite, SWT.BORDER | SWT.PASSWORD);
    password.setLayoutData(new GridData(100, SWT.DEFAULT));

    new Label(composite, SWT.NONE);
    autoConnect = new Button(composite, SWT.CHECK);
    autoConnect.setText(Messages.getString("BuddiesPreferencePage_3")); // $NON-NLS-1$

    initValues();
    return composite;
  }
  /* (non-Javadoc)
   * @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite)
   */
  public void createControl(Composite parent) {
    Composite inner = new Composite(parent, SWT.NONE);
    inner.setFont(parent.getFont());

    GridLayout layout = new GridLayout();
    layout.marginHeight = 0;
    layout.marginWidth = 0;
    layout.numColumns = 2;
    inner.setLayout(layout);
    inner.setLayoutData(new GridData(GridData.FILL_BOTH));

    fInclusionPatternList.doFillIntoGrid(inner, 3);
    LayoutUtil.setHorizontalSpan(fInclusionPatternList.getLabelControl(null), 2);
    LayoutUtil.setHorizontalGrabbing(fInclusionPatternList.getListControl(null));

    fExclusionPatternList.doFillIntoGrid(inner, 3);
    LayoutUtil.setHorizontalSpan(fExclusionPatternList.getLabelControl(null), 2);
    LayoutUtil.setHorizontalGrabbing(fExclusionPatternList.getListControl(null));

    setControl(inner);
    Dialog.applyDialogFont(inner);
    if (DLTKCore.DEBUG) {
      System.err.println("SetFilterWizardOage add help support here"); // $NON-NLS-1$
    }
    // PlatformUI.getWorkbench().getHelpSystem().setHelp(inner,
    // IDLTKHelpContextIds.INCLUSION_EXCLUSION_WIZARD_PAGE);
  }
  /**
   * Creates and returns the contents of the upper part of this dialog (above the button bar).
   *
   * @param parent the parent composite to contain the dialog area
   * @return the dialog area control
   */
  protected Control createDialogArea(Composite parent) {
    Composite container = (Composite) super.createDialogArea(parent);
    final GridLayout gridLayout = new GridLayout();
    final GridData gridData = new GridData(GridData.FILL, GridData.FILL, true, true);
    gridLayout.numColumns = 2;
    container.setLayout(gridLayout);
    container.setLayoutData(gridData);

    final Label dialogLabel = new Label(container, SWT.NONE);
    dialogLabel.setLayoutData(
        new GridData(GridData.BEGINNING, GridData.CENTER, false, false, 2, 1));
    dialogLabel.setText(
        "Please, enter the required information:                                       ");

    // *************************************************************
    // Macro Questions
    for (int i = 0; i < questions.length; i++) {

      final Label macroQuestionLabel = new Label(container, SWT.RESIZE | SWT.NONE);
      macroQuestionLabel.setLayoutData(new GridData(GridData.END, GridData.CENTER, false, false));
      macroQuestionLabel.setText(questions[i]);

      Text fieldText = new Text(container, SWT.BORDER);
      macroQuestionField[i] = fieldText;
      macroQuestionField[i].setLayoutData(
          new GridData(GridData.FILL, GridData.CENTER, true, false));
    }

    // **************************************************************
    // Setup listeners for the fields
    setupListeners();

    return container;
  }
  public void createControl(Composite parent) {
    Composite composite = new Composite(parent, SWT.NONE);
    GridLayout layout = new GridLayout();
    layout.numColumns = 1;
    composite.setLayout(layout);
    setControl(composite);

    final List lst = new List(composite, SWT.BORDER);
    lst.setItems(names);
    lst.setLayoutData(new GridData(GridData.FILL_BOTH));
    lst.addSelectionListener(
        new SelectionListener() {

          public void widgetSelected(SelectionEvent e) {
            int sel = lst.getSelectionIndex();
            // recall that we are using TRANSLATED names!
            calculation =
                (CalculationEnum)
                    EnumHelper.getEnumByTranslatedName(CalculationEnum.values(), names[sel]);
          }

          public void widgetDefaultSelected(SelectionEvent e) {}
        });
    lst.setSelection(0);

    PlatformUI.getWorkbench()
        .getHelpSystem()
        .setHelp(getControl(), "Jaspersoft.wizard"); // $NON-NLS-1$
  }
  @Override
  protected Control createContents(Composite parent) {

    Composite rootArea = new Composite(parent, SWT.NONE);
    m_timeChooserContent = new TimeChooserContent(rootArea, m_displayDate, getEnvironment());
    m_timeChooserContent.addTimeChangedListener(
        new AbstractDateSelectionListener() {
          @Override
          public void dateChanged(DateSelectionEvent e) {
            m_returnDate = (Date) e.getData();
            getShell()
                .getDisplay()
                .asyncExec(
                    new Runnable() {
                      @Override
                      public void run() {
                        close();
                      }
                    });
          }
        });
    m_timeChooserContent.setDate(m_displayDate);
    // layout
    rootArea.setLayout(new FormLayout());
    FormData data = new FormData();
    data.top = new FormAttachment(0, 0);
    data.left = new FormAttachment(0, 0);
    data.right = new FormAttachment(100, 0);
    data.bottom = new FormAttachment(100, 0);
    m_timeChooserContent.setLayoutData(data);
    return rootArea;
  }
  /** @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);
  }
Exemple #30
0
  public void add(MUFModule module) {
    if (playing) {
      delayAdd.offer(module);
      return;
    }

    // set to true
    playing = true;
    adding = true;

    // initialize module and add it
    module.create(this);
    modules.put(module.getId(), module);

    if (content.isVisible()) {
      // play a animation
      frame = 1;
      Point moduleSize = module.getPreferredSize();
      dx = Math.max(0, (moduleSize.x - oldSize.x) / FRAMES);
      dy = Math.max(0, moduleSize.y / FRAMES);
      content.pack();
      Display.getCurrent().timerExec(0, runnable);
    } else {
      oldSize = content.computeSize(SWT.DEFAULT, SWT.DEFAULT);
      playing = false;
    }
  }