Examples of ScrolledComposite


Examples of org.eclipse.swt.custom.ScrolledComposite

  public Composite createConfigSection(TreeItem treeItemParent,
                                        String sNameID,
                                        int position,
                                        boolean bPrefix) {
    ScrolledComposite sc = new ScrolledComposite(cConfigSection, SWT.H_SCROLL | SWT.V_SCROLL);
    sc.setExpandHorizontal(true);
    sc.setExpandVertical(true);
    sc.setLayoutData(new GridData(GridData.FILL_BOTH));
    sc.getVerticalBar().setIncrement(16);
    sc.addListener(SWT.Resize, scResizeListener);

    Composite cConfigSection = new Composite(sc, SWT.NULL);
   
    String section_key = ((bPrefix) ? sSectionPrefix : "") + sNameID;
   
    if (position == -2) { // Means "auto-order".
      position = findInsertPointFor(MessageText.getString(section_key), (treeItemParent == null) ? (Object)tree : (Object)treeItemParent);
    }

    TreeItem treeItem;
    if (treeItemParent == null) {
      if (position >= 0)
        treeItem = new TreeItem(tree, SWT.NULL, position);
      else
        treeItem = new TreeItem(tree, SWT.NULL);
    } else {
      if (position >= 0)
        treeItem = new TreeItem(treeItemParent, SWT.NULL, position);
      else
        treeItem = new TreeItem(treeItemParent, SWT.NULL);
    }
    Messages.setLanguageText(treeItem, section_key);
    treeItem.setData("Panel", sc);
    treeItem.setData("ID", sNameID);

    sc.setContent(cConfigSection);
    return cConfigSection;
  }
View Full Code Here

Examples of org.eclipse.swt.custom.ScrolledComposite

    // I don't want to waste my time :) [tux]
    if (sc != null && !sc.isDisposed()) {
      sc.dispose();
    }

    sc = new ScrolledComposite(composite, SWT.V_SCROLL | SWT.H_SCROLL );
    sc.getVerticalBar().setIncrement(16);
    sc.setExpandHorizontal(true);
    sc.setExpandVertical(true);
    GridData gridData = new GridData(GridData.FILL, GridData.FILL, true, true, 1, 1);
    sc.setLayoutData(gridData)
View Full Code Here

Examples of org.eclipse.swt.custom.ScrolledComposite

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

      final ScrolledComposite scrollable = new ScrolledComposite(shell, SWT.V_SCROLL | SWT.H_SCROLL );
      GridData gridData = new GridData(SWT.FILL, SWT.FILL, true, true);
      gridData.horizontalSpan = 3;
     
    scrollable.setLayoutData( gridData );

    /*
     * Main content composite where panels will be created
     */
    final Composite main = new Composite(scrollable, SWT.NONE);

    layout = new GridLayout();
    layout.marginHeight = 0;
    layout.marginWidth = 0;
    //layout.verticalSpacing = 0;
    layout.numColumns = 2;
    main.setLayout(layout);
   
    scrollable.setContent(main);
    scrollable.setExpandVertical(true);
    scrollable.setExpandHorizontal(true);

    /*
     * Re-adjust scrollbar setting when the window resizes
     */
    scrollable.addControlListener(new ControlAdapter() {
      public void controlResized(ControlEvent e) {
        Rectangle r = scrollable.getClientArea();
        scrollable.setMinSize(main.computeSize(r.width, SWT.DEFAULT ));
      }
    });
     
      gridData = new GridData(GridData.FILL_BOTH);
      gridData.horizontalSpan = 3;
View Full Code Here

Examples of org.eclipse.swt.custom.ScrolledComposite

    topLabel = new Label(pieceInfoComposite, SWT.NULL);
    gridData = new GridData(SWT.FILL, SWT.DEFAULT, false, false);
    topLabel.setLayoutData(gridData);

    sc = new ScrolledComposite(pieceInfoComposite, SWT.V_SCROLL);
    sc.setExpandHorizontal(true);
    sc.setExpandVertical(true);
    layout = new GridLayout();
    layout.horizontalSpacing = 0;
    layout.verticalSpacing = 0;
View Full Code Here

Examples of org.eclipse.swt.custom.ScrolledComposite

    shell.setLayout(gLayout);

    /*
     * Using ScrolledComposite with only vertical scroll
     */
    scrollable = new ScrolledComposite(shell, SWT.V_SCROLL);
    scrollable.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));

    /*
     * Main content composite where panels will be created
     */
 
View Full Code Here

Examples of org.eclipse.swt.custom.ScrolledComposite

    topLabel = new Label(fileInfoComposite, SWT.NULL);
    gridData = new GridData(SWT.FILL, SWT.DEFAULT, false, false);
    topLabel.setLayoutData(gridData);

    sc = new ScrolledComposite(fileInfoComposite, SWT.V_SCROLL);
    sc.setExpandHorizontal(true);
    sc.setExpandVertical(true);
    layout = new GridLayout();
    layout.horizontalSpacing = 0;
    layout.verticalSpacing = 0;
View Full Code Here

Examples of org.eclipse.swt.custom.ScrolledComposite

            }else{
              treeItem = new TreeItem(tree, SWT.NULL);
            }
          }
 
          ScrolledComposite sc = new ScrolledComposite(cConfigSection, SWT.H_SCROLL | SWT.V_SCROLL);
          sc.setExpandHorizontal(true);
          sc.setExpandVertical(true);
          sc.setLayoutData(new GridData(GridData.FILL_BOTH));
          sc.getVerticalBar().setIncrement(16);
          sc.addListener(SWT.Resize, scResizeListener);
         
          if(i == 0) {
            Composite c;
            if ( section instanceof ConfigSectionSWT ){
             
              c = ((ConfigSectionSWT)section).configSectionCreate(sc);
             
            }else{
  
                c = ((UISWTConfigSection)section).configSectionCreate(sc);
            }
            sectionsCreated.add(section);
            sc.setContent(c);
          }
         
          Messages.setLanguageText(treeItem, section_key);
          treeItem.setData("Panel", sc);
          treeItem.setData("ID", name);
View Full Code Here

Examples of org.eclipse.swt.custom.ScrolledComposite

  protected void filterTree(TreeItem[] items, String text,
      ArrayList<TreeItem> foundItems) {
    text = text.toLowerCase();
    for (int i = 0; i < items.length; i++) {
      ensureSectionBuilt(items[i], false);
      ScrolledComposite composite = (ScrolledComposite) items[i].getData("Panel");

      if (text.length() > 0
          && (items[i].getText().toLowerCase().indexOf(text) >= 0 || compositeHasText(
              composite, text))) {
        foundItems.add(items[i]);
View Full Code Here

Examples of org.eclipse.swt.custom.ScrolledComposite

   
    return false;
  }

  private void showSection(TreeItem section) {
    ScrolledComposite item = (ScrolledComposite)section.getData("Panel");

    if (item != null) {
     
      ensureSectionBuilt(section, true);
     
      layoutConfigSection.topControl = item;
     
      setupSC(item);

      if (filterText != null && filterText.length() > 0) {
        hilightText(item, filterText);
        item.layout(true, true);
      }

      cConfigSection.layout();
     
      updateHeader(section);
View Full Code Here

Examples of org.eclipse.swt.custom.ScrolledComposite

    child.setBackground(child.getDisplay().getSystemColor(SWT.COLOR_INFO_BACKGROUND));
    child.setForeground(child.getDisplay().getSystemColor(SWT.COLOR_INFO_FOREGROUND));
  }

  private void ensureSectionBuilt(TreeItem treeSection, boolean recreateIfAlreadyThere) {
    ScrolledComposite item = (ScrolledComposite)treeSection.getData("Panel");

    if (item != null) {
     
      ConfigSection configSection = (ConfigSection)treeSection.getData("ConfigSectionSWT");
     
      if (configSection != null) {
       
        Control previous = item.getContent();
        if (previous instanceof Composite) {
          if (!recreateIfAlreadyThere) {
            return;
          }
          configSection.configSectionDelete();
          sectionsCreated.remove(configSection);     
          Utils.disposeComposite((Composite)previous,true);
        }
       
        Composite c;
       
        if ( configSection instanceof ConfigSectionSWT ){
         
          c = ((ConfigSectionSWT)configSection).configSectionCreate(item);
         
        }else{

          c = ((UISWTConfigSection)configSection).configSectionCreate(item);
        }
        sectionsCreated.add(configSection);
       
        item.setContent(c);
      }
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.