コード例 #1
0
ファイル: View.java プロジェクト: willuhn/jameica
  /** Leert die Anzeige. Wird beim Wechsel von einem Dialog auf den naechsten aufgerufen. */
  protected void cleanContent() {
    if (content != null && !content.isDisposed()) content.dispose();

    if (scroll != null && !scroll.isDisposed()) scroll.dispose();

    if (Customizing.SETTINGS.getBoolean("application.scrollview", false)) {
      scroll = new ScrolledComposite(view, SWT.V_SCROLL | SWT.H_SCROLL);
      scroll.setLayoutData(new GridData(GridData.FILL_BOTH));
      scroll.setLayout(SWTUtil.createGrid(1, true));
      scroll.setExpandHorizontal(true);
      scroll.setExpandVertical(true);
      scroll.setMinHeight(Customizing.SETTINGS.getInt("application.scrollview.minheight", 580));

      content = new Composite(scroll, SWT.NONE);
      scroll.setContent(content);
    } else {
      content = new Composite(view, SWT.NONE);
    }

    content.setLayoutData(new GridData(GridData.FILL_BOTH));
    GridLayout l = new GridLayout();
    l.marginHeight = 6;
    l.marginWidth = 6;
    content.setLayout(l);

    if (this.titlePart != null) {
      this.titlePart.clearButtons();
      this.titlePart.addButton(new PanelButtonBack()); // Zurueckbutton ist immer dabei
    }

    if (notifications != null) notifications.reset();

    setTitle(null);
  }
コード例 #2
0
  @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;
  }
コード例 #3
0
ファイル: OptionsTab.java プロジェクト: Flavialice/workHard
  /** @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);
  }
コード例 #4
0
  public static void main(String[] args) {
    Display display = new Display();
    Shell shell = new Shell(display);
    shell.setLayout(new GridLayout());
    final ScrolledComposite sc =
        new ScrolledComposite(shell, SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL);
    sc.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
    Composite c = new Composite(sc, SWT.NONE);
    c.setLayout(new GridLayout(10, true));
    for (int i = 0; i < 300; i++) {
      Button b = new Button(c, SWT.PUSH);
      b.setText("Button " + i);
    }
    sc.setContent(c);
    sc.setExpandHorizontal(true);
    sc.setExpandVertical(true);
    sc.setMinSize(c.computeSize(SWT.DEFAULT, SWT.DEFAULT));
    sc.setShowFocusedControl(true);

    shell.setSize(300, 500);
    shell.open();
    while (!shell.isDisposed()) {
      if (!display.readAndDispatch()) display.sleep();
    }
    display.dispose();
  }
コード例 #5
0
  private void createControlsPanel(Composite theParent) {
    ScrolledComposite scroller =
        new ScrolledComposite(theParent, SWT.V_SCROLL | SWT.H_SCROLL | SWT.BORDER);

    GridLayout scrolledLayout = new GridLayout();
    scrolledLayout.marginLeft = 5;
    scrolledLayout.marginRight = 5;
    scroller.setLayout(scrolledLayout);

    scroller.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    scroller.setExpandHorizontal(true);
    scroller.setExpandVertical(true);
    scroller.setMinWidth(900);
    scroller.setMinHeight(270);

    Group controlsGroup = WidgetFactory.createGroup(scroller, EDIT_TXT);
    GridLayout controlsLayout = new GridLayout();
    controlsLayout.marginLeft = 0;
    controlsLayout.marginRight = 0;
    controlsGroup.setLayout(controlsLayout);
    controlsGroup.setLayoutData(new GridData(GridData.FILL_BOTH));

    createResolveAttributePanel(controlsGroup);
    createResolveSqlPanel(controlsGroup);

    scroller.setContent(controlsGroup);
  }
コード例 #6
0
  /**
   * Create contents of the wizard.
   *
   * @param parent
   */
  @Override
  public void createControl(Composite parent) {
    ScrolledComposite scrolledComposite =
        new ScrolledComposite(parent, SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL);
    setControl(scrolledComposite);
    scrolledComposite.setExpandHorizontal(true);
    scrolledComposite.setExpandVertical(true);

    Composite composite = new Composite(scrolledComposite, SWT.NONE);
    scrolledComposite.setSize(500, 500);
    composite.setLayout(new GridLayout(1, false));
    radioButtons = new Button[imNames.length];
    for (int i = 0; i < imNames.length; i++) {
      radioButtons[i] = new Button(composite, SWT.RADIO);
      radioButtons[i].setImage(
          sia.ui.org.eclipse.wb.swt.SWTResourceManager.getImage(
              ImportChooseIM.class,
              "/sia/ui/resources/ims/"
                  + Dictionaries.getInstance().getDataSources().get(imNames[i])
                  + ".png"));
      radioButtons[i].setText(imNames[i]);
      radioButtons[i].addSelectionListener((ImportWizard) getWizard());
    }

    scrolledComposite.setContent(composite);
    scrolledComposite.setMinSize(composite.computeSize(SWT.DEFAULT, SWT.DEFAULT));
  }
コード例 #7
0
ファイル: VNCViewerView.java プロジェクト: eclipse/sequoyah
  public void createPartControl(Composite parent) {

    final ScrolledComposite scomposite =
        new ScrolledComposite(parent, SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);

    swtDisplay = (SWTRemoteDisplay) RemoteDisplayFactory.getDisplay(SWTDISPLAY, scomposite);
    running = true;

    scomposite.setContent(swtDisplay);
    scomposite.setExpandHorizontal(true);
    scomposite.setExpandVertical(true);

    swtDisplay
        .getCanvas()
        .addControlListener(
            new ControlListener() {
              public void controlMoved(ControlEvent e) {}

              public void controlResized(ControlEvent e) {
                Point size = swtDisplay.getCanvas().getSize();
                scomposite.setMinSize(swtDisplay.getParent().computeSize(size.x, size.y));
              }
            });

    swtDisplay.getCanvas().setSize(0, 0);

    if (VNCViewerView.protocolHandle != null) {
      try {
        swtDisplay.start(protocolHandle);
      } catch (Exception e) {
        // TODO handle properly
        e.printStackTrace();
      }
    }
  }
コード例 #8
0
  /**
   * Implement the user interface for the preference page. Returns a control that should be used as
   * the main control for the page.
   *
   * <p>User interface defined here supports the definition of preference settings used by the
   * management logic. {@inheritDoc}
   */
  protected Control createContents(Composite parent) {
    /** Add layer to parent widget */
    final ScrolledComposite scrollComposite =
        new ScrolledComposite(parent, SWT.V_SCROLL | SWT.H_SCROLL);
    final Composite composite = new Composite(scrollComposite, SWT.NONE);

    /** Define laout rules for widget placement */
    compositeGridData(composite, 1);
    // add widgets to composite
    createShowContainerCount(composite);
    createShortCutsArea(composite);
    // context sensitive help
    Plugin.getHelpSystem().setHelp(parent, ContextHelpIds.PREFPAGE_OBJECT_MAP);
    initPreferences();
    scrollComposite.setContent(composite);
    scrollComposite.setExpandHorizontal(true);
    scrollComposite.setExpandVertical(true);
    scrollComposite.setMinSize(composite.computeSize(SWT.DEFAULT, SWT.DEFAULT));
    scrollComposite.addControlListener(
        new ControlAdapter() {
          public void controlResized(ControlEvent e) {
            scrollComposite.setMinSize(composite.computeSize(SWT.DEFAULT, SWT.DEFAULT));
          }
        });
    return scrollComposite;
  }
コード例 #9
0
  @Override
  public void setActiveTab(ILaunchConfigurationTab tab) {
    if (activeTab != null) {
      activeTab.deactivated(workingCopy);
      activeTab.getControl().dispose();
    }

    activeTab = tab;

    if (activeTab != null) {
      launchConfigArea.setRedraw(false);

      configNameText.setVisible(true);

      activeTab.createControl(launchConfigArea);
      //      GridDataFactory.swtDefaults().grab(true, false).align(SWT.FILL,
      // SWT.BEGINNING).applyTo(
      //          activeTab.getControl());
      launchConfigArea.setContent(activeTab.getControl());
      activeTab.getControl().setSize(activeTab.getControl().computeSize(SWT.DEFAULT, SWT.DEFAULT));
      configUI.layout(true);

      activeTab.activated(workingCopy);

      launchConfigArea.setRedraw(true);
    } else {
      configNameText.setVisible(false);
    }

    updateButtons();
    updateMessage();
  }
コード例 #10
0
 /** Overrides 'super' to pass the proper colors and font */
 @Override
 public void setContent(Control content) {
   super.setContent(content);
   if (content != null) {
     content.setForeground(getForeground());
     content.setBackground(getBackground());
     content.setFont(getFont());
   }
 }
コード例 #11
0
  /**
   * Set the major UI features of this basic view composite
   *
   * @param textEditor
   * @param parentComposite
   * @param styleBit
   */
  public Transition(final XMLEditor textEditor, final Composite parentComposite, int styleBit) {
    super(parentComposite, SWT.BORDER);
    setBackground(SWTResourceManager.getColor(SWT.COLOR_DARK_MAGENTA));
    this.textEditor = textEditor;
    addDisposeListener(
        new DisposeListener() {
          @Override
          public void widgetDisposed(DisposeEvent e) {
            toolkit.dispose();
          }
        });
    toolkit.adapt(this);
    toolkit.paintBordersFor(this);
    setLayout(new FormLayout());
    setLayoutData(new GridData(GridData.FILL_BOTH));

    final ScrolledComposite parentScrolledComposite =
        new ScrolledComposite(this, SWT.BORDER | SWT.V_SCROLL);
    parentScrolledComposite.setAlwaysShowScrollBars(true);
    parentScrolledComposite.setExpandHorizontal(true);
    parentScrolledComposite.setExpandVertical(true);
    FormData parentScrolledCompositeFormLayoutData = new FormData();
    parentScrolledCompositeFormLayoutData.right = new FormAttachment(100);
    parentScrolledCompositeFormLayoutData.bottom = new FormAttachment(100);
    parentScrolledCompositeFormLayoutData.top = new FormAttachment(0, 5);
    parentScrolledCompositeFormLayoutData.left = new FormAttachment(0, 5);
    parentScrolledComposite.setLayoutData(parentScrolledCompositeFormLayoutData);
    this.setData(parentScrolledComposite);

    baseContainer = new Composite(parentScrolledComposite, SWT.NONE);
    baseContainer.setBackground(SWTResourceManager.getColor(204, 153, 255));
    parentScrolledComposite.setContent(baseContainer);

    baseContainer.setLayout(new GridLayout(1, true));
    try {
      CentralUtils centralUtils = CentralUtils.getCentralUtils(textEditor);
      centralUtils.setBasicUI(parentScrolledComposite, baseContainer);
      centralUtils.unmarshal(textEditor);
    } catch (JAXBException e) {
      LOG.info(e.getMessage());
    }

    // create a THumanInteractions object if humanInteractions variable is
    // null
    if (textEditor.getRootElement() == null) {
      humanInteractions = new THumanInteractions();
      textEditor.setRootElement(humanInteractions);
    }
    try {
      // create the biggest xml element- UI section
      humanInteractionsUI =
          new THumanInteractionsUI(
              textEditor, baseContainer, this, SWT.NONE, textEditor.getRootElement(), 0, 0);
    } catch (JAXBException e1) {
      LOG.info(e1.getMessage());
    }
  }
コード例 #12
0
  /**
   * DOC ocarbone Comment method "addTreeNavigator".
   *
   * @param parent
   * @param width
   * @param height
   */
  private void addTreeNavigator(Composite parent, int width, int height) {
    // Group
    Group group =
        Form.createGroup(
            parent,
            1,
            Messages.getString("DatabaseTableForm.navigatorTree"),
            height); //$NON-NLS-1$

    // ScrolledComposite
    ScrolledComposite scrolledCompositeFileViewer =
        new ScrolledComposite(group, SWT.H_SCROLL | SWT.V_SCROLL | SWT.NONE);
    scrolledCompositeFileViewer.setExpandHorizontal(true);
    scrolledCompositeFileViewer.setExpandVertical(true);
    GridData gridData1 = new GridData(GridData.FILL_BOTH);
    gridData1.widthHint = width + 12;
    gridData1.heightHint = height;
    gridData1.horizontalSpan = 2;
    scrolledCompositeFileViewer.setLayoutData(gridData1);

    tableViewerCreator = new TableViewerCreator(scrolledCompositeFileViewer);
    tableViewerCreator.setHeaderVisible(false);
    tableViewerCreator.setColumnsResizableByDefault(false);
    tableViewerCreator.setBorderVisible(false);
    tableViewerCreator.setLinesVisible(false);
    tableViewerCreator.setLayoutMode(LAYOUT_MODE.NONE);
    tableViewerCreator.setCheckboxInFirstColumn(false);
    tableViewerCreator.setFirstColumnMasked(false);

    tableNavigator = tableViewerCreator.createTable();
    tableNavigator.setLayoutData(new GridData(GridData.FILL_BOTH));

    TableColumn tableColumn = new TableColumn(tableNavigator, SWT.NONE);
    tableColumn.setText(
        Messages.getString("DatabaseTableForm.tableColumnText.talbe")); // $NON-NLS-1$
    tableColumn.setWidth(width + 120);

    scrolledCompositeFileViewer.setContent(tableNavigator);
    scrolledCompositeFileViewer.setSize(width + 12, height);

    // // Button Add metadata Table
    Composite button =
        Form.startNewGridLayout(group, HEIGHT_BUTTON_PIXEL, false, SWT.CENTER, SWT.CENTER);
    addTableButton =
        new UtilsButton(
            button,
            Messages.getString("DatabaseTableForm.AddTable"),
            width - 30,
            HEIGHT_BUTTON_PIXEL); //$NON-NLS-1$

    Composite rmButton =
        Form.startNewGridLayout(group, HEIGHT_BUTTON_PIXEL, false, SWT.CENTER, SWT.CENTER);
    removeTableButton =
        new UtilsButton(rmButton, "Remove Schema", width - 30, HEIGHT_BUTTON_PIXEL); // $NON-NLS-1$
  }
コード例 #13
0
  @Test
  public void testRenderInitialOrigin() throws IOException {
    Composite content = new Composite(sc, SWT.NONE);
    sc.setContent(content);

    lca.render(sc);

    TestMessage message = Fixture.getProtocolMessage();
    assertNull(message.findSetOperation(hScroll, "selection"));
    assertNull(message.findSetOperation(vScroll, "selection"));
  }
コード例 #14
0
  @Test
  public void testRenderContent() throws IOException {
    Composite content = new Composite(sc, SWT.NONE);
    String contentId = WidgetUtil.getId(content);

    sc.setContent(content);
    lca.renderChanges(sc);

    TestMessage message = Fixture.getProtocolMessage();
    assertEquals(contentId, message.findSetProperty(sc, "content").asString());
  }
コード例 #15
0
ファイル: TagStatsView.java プロジェクト: aprasa/project
  private void initialize(Composite composite) {
    panel = new Composite(composite, SWT.NULL);
    panel.setLayout(new GridLayout(2, false));

    legend_panel_sc = new ScrolledComposite(panel, SWT.V_SCROLL);
    legend_panel_sc.setExpandHorizontal(true);
    legend_panel_sc.setExpandVertical(true);
    GridLayout layout = new GridLayout();
    layout.horizontalSpacing = 0;
    layout.verticalSpacing = 0;
    layout.marginHeight = 0;
    layout.marginWidth = 0;
    legend_panel_sc.setLayout(layout);
    GridData gridData = new GridData(GridData.FILL_VERTICAL);
    legend_panel_sc.setLayoutData(gridData);

    legend_panel = new Group(legend_panel_sc, SWT.NULL);
    legend_panel.setText(MessageText.getString("label.tags"));

    legend_panel.setLayout(new GridLayout());

    legend_panel_sc.setContent(legend_panel);
    legend_panel_sc.addControlListener(
        new ControlAdapter() {
          public void controlResized(ControlEvent e) {
            legend_panel_sc.setMinSize(legend_panel.computeSize(SWT.DEFAULT, SWT.DEFAULT));
          }
        });

    speed_panel = new Composite(panel, SWT.NULL);
    speed_panel.setLayout(new GridLayout());
    gridData = new GridData(GridData.FILL_BOTH);
    speed_panel.setLayoutData(gridData);

    build();

    TagManager tm = TagManagerFactory.getTagManager();

    tm.addTagManagerListener(this, false);

    for (TagType tt : tm.getTagTypes()) {

      tt.addTagTypeListener(this, false);
    }

    panel.addListener(
        SWT.Activate,
        new Listener() {
          public void handleEvent(Event event) {
            refresh(true);
          }
        });
  }
コード例 #16
0
  @Test
  public void testRenderOrigin() throws IOException {
    Composite content = new Composite(sc, SWT.NONE);
    sc.setContent(content);

    sc.setOrigin(1, 2);
    lca.renderChanges(sc);

    TestMessage message = Fixture.getProtocolMessage();
    JsonArray expected = JsonArray.readFrom("[ 1, 2 ]");
    assertEquals(expected, message.findSetProperty(sc, "origin"));
  }
コード例 #17
0
  @Test
  public void testReadData_ScrollBarsSelectionEvent() {
    sc.setContent(new Composite(sc, SWT.NONE));
    SelectionListener selectionListener = mock(SelectionListener.class);
    hScroll.addSelectionListener(selectionListener);
    vScroll.addSelectionListener(selectionListener);

    Fixture.fakeNotifyOperation(getId(hScroll), "Selection", null);
    Fixture.fakeNotifyOperation(getId(vScroll), "Selection", null);
    Fixture.readDataAndProcessAction(sc);

    verify(selectionListener, times(2)).widgetSelected(any(SelectionEvent.class));
  }
コード例 #18
0
  @Test
  public void testRenderContentUnchanged() throws IOException {
    Composite content = new Composite(sc, SWT.NONE);
    Fixture.markInitialized(display);
    Fixture.markInitialized(sc);

    sc.setContent(content);
    Fixture.preserveWidgets();
    lca.renderChanges(sc);

    TestMessage message = Fixture.getProtocolMessage();
    assertNull(message.findSetOperation(sc, "content"));
  }
コード例 #19
0
  private void createEditArea(Composite parent) {
    containerSC = new ScrolledComposite(parent, SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
    containerSC.setExpandHorizontal(true);
    containerSC.setExpandVertical(true);

    // Add a container for the build settings page
    settingsPageContainer = new Composite(containerSC, SWT.NONE);
    settingsPageContainer.setLayout(new PageLayout());

    containerSC.setContent(settingsPageContainer);
    //		containerSC.setMinSize(settingsPageContainer.computeSize(SWT.DEFAULT, SWT.DEFAULT));
    settingsPageContainer.layout();
  }
コード例 #20
0
ファイル: DetailDialog.java プロジェクト: master-mck/ECP
  @Override
  protected Control createDialogArea(Composite parent) {
    updateTitle();
    final Composite composite = (Composite) super.createDialogArea(parent);
    composite.setBackground(getShell().getDisplay().getSystemColor(SWT.COLOR_WHITE));
    final ScrolledComposite scrolledComposite =
        new ScrolledComposite(composite, SWT.H_SCROLL | SWT.V_SCROLL);
    scrolledComposite.setBackground(composite.getBackground());
    scrolledComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
    scrolledComposite.setExpandVertical(true);
    scrolledComposite.setExpandHorizontal(true);

    final Composite content = new Composite(scrolledComposite, SWT.NONE);
    content.setBackground(composite.getBackground());
    GridLayoutFactory.fillDefaults().numColumns(2).equalWidth(false).applyTo(content);
    GridDataFactory.fillDefaults().grab(true, true).align(SWT.FILL, SWT.FILL).applyTo(content);

    try {
      if (view == null) {
        ECPSWTViewRenderer.INSTANCE.render(content, selection);
      } else {
        ECPSWTViewRenderer.INSTANCE.render(content, selection, view);
      }
    } catch (final ECPRendererException ex) {
      Activator.log(ex);
    }

    scrolledComposite.setContent(content);
    final Point point = content.computeSize(SWT.DEFAULT, SWT.DEFAULT);
    content.setSize(point);
    scrolledComposite.setMinSize(point);

    objectChangeAdapter =
        new AdapterImpl() {

          /**
           * {@inheritDoc}
           *
           * @see
           *     org.eclipse.emf.common.notify.impl.AdapterImpl#notifyChanged(org.eclipse.emf.common.notify.Notification)
           */
          @Override
          public void notifyChanged(Notification msg) {
            super.notifyChanged(msg);
            updateTitle();
          }
        };
    selection.eAdapters().add(objectChangeAdapter);

    return composite;
  }
コード例 #21
0
  protected Composite createScrolledComposite(Composite parent) {
    // create scrollbars for this parent when needed
    final ScrolledComposite sc1 = new ScrolledComposite(parent, SWT.H_SCROLL | SWT.V_SCROLL);
    sc1.setLayoutData(new GridData(GridData.FILL_BOTH));
    Composite composite = createComposite(sc1, 1);
    sc1.setContent(composite);

    // not calling setSize for composite will result in a blank composite,
    // so calling it here initially
    // setSize actually needs to be called after all controls are created,
    // so scrolledComposite
    // has correct minSize
    setSize(composite);
    return composite;
  }
コード例 #22
0
  private void createJFreeChartComposite() {

    final ScrolledComposite scrollComp =
        new ScrolledComposite(this, SWT.H_SCROLL | SWT.V_SCROLL | SWT.NO_FOCUS);
    scrollComp.setLayout(new GridLayout());

    Composite innerComp = new Composite(scrollComp, SWT.NONE);
    GridData innerGD = new GridData();
    innerGD.grabExcessVerticalSpace = true;
    innerComp.setLayoutData(innerGD);
    innerComp.setLayout(new FillLayout());
    scrollComp.setContent(innerComp);
    scrollComp.setExpandVertical(true);
    scrollComp.setExpandHorizontal(true);
    jfreeChartComp = new ChartComposite(innerComp, SWT.NONE, computeChart(), true);
  }
コード例 #23
0
ファイル: CrtVerView.java プロジェクト: kevinott/crypto
  /** This is a callback that will allow us to create the viewer and initialize it. */
  public void createPartControl(Composite parent) {
    this.parent = parent;
    final ScrolledComposite sc = new ScrolledComposite(parent, SWT.H_SCROLL | SWT.V_SCROLL);
    sc.setExpandHorizontal(true);
    sc.setExpandVertical(true);
    CrtVerViewComposite c = new CrtVerViewComposite(sc, SWT.NONE, this);
    sc.setContent(c);
    sc.setMinSize(c.computeSize(SWT.DEFAULT, SWT.DEFAULT));
    c.setText();

    PlatformUI.getWorkbench()
        .getHelpSystem()
        .setHelp(
            parent.getShell(),
            "org.jcryptool.visual.crtverification.views.CrtVerView"); //$NON-NLS-1$
  }
コード例 #24
0
  /**
   * Creates and associates the required composites to present the parameters and the demo image for
   * the spatial operation.
   *
   * @param builder
   */
  @Override
  protected void createContents() {

    assert this.presenterFactory != null : "builder cannot not be null";

    GridLayout gridLayout = new GridLayout();
    setLayout(gridLayout);

    this.sash = new SashForm(this, SWT.NONE);
    GridData gridData = new GridData();
    gridData.horizontalAlignment = GridData.FILL;
    gridData.grabExcessVerticalSpace = true;
    gridData.grabExcessHorizontalSpace = true;
    gridData.verticalAlignment = GridData.FILL;
    this.sash.setLayoutData(gridData);

    this.dataScrollComposite = new ScrolledComposite(this.sash, SWT.BORDER | SWT.H_SCROLL);
    this.dataScrollComposite.setLayout(new FillLayout());

    this.dataComposite =
        (Composite) this.presenterFactory.createDataComposite(this.dataScrollComposite, SWT.BORDER);

    dataComposite.setLayoutData(gridData);

    this.dataScrollComposite.setContent(dataComposite);
    this.dataScrollComposite.setExpandHorizontal(true);
    this.dataScrollComposite.setExpandVertical(true);
    this.dataScrollComposite.setMinSize(dataComposite.computeSize(SWT.DEFAULT, SWT.DEFAULT));

    ScrolledComposite demoScrollComposite = new ScrolledComposite(sash, SWT.BORDER | SWT.H_SCROLL);
    demoScrollComposite.setLayout(new FillLayout());

    IImageOperation demoImages = this.presenterFactory.createDemoImages();

    this.demoComposite = new DemoComposite(demoScrollComposite, SWT.BORDER, demoImages);

    this.demoComposite.setLayoutData(gridData);

    demoScrollComposite.setContent(this.demoComposite);
    demoScrollComposite.setExpandHorizontal(true);
    demoScrollComposite.setExpandVertical(true);
    demoScrollComposite.setMinSize(demoComposite.computeSize(SWT.DEFAULT, SWT.DEFAULT));

    sash.setWeights(new int[] {70, 30});

    super.addPresenter((AggregatedPresenter) dataComposite);
  }
コード例 #25
0
  /**
   * Creates the composite holding the details.
   *
   * @param parent the parent
   * @return the right panel/detail composite
   */
  protected ScrolledComposite createRightPanelContent(Composite parent) {
    rightPanel = new ScrolledComposite(parent, SWT.V_SCROLL | SWT.H_SCROLL);
    rightPanel.setShowFocusedControl(true);
    rightPanel.setExpandVertical(true);
    rightPanel.setExpandHorizontal(true);
    GridDataFactory.fillDefaults().align(SWT.FILL, SWT.FILL).grab(true, true).applyTo(rightPanel);
    rightPanel.setLayout(GridLayoutFactory.fillDefaults().create());
    rightPanel.setBackground(parent.getDisplay().getSystemColor(SWT.COLOR_WHITE));

    container = new Composite(rightPanel, SWT.FILL);
    container.setLayout(GridLayoutFactory.fillDefaults().create());
    GridDataFactory.fillDefaults().align(SWT.FILL, SWT.FILL).grab(true, true).applyTo(container);
    container.setBackground(rightPanel.getBackground());

    /* The header */
    final Composite header = new Composite(container, SWT.FILL);
    final GridLayout headerLayout = GridLayoutFactory.fillDefaults().create();
    headerLayout.marginWidth = 5;
    header.setLayout(headerLayout);
    GridDataFactory.fillDefaults().align(SWT.FILL, SWT.FILL).grab(true, false).applyTo(header);
    header.setBackground(rightPanel.getBackground());

    final Label label = new Label(header, SWT.WRAP);
    label.setText("Details"); // $NON-NLS-1$
    detailsFont = new Font(label.getDisplay(), getDefaultFontName(label), 10, SWT.BOLD);
    label.setFont(detailsFont);
    label.setForeground(getTitleColor(parent));
    label.setBackground(header.getBackground());

    rightPanelContainerComposite = new Composite(container, SWT.FILL);
    rightPanelContainerComposite.setLayout(GridLayoutFactory.fillDefaults().create());
    GridDataFactory.fillDefaults()
        .align(SWT.FILL, SWT.FILL)
        .grab(true, true)
        .applyTo(rightPanelContainerComposite);
    rightPanelContainerComposite.setBackground(rightPanel.getBackground());

    rightPanel.setContent(container);

    rightPanel.layout();
    container.layout();

    final Point point = container.computeSize(SWT.DEFAULT, SWT.DEFAULT);
    rightPanel.setMinSize(point);

    return rightPanel;
  }
コード例 #26
0
  /**
   * Create contents of the dialog.
   *
   * @param parent
   */
  @Override
  protected Control createDialogArea(Composite parent) {
    setMessage("Icon Selection");
    Composite area = (Composite) super.createDialogArea(parent);
    Composite container = new Composite(area, SWT.NONE);
    container.setLayout(new GridLayout(1, false));
    container.setLayoutData(new GridData(GridData.FILL_BOTH));

    ScrolledComposite scrolledComposite =
        new ScrolledComposite(container, SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL);
    scrolledComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
    scrolledComposite.setExpandHorizontal(true);
    scrolledComposite.setExpandVertical(true);

    Composite composite = new Composite(scrolledComposite, SWT.NONE);
    composite.setLayout(new GridLayout(9, true));

    for (Descriptor i : IconRegistry.getRegisteredImages()) {
      Button btnCheckButton = new Button(composite, SWT.RADIO);
      btnCheckButton.setImage(IconRegistry.getImage(i.id));
      btnCheckButton.setData(i);

      btnCheckButton.addSelectionListener(
          new SelectionAdapter() {
            @Override
            public void widgetSelected(SelectionEvent e) {
              Object source = e.getSource();
              if (source instanceof Button) {
                Button btn = (Button) source;
                Object data = btn.getData();
                if (data instanceof Descriptor) {
                  Descriptor desc = (Descriptor) data;
                  imageSelected = desc.id;
                }
              }
            }
          });
    }

    scrolledComposite.setContent(composite);
    scrolledComposite.setMinSize(composite.computeSize(SWT.DEFAULT, SWT.DEFAULT));

    return area;
  }
コード例 #27
0
  @Override
  protected void createWorkarea(Composite parent) {
    parent.setLayout(new FillLayout());
    final Color bgColor = LnfManager.getLnf().getColor(LnfKeyConstants.SUB_MODULE_BACKGROUND);

    final ScrolledComposite scrolled = new ScrolledComposite(parent, SWT.H_SCROLL | SWT.V_SCROLL);
    scrolled.setExpandHorizontal(true);
    scrolled.setExpandVertical(true);
    scrolled.setBackground(bgColor);

    final Composite newParent = new Composite(scrolled, SWT.DOUBLE_BUFFERED);
    scrolled.setContent(newParent);
    newParent.setBackground(bgColor);

    basicCreatePartControl(newParent);
    afterBasicCreatePartControl(newParent);

    scrolled.setMinSize(newParent.computeSize(640, 480));
  }
コード例 #28
0
ファイル: DatabaseView.java プロジェクト: geoinfjena/jgrass
  @Override
  public void createPartControl(Composite parent) {
    Composite mainComposite = new Composite(parent, SWT.None);
    mainComposite.setLayout(new GridLayout(1, false));
    mainComposite.setLayoutData(
        new GridData(GridData.FILL_BOTH | GridData.GRAB_HORIZONTAL | GridData.GRAB_VERTICAL));

    Group connectionsGroup = new Group(mainComposite, SWT.BORDER | SWT.SHADOW_ETCHED_IN);
    connectionsGroup.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
    connectionsGroup.setLayout(new GridLayout(3, true));
    connectionsGroup.setText(Messages.DatabaseView__connections);

    Composite connectionsListComposite = new Composite(connectionsGroup, SWT.NONE);
    connectionsListComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
    connectionsListComposite.setLayout(new GridLayout(2, false));

    connectionsViewer = createTableViewer(connectionsListComposite);
    connectionsViewer.setInput(availableDatabaseConnectionProperties);
    addFilterButtons(connectionsListComposite, connectionsViewer);

    ScrolledComposite scrolledComposite =
        new ScrolledComposite(connectionsGroup, SWT.BORDER | SWT.V_SCROLL);
    scrolledComposite.setLayout(new GridLayout(1, false));

    propertiesComposite = new Composite(scrolledComposite, SWT.NONE);
    propertiesStackLayout = new StackLayout();
    propertiesComposite.setLayout(propertiesStackLayout);
    GridData propertiesCompositeGD = new GridData(SWT.FILL, SWT.FILL, true, true);
    // propertiesCompositeGD.horizontalSpan = 2;
    propertiesComposite.setLayoutData(propertiesCompositeGD);
    Label l = new Label(propertiesComposite, SWT.SHADOW_ETCHED_IN);
    l.setText(Messages.DatabaseView__no_item_selected);
    propertiesStackLayout.topControl = l;

    scrolledComposite.setContent(propertiesComposite);
    scrolledComposite.setExpandHorizontal(true);
    scrolledComposite.setExpandVertical(true);
    // scrolledComposite.setMinWidth(400);
    scrolledComposite.setMinHeight(300);
    GridData scrolledCompositeGD = new GridData(SWT.FILL, SWT.FILL, true, true);
    scrolledCompositeGD.horizontalSpan = 2;
    scrolledComposite.setLayoutData(scrolledCompositeGD);
  }
コード例 #29
0
  protected void initGui(Composite parent) {
    final int gdMinimumWidth = 550;
    final int gdHeightHint = 200;

    createFilterPanel(parent);

    group = new Group(parent, SWT.NONE);
    if (getTitle() != null) {
      group.setText(getTitle());
    }
    GridLayout groupOrganizationLayout = new GridLayout(1, true);
    group.setLayout(groupOrganizationLayout);
    GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true);
    gd.minimumWidth = gdMinimumWidth;
    gd.heightHint = gdHeightHint;
    group.setLayoutData(gd);

    scrolledComposite = new ScrolledComposite(group, SWT.V_SCROLL);
    scrolledComposite.setLayoutData(new GridData(GridData.FILL_BOTH));
    scrolledComposite.setExpandHorizontal(true);

    innerComposite = new Composite(scrolledComposite, SWT.NONE);
    scrolledComposite.setContent(innerComposite);
    innerComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
    innerComposite.setLayout(new GridLayout(1, false));

    if (selection != null && !selection.isEmpty()) {
      Iterator<T> iter = selection.iterator();
      while (iter.hasNext()) {
        preSelectedElements.add(iter.next());
      }
    } else if (selectedElement != null) {
      preSelectedElements.add(selectedElement);
    }

    checkboxMap = new HashMap<T, Button>();

    addCheckboxes();
  }
  @Override
  protected Control createDialogArea(Composite parent) {
    GridData grData = null;

    final ScrolledComposite scrolledContainer =
        new ScrolledComposite(parent, SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER | SWT.FILL);

    scrolledContainer.setExpandHorizontal(true);
    scrolledContainer.setExpandVertical(true);
    scrolledContainer.setAlwaysShowScrollBars(true);
    scrolledContainer.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    final Composite container = new Composite(scrolledContainer, SWT.NONE);
    scrolledContainer.setContent(container);

    GridLayout layout = new GridLayout();
    layout.numColumns = 3;

    container.setLayout(layout);
    Label lbPrefix = new Label(container, SWT.NULL);
    lbPrefix.setText("Name");
    txtName = new Text(container, SWT.BORDER | SWT.SINGLE);
    grData = new GridData(GridData.FILL_HORIZONTAL);
    grData.horizontalSpan = 2;
    txtName.setLayoutData(grData);
    txtName.setText(name);
    Label lbNamespace = new Label(container, SWT.NULL);
    lbNamespace.setText("Value");
    txtValue = new Text(container, SWT.BORDER | SWT.SINGLE);
    grData = new GridData(GridData.FILL_HORIZONTAL);
    grData.horizontalSpan = 2;

    txtValue.setLayoutData(grData);
    txtValue.setText(value);

    container.layout();
    scrolledContainer.setSize(100, 80);
    container.layout();
    return super.createDialogArea(scrolledContainer);
  }