Beispiel #1
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);
  }
Beispiel #2
0
  protected Composite createPriceConfigEditComposite(Composite parent) {
    SashForm sfLeftRight = new SashForm(parent, SWT.NONE | SWT.HORIZONTAL);
    sfLeftRight.setLayoutData(new GridData(GridData.FILL_BOTH));
    Composite left = createLeftCarrierComposite(sfLeftRight);
    Composite right = createRightCarrierComposite(sfLeftRight);
    sfLeftRight.setWeights(new int[] {1, 2});

    productTypeSelector = createProductTypeSelector(left);
    dimensionValueSelector = createDimensionValueSelector(left);
    dimensionXYSelector = createDimensionXYSelector(right);

    SashForm sfGrid = new SashForm(right, SWT.NONE | SWT.VERTICAL);
    sfGrid.setLayoutData(new GridData(GridData.FILL_BOTH));

    priceConfigGrid = createPriceConfigGrid(sfGrid);
    priceConfigGrid.addPropertyChangeListener(
        new PropertyChangeListener() {
          public void propertyChange(PropertyChangeEvent evt) {
            propertyChangeSupport.firePropertyChange(
                evt.getPropertyName(), evt.getOldValue(), evt.getNewValue());

            if (dirtyStateManager != null) dirtyStateManager.markDirty();
          }
        });

    cellDetail = createCellDetail(sfGrid);
    // add listeners to notify dirty state
    //		cellDetail.getCellDetailText().addModifyListener(cellEditModifyListener);
    //		cellDetail.getCellDetailFallbackText().addModifyListener(cellEditModifyListener);

    //		cellDetail.getCellDetailText().getDocument().addDocumentListener(cellEditModifyListener);
    //
    //	cellDetail.getCellDetailFallbackText().getDocument().addDocumentListener(cellEditModifyListener);

    //		dimensionValueSelector.addPropertyChangeListener(
    //			DimensionValueSelector.PROPERTYCHANGEKEY_ADDDIMENSIONVALUE, new PropertyChangeListener() {
    //				public void propertyChange(PropertyChangeEvent evt) {
    //					if (priceCalculator != null) {
    //						priceCalculator.preparePriceCalculation_createPackagedResultPriceConfigs();
    //					}
    //				}
    //			}
    //		);

    dimensionValueSelector.addPropertyChangeListener(
        DimensionValueSelector.PROPERTYCHANGEKEY_ADDDIMENSIONVALUE, dimensionValueChangeListener);

    dimensionValueSelector.addPropertyChangeListener(
        DimensionValueSelector.PROPERTYCHANGEKEY_REMOVEDIMENSIONVALUE,
        dimensionValueChangeListener);

    sfGrid.setWeights(new int[] {1, 1});

    return sfLeftRight;
  }
 private Control createSashForm() {
   SashForm vertSashForm = new SashForm(folder, SWT.VERTICAL);
   SashForm horSashForm = new SashForm(vertSashForm, SWT.HORIZONTAL);
   Composite leftComp = new Composite(horSashForm, SWT.NONE);
   Composite rightComp = new Composite(horSashForm, SWT.NONE);
   Composite footComp = new Composite(vertSashForm, SWT.NONE);
   createLeft(leftComp);
   createRight(rightComp);
   createFoot(footComp);
   horSashForm.setWeights(new int[] {60, 40});
   vertSashForm.setWeights(new int[] {95, 5});
   return vertSashForm;
 }
  /**
   * {@inheritDoc}
   *
   * @see
   *     org.eclipse.emfforms.spi.swt.core.AbstractSWTRenderer#renderControl(org.eclipse.emfforms.spi.swt.core.layout.SWTGridCell,
   *     org.eclipse.swt.widgets.Composite)
   */
  @Override
  protected Control renderControl(SWTGridCell cell, Composite parent)
      throws NoRendererFoundException, NoPropertyDescriptorFoundExeption {

    /* The tree's composites */
    final Composite form = createMasterDetailForm(parent);

    createHeader(form);

    final SashForm sash = createSash(form);

    final Composite masterPanel = createMasterPanel(sash);

    createRightPanelContent(sash);

    sash.setWeights(new int[] {1, 3});

    createMasterTree(masterPanel);

    if (hasContextMenu()) {
      registerControlAsContextMenuReceiver();
    }
    form.layout(true);
    return form;
  }
 /*
  * The key listeners we add workaround a bug int Text that don't repaint
  * properly when they have background images.
  */
 protected void createChatControl(Widget item) throws Exception {
   CTabItem tabItem = new CTabItem(tabFolder, SWT.NONE);
   tabItem.setText("Chat with " + ((TreeItem) item).getText());
   SashForm textForm = new SashForm(tabFolder, SWT.VERTICAL);
   final Text text1 = new Text(textForm, SWT.MULTI);
   text1.setData("id", "output");
   text1.setText(OUTPUT_TEXT);
   text1.addKeyListener(
       new KeyAdapter() {
         public void keyPressed(KeyEvent arg0) {
           text1.redraw();
         }
       });
   final Text text2 = new Text(textForm, SWT.MULTI);
   text2.setData("id", "input");
   text2.setText(INPUT_TEXT);
   text2.addKeyListener(
       new KeyAdapter() {
         public void keyPressed(KeyEvent arg0) {
           text2.redraw();
         }
       });
   tabItem.setControl(textForm);
   textForm.setWeights(new int[] {80, 20});
   getCSSEngine().applyStyles(textForm, false);
   tabFolder.setSelection(tabItem);
 }
  @Override
  public void createPage() {
    super.createPage();
    Composite parent = (Composite) getContent();
    coolBar = new CoolBar(parent, SWT.FLAT);

    createControlsToolBar(coolBar);
    createConfigurationToolBar(coolBar);
    packCoolBar();

    SashForm sashForm = new SashForm(parent, SWT.NONE);
    sashForm.setLayout(new GridLayout());
    sashForm.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
    sashForm.setOrientation(SWT.VERTICAL);
    sashForm.SASH_WIDTH = 3;

    createScriptTableSection(sashForm);
    createStatusWindow(sashForm);

    sashForm.setWeights(new int[] {8, 2});
    setMinSize(0, 0);

    // TODO: Change to use OteHelpContext
    HelpUtil.setHelp(this, "test_manager_scripts_page", "org.eclipse.osee.framework.help.ui");
  }
  public static void main(final String[] args) {
    Display display = new Display();
    shell = new Shell(display);
    shell.setText("StackOverflow");
    shell.setLayout(new GridLayout(1, false));

    // createToolbar();
    scform = new ScrolledForm(shell);
    scform.setLayout(new GridLayout(1, false));
    scform.getBody().setLayout(new GridLayout(1, false));
    scform.setExpandHorizontal(true);
    scform.setExpandVertical(true);

    SashForm form = new SashForm(scform.getBody(), SWT.VERTICAL);
    form.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
    createTablePart(form);
    createMessagesPart(form);
    form.setWeights(new int[] {3, 1});

    shell.pack();
    shell.open();
    // shell.setSize(600, 450);
    while (!shell.isDisposed()) {
      if (!display.readAndDispatch()) {
        display.sleep();
      }
    }
    display.dispose();
  }
 public Control createControl(Composite parent) {
   composite = new SashForm(parent, SWT.VERTICAL);
   properties.createControl(composite);
   editor.createControl(composite);
   composite.setWeights(new int[] {15, 30});
   return composite;
 }
  /** Create contents of the window. */
  protected void createContents() {
    mAndroidSdkUpdater = new Shell(mParentShell, SWT.SHELL_TRIM);
    mAndroidSdkUpdater.addDisposeListener(
        new DisposeListener() {
          public void widgetDisposed(DisposeEvent e) {
            onAndroidSdkUpdaterDispose(); // $hide$ (hide from SWT designer)
          }
        });

    FillLayout fl;
    mAndroidSdkUpdater.setLayout(fl = new FillLayout(SWT.HORIZONTAL));
    fl.marginHeight = fl.marginWidth = 5;
    mAndroidSdkUpdater.setMinimumSize(new Point(200, 50));
    mAndroidSdkUpdater.setSize(745, 433);
    mAndroidSdkUpdater.setText("Android SDK and AVD Manager");

    mSashForm = new SashForm(mAndroidSdkUpdater, SWT.NONE);

    mPageList = new List(mSashForm, SWT.BORDER);
    mPageList.addSelectionListener(
        new SelectionAdapter() {
          @Override
          public void widgetSelected(SelectionEvent e) {
            onPageListSelected(); // $hide$ (hide from SWT designer)
          }
        });

    mPagesRootComposite = new Composite(mSashForm, SWT.NONE);
    mStackLayout = new StackLayout();
    mPagesRootComposite.setLayout(mStackLayout);

    createPages();

    mSashForm.setWeights(new int[] {150, 576});
  }
  /*
   * (non-Javadoc)
   * @see
   * org.eclipse.ui.part.WorkbenchPart#createPartControl(org.eclipse.swt.widgets
   * .Composite)
   */
  @Override
  public void createPartControl(Composite parent) {
    fSashForm = new SashForm(parent, SWT.HORIZONTAL);

    fSelectionProvider = new MemoryViewSelectionProvider();

    // set up selection provider and listeners
    getSite().setSelectionProvider(fSelectionProvider);

    createMemoryBlocksTreeViewPane(fSashForm);
    createRenderingViewPane(IDebugUIConstants.ID_RENDERING_VIEW_PANE_1);
    createRenderingViewPane(IDebugUIConstants.ID_RENDERING_VIEW_PANE_2);

    setVisible(true);

    // set up weights in sashform
    Integer[] weights = fWeights.toArray(new Integer[fWeights.size()]);
    int[] intWeights = new int[weights.length];
    for (int i = 0; i < weights.length; i++) {
      intWeights[i] = weights[i].intValue();
    }
    fSashForm.setWeights(intWeights);
    loadViewPanesVisibility();

    createOrientationActions();
    loadOrientation();

    fPartListener = new MemoryViewPartListener(this);
    getSite().getPage().addPartListener(fPartListener);
    activateHandlers();
    // restore view pane after finishing creating all the view panes
    restoreView();
  }
 /**
  * Initializes the sash form weights from the preference store (using default values if no sash
  * weights were stored previously).
  */
 protected void initSashWeights() {
   IDialogSettings settings = getDialogSettings(false);
   if (settings != null) {
     int tree = getIntSetting(settings, SASH_WEIGHT_TREE);
     if (tree > 0) {
       if (fDetailPane != null) {
         int details = getIntSetting(settings, SASH_WEIGHT_DETAILS);
         if (details <= 0) {
           details = tree / 2;
         }
         fSashForm.setWeights(new int[] {tree, details});
       } else {
         fSashForm.setWeights(new int[] {tree});
       }
     }
   }
 }
 protected void updateGui() {
   if (control != null && !control.isDisposed()) return;
   control = new SashForm(guiControl, SWT.HORIZONTAL);
   control.setLayoutData(new GridData(GridData.FILL_BOTH));
   createLeftComponent((Composite) control);
   elementEditor.createControl((Composite) control);
   ((SashForm) control).setWeights(new int[] {30, 70});
   fireGuiModified();
 }
  /* (non-Javadoc)
   * @see com.hundsun.ares.studio.jres.metadata.ui.editors.AbstractMetadataFormPage#createMetadataComposite(org.eclipse.swt.widgets.Composite, org.eclipse.ui.forms.widgets.FormToolkit)
   */
  @Override
  protected void createMetadataComposite(Composite body, FormToolkit toolkit) {
    EPackage epackage = null;
    try {
      epackage = BasicDataEpackageFactory.eINSTANCE.createEPackage(getEditor().getARESResource());
    } catch (Exception e) {
      logger.error("编辑基础数据时,读取EPackage失败", e);
      return;
    }

    SashForm sashForm = new SashForm(body, SWT.VERTICAL);

    masterListViewerBlock =
        new SingleTableListViewerBlock(
            this,
            getEditingDomain(),
            getSite(),
            getEditor().getARESResource(),
            getProblemPool(),
            epackage,
            IBasicDataEpacakgeConstant.MasterItem);
    masterListViewerBlock.setEditableControl(getEditableControl());
    masterListViewerBlock.createControl(sashForm, toolkit);
    getEditor().getActionBarContributor().addGlobalActionHandlerProvider(masterListViewerBlock);

    slaveDetailViewerBlock =
        new MasterSlaveDetailViewerBlock(
            getEditingDomain(), getEditor().getARESResource(), getProblemPool(), epackage);
    slaveDetailViewerBlock.setEditableControl(getEditableControl());
    slaveDetailViewerBlock.createControl(sashForm, toolkit);
    getEditor().getActionBarContributor().addGlobalActionHandlerProvider(slaveDetailViewerBlock);

    sashForm.setWeights(new int[] {6, 4});

    masterListViewerBlock.addSelectionChangedListener(
        new ISelectionChangedListener() {

          @Override
          public void selectionChanged(SelectionChangedEvent event) {

            ISelection selection = event.getSelection();
            if (selection instanceof IStructuredSelection && !selection.isEmpty()) {
              Object element = ((IStructuredSelection) selection).getFirstElement();
              if (!(element instanceof MetadataCategory)) {
                slaveDetailViewerBlock.setInput(element);
              }
            }
          }
        });

    addPropertyListener(masterListViewerBlock);
    getEditingDomain().getCommandStack().addCommandStackListener(masterListViewerBlock);

    addPropertyListener(slaveDetailViewerBlock);
    getEditingDomain().getCommandStack().addCommandStackListener(slaveDetailViewerBlock);
  }
 private static void initializeSashWeights(
     SashForm sashForm, int[] defaultValues, IDialogSettings dialogSettings) {
   if (dialogSettings != null) {
     String[] weightStrings = dialogSettings.getArray(SASH_WEIGHTS_SETTING);
     if (weightStrings != null && weightStrings.length == defaultValues.length) {
       try {
         int[] weights = new int[weightStrings.length];
         for (int i = 0; i < weights.length; i++) {
           weights[i] = Integer.parseInt(weightStrings[i]);
         }
         sashForm.setWeights(weights);
         return;
       } catch (NumberFormatException ignore) { // bad settings
         dialogSettings.put(SASH_WEIGHTS_SETTING, (String[]) null);
       }
     }
   }
   sashForm.setWeights(defaultValues);
 }
 /** {@inheritDoc} */
 @Override
 public void restoreMaximization() {
   int[] weights = new int[getSubViews().size()];
   int i = 0;
   for (ISubView view : getSubViews()) {
     view.getControl().setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
     weights[i] = weightMapping.get(view);
     i++;
   }
   sashForm.setWeights(weights);
   layout();
 }
Beispiel #16
0
  @Override
  public Control createControl(Composite parent) {
    SashForm sash = new SashForm(parent, SWT.HORIZONTAL);
    sash.setBackground(Display.getDefault().getSystemColor(SWT.COLOR_WHITE));

    Composite container = new Composite(sash, SWT.NONE);
    container.setBackground(Display.getDefault().getSystemColor(SWT.COLOR_WHITE));

    treeMap = new TreeMap<TaxonomyNode>(container);
    treeMap.setTreeMapLayout(new SquarifiedLayout<TaxonomyNode>(10));
    treeMap.setLabelProvider(
        new ILabelProvider<TaxonomyNode>() {
          @Override
          public String getLabel(
              ITreeModel<IRectangle<TaxonomyNode>> model, IRectangle<TaxonomyNode> rectangle) {
            return rectangle.getNode().getName();
          }
        });

    legend = new TreeMapLegend(container, treeMap, getModel(), getRenderer());

    final SecurityDetailsViewer details =
        new SecurityDetailsViewer(sash, SWT.NONE, getModel().getClient(), true);
    treeMap.addSelectionChangeListener(
        new ISelectionChangeListener<TaxonomyNode>() {
          @Override
          public void selectionChanged(
              ITreeModel<IRectangle<TaxonomyNode>> model,
              IRectangle<TaxonomyNode> rectangle,
              String label) {
            TaxonomyNode node = rectangle.getNode();
            details.setInput(node.getBackingSecurity());
          }
        });

    // layout tree map + legend
    GridLayoutFactory.fillDefaults().numColumns(1).margins(10, 10).applyTo(container);
    GridDataFactory.fillDefaults().grab(true, true).applyTo(treeMap);
    GridDataFactory.fillDefaults().grab(true, false).applyTo(legend);

    // layout sash
    details.getControl().pack();
    int width = details.getControl().getBounds().width;
    sash.setWeights(new int[] {parent.getParent().getParent().getBounds().width - width, width});

    treeMap.setRectangleRenderer(new ClassificationRectangleRenderer(getModel(), getRenderer()));
    treeMap.setTreeModel(new Model(getModel().getRootNode()));
    legend.setRootItem(getModel().getRootNode());

    return sash;
  }
  private void configureSashMode(int mode) {
    tabFolder = null;
    if (sashForm != null) {
      if (sashForm.getOrientation() != mode) sashForm.setOrientation(mode);
      return;
    }
    recreateRootComposite();
    sashForm = new SashForm(rootComposite, mode);

    createMessageViewers(sashForm);

    sashForm.setWeights(new int[] {50, 50});
    parentComposite.layout();
    processCurrentTransaction();
  }
Beispiel #18
0
  public void createControl() {

    sashForm = new SashForm(this, SWT.VERTICAL);
    sashForm.setLayout(new FillLayout());
    sashForm.setSashWidth(10);

    createInfoViewer(sashForm);
    createBundleTreeViewer(sashForm);

    showAll = createButtons(this);

    setLayout(new BundleTreeLayout());

    sashForm.setWeights(new int[] {30, 70});
  }
  /** {@inheritDoc} */
  @Override
  public void createPartControl(Composite parent, FormToolkit toolkit) {
    sashForm = new SashForm(parent, sashFormStyle);
    sashForm.setLayout(new GridLayout(1, false));

    List<ISubView> subViews = getSubViews();

    for (final ISubView subView : subViews) {
      subView.createPartControl(sashForm, toolkit);
      subView.getControl().setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
      subView
          .getControl()
          .addFocusListener(
              new FocusAdapter() {
                /** {@inheritDoc} */
                @Override
                public void focusGained(FocusEvent e) {
                  getRootEditor().setActiveSubView(subView);
                }
              });

      if (null != subView.getSelectionProvider()) {
        ISelectionProvider prov = subView.getSelectionProvider();
        prov.addSelectionChangedListener(
            new ISelectionChangedListener() {
              @Override
              public void selectionChanged(SelectionChangedEvent event) {
                getRootEditor().setSelection(event.getSelection());
              }
            });
        prov.addSelectionChangedListener(getRootEditor().getSelectionChangedListener());
        if (prov instanceof IPostSelectionProvider) {
          ((IPostSelectionProvider) prov)
              .addPostSelectionChangedListener(getRootEditor().getPostSelectionChangedListener());
        }
      }
    }

    if (!weightMapping.isEmpty()) {
      int[] weights = new int[subViews.size()];
      for (int i = 0; i < subViews.size(); i++) {
        if (weightMapping.containsKey(subViews.get(i))) {
          weights[i] = weightMapping.get(subViews.get(i));
        }
      }
      sashForm.setWeights(weights);
    }
  }
  private void createUiElements(final Composite parent) {
    sashForm = new SashForm(parent, SWT.SMOOTH);
    sashForm.setLayoutData(GridDataFactory.fillDefaults().grab(true, true).create());

    overviewPart.createControl(sashForm);
    contentPart.createControl(sashForm);

    sashForm.setWeights(preferences.loadSashWeights());
    sashForm.addDisposeListener(
        new DisposeListener() {
          @Override
          public void widgetDisposed(final DisposeEvent e) {
            preferences.storeSashWeights(sashForm.getWeights());
          }
        });
  }
  /**
   * 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);
  }
 public void setInput(Object object) {
   selected = (XModelObject) object;
   String[] h = editor.getHelper().getHeader();
   editor.getHelper().setEntity(selected.getModelEntity(), 0);
   if (h != editor.getHelper().getHeader()) {
     if (composite != null) {
       editor.getControl().dispose();
       editor.createControl(composite);
       composite.setWeights(new int[] {15, 30});
       composite.update();
       composite.layout();
     }
   }
   editor.setObject(selected);
   editor.update();
   properties.setInput(selected);
 }
Beispiel #23
0
  /**
   * Creates the contents of the dialog
   *
   * @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite)
   */
  protected Control createDialogArea(Composite parent) {
    Composite dialogComp = (Composite) super.createDialogArea(parent);
    setDialogTitleInfo();

    SashForm sash = new SashForm(dialogComp, SWT.HORIZONTAL);
    GridData gd = new GridData(GridData.FILL_BOTH);
    sash.setLayoutData(gd);

    createFileTreeArea(sash);

    infoPanel = new Composite(sash, SWT.BORDER);
    infoPanel.setLayout(new FillLayout());

    sash.setWeights(DEFAULT_SASH_WEIGHTS);

    return dialogComp;
  }
Beispiel #24
0
 @Override
 public void createPartControl(Composite parent) {
   parent.setLayout(new FillLayout(SWT.VERTICAL));
   SashForm sashForm = new SashForm(parent, SWT.VERTICAL | SWT.SMOOTH);
   sashForm.setSashWidth(5);
   sashForm.setBackground(ColorConstants.white);
   sashForm.setLayout(new FillLayout());
   Composite top = kit.createComposite(sashForm);
   top.setLayout(new FillLayout(SWT.VERTICAL));
   Composite bottom = kit.createComposite(sashForm);
   bottom.setLayout(new FillLayout(SWT.VERTICAL));
   sashForm.setWeights(new int[] {3, 2});
   createViewer(top);
   createTimeScalingSection(bottom);
   hookActions();
   setActiveSession();
 }
  protected final Control createDialogArea(final Composite parent) {
    Composite c0 = (Composite) super.createDialogArea(parent);

    Composite container = new Composite(c0, SWT.NONE);
    container.setLayout(new FormLayout());
    GridData gdContainer = new GridData(GridData.FILL_BOTH);
    container.setLayoutData(gdContainer);

    Control top = createTop(container);

    FormData fdTop = new FormData();
    fdTop.left = new FormAttachment(0, 0);
    fdTop.top = new FormAttachment(0, 0);
    fdTop.right = new FormAttachment(100, 0);
    top.setLayoutData(fdTop);

    Composite conceptEditor = new Composite(container, SWT.NONE);
    conceptEditor.setLayout(new FillLayout());

    Group group = new Group(conceptEditor, SWT.SHADOW_OUT);
    group.setText("Properties");
    group.setLayout(new FillLayout());
    SashForm s0 = new SashForm(group, SWT.HORIZONTAL);
    s0.SASH_WIDTH = 10;
    PropertyNavigationWidget propertyNavigationWidget = new PropertyNavigationWidget(s0, SWT.NONE);
    propertyNavigationWidget.setConceptModel(conceptModel);
    propertyWidgetManager =
        new PropertyWidgetManager2(
            s0, SWT.NONE, propertyEditorContext, schemaMeta.getSecurityReference());
    propertyWidgetManager.setConceptModel(conceptModel);
    propertyNavigationWidget.addSelectionChangedListener(propertyWidgetManager);
    s0.setWeights(new int[] {1, 2});

    FormData fdConcept = new FormData();
    fdConcept.left = new FormAttachment(0, 0);
    fdConcept.top = new FormAttachment(top, 10);
    fdConcept.right = new FormAttachment(100, 0);
    fdConcept.bottom = new FormAttachment(100, 0);
    conceptEditor.setLayoutData(fdConcept);

    return c0;
  }
  @Override
  public void createPartControl(@Nullable Composite parent) {
    super.createPartControl(parent);

    final SashForm sashForm = new SashForm(parent, SWT.NONE);

    fTableViewer = createSegmentStoreTableViewer(sashForm);
    fDensityViewer = createSegmentStoreDensityViewer(sashForm);
    fDensityViewer.addDataListener(new DataChangedListener());

    sashForm.setWeights(DEFAULT_WEIGHTS);

    Action zoomOut = new ZoomOutAction(this);
    IToolBarManager toolBar = getViewSite().getActionBars().getToolBarManager();
    toolBar.add(zoomOut);
    ITmfTrace trace = TmfTraceManager.getInstance().getActiveTrace();
    if (trace != null && fDensityViewer != null) {
      fDensityViewer.loadTrace(trace);
    }
  }
Beispiel #27
0
  @Override
  public void createPartControl(Composite parent) {
    parentComposite = new SashForm(parent, SWT.VERTICAL);

    createRequestEditor(parentComposite);
    createResponseViewer(parentComposite);

    parentComposite.setWeights(new int[] {50, 50});
    parentComposite.pack();

    final IContentAnalyzerFactory contentAnalyzerFactory =
        Activator.getDefault().getContentAnalyzerFactoryService();
    final IWorkspace workspace = Activator.getDefault().getModel().getCurrentWorkspace();
    if (workspace != null) {
      contentAnalyzer =
          contentAnalyzerFactory.createContentAnalyzer(
              workspace.getScanAlertRepository().getProxyScanInstance());
      contentAnalyzer.setDefaultAddToRequestLog(true);
      contentAnalyzer.setAddLinksToModel(true);
    }
  }
  public CompositeMainProtocolConfidence(
      Composite parent, int style, MinerResultsFP_Line minerresults) {
    super(parent, style);
    ip = minerresults.getIp();

    this.setLayout(new FillLayout());

    SashForm form = new SashForm(this, SWT.HORIZONTAL | SWT.BORDER);
    form.setLayout(new FillLayout());
    Composite win1 = new Composite(form, SWT.NONE);
    win1.setLayout(new FillLayout());

    CTabFolderChart tab = new CTabFolderChart(form, SWT.NONE, this);
    form.setWeights(new int[] {250, 800});

    System.out.println("ip=");

    CompositeTable table =
        new CompositeTable(
            win1, SWT.BORDER | SWT.SINGLE, ip, minerresults.protocolPairList, tab, this);
    tableIndex = new int[table.getTableIndexCount()];
  }
Beispiel #29
0
  @Override
  protected Control createDialogArea(Composite parent) {
    Composite container = (Composite) super.createDialogArea(parent);
    parent.getShell().setText(UIText.CommitDialog_CommitChanges);

    container = toolkit.createComposite(container);
    GridDataFactory.fillDefaults().grab(true, true).applyTo(container);
    toolkit.paintBordersFor(container);
    GridLayoutFactory.swtDefaults().applyTo(container);

    final SashForm sashForm = new SashForm(container, SWT.VERTICAL | SWT.FILL);
    toolkit.adapt(sashForm, true, true);
    sashForm.setLayoutData(GridDataFactory.fillDefaults().grab(true, true).create());
    createMessageAndPersonArea(sashForm);
    filesSection = createFileSection(sashForm);
    sashForm.setWeights(new int[] {50, 50});

    applyDialogFont(container);
    container.pack();
    commitText.setFocus();
    Image titleImage = UIIcons.WIZBAN_CONNECT_REPO.createImage();
    UIUtils.hookDisposal(parent, titleImage);
    setTitleImage(titleImage);
    setTitle(UIText.CommitDialog_Title);
    setMessage(UIText.CommitDialog_Message, IMessageProvider.INFORMATION);

    filesViewer.addCheckStateListener(
        new ICheckStateListener() {

          public void checkStateChanged(CheckStateChangedEvent event) {
            updateMessage();
          }
        });

    updateFileSectionText();
    return container;
  }
  /** {@inheritDoc} */
  @Override
  public void maximizeSubView(ISubView subView) {
    ISubView maximizeSubView = subView;
    if (maximizeSubView == null) {
      maximizeSubView = getSubViews().get(0);
    }

    int[] weights = new int[getSubViews().size()];
    int i = 0;
    for (ISubView view : getSubViews()) {
      if (ObjectUtils.equals(view, maximizeSubView)) {
        view.getControl().setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
        weights[i] = 1;
      } else {
        GridData gd = new GridData();
        gd.exclude = true;
        view.getControl().setLayoutData(gd);
        weights[i] = 0;
      }
      i++;
    }
    sashForm.setWeights(weights);
    layout();
  }