Java 类org.eclipse.swt.custom.ScrolledComposite 实例源码

项目:developer-studio    文件:UpdaterDialog.java   
private void createFeatureListTab(TabFolder tabFolder, ActiveTab type) {
    TabItem tabItem = new TabItem(tabFolder, SWT.NULL);
    if (type == ActiveTab.ALL_FEATURES) {
        tabItem.setText(ALL_FEATURES_TAB_TITLE);
    } else {
        tabItem.setText(UPDATES_TAB_TITLE);
    }
    ScrolledComposite scroll = new ScrolledComposite(tabFolder, SWT.V_SCROLL | SWT.H_SCROLL);
    scroll.setLayout(new GridLayout());
    scroll.setLayoutData(new GridData());

    Group group = new Group(scroll, SWT.NONE);
    group.setLayout(new GridLayout());
    group.setLayoutData(new GridData());
    listFeatures(group, type);
    scroll.setContent(group);
    scroll.setExpandHorizontal(true);
    scroll.setExpandVertical(true);
    scroll.setMinSize(group.computeSize(SWT.DEFAULT, SWT.DEFAULT));
    tabItem.setControl(scroll);
}
项目:AppleCommander    文件:SwtUtil.java   
/**
 * Setup some sensible paging information.
 */
public static void setupPagingInformation(ScrolledComposite composite) {
    GC gc = new GC(composite);
    FontMetrics fontMetrics = gc.getFontMetrics();
    gc.dispose();
    int fontHeight = fontMetrics.getHeight();
    int fontWidth = fontMetrics.getAverageCharWidth();
    Rectangle clientArea = composite.getClientArea();
    int lines = clientArea.height / fontHeight;
    int pageHeight = lines * fontHeight;
    int pageWidth = clientArea.width - fontWidth; 
    composite.getVerticalBar().setIncrement(fontHeight);
    composite.getVerticalBar().setPageIncrement(pageHeight);
    composite.getHorizontalBar().setIncrement(fontWidth);
    composite.getHorizontalBar().setPageIncrement(pageWidth);
}
项目:applecommander    文件:SwtUtil.java   
/**
 * Setup some sensible paging information.
 */
public static void setupPagingInformation(ScrolledComposite composite) {
    GC gc = new GC(composite);
    FontMetrics fontMetrics = gc.getFontMetrics();
    gc.dispose();
    int fontHeight = fontMetrics.getHeight();
    int fontWidth = fontMetrics.getAverageCharWidth();
    Rectangle clientArea = composite.getClientArea();
    int lines = clientArea.height / fontHeight;
    int pageHeight = lines * fontHeight;
    int pageWidth = clientArea.width - fontWidth; 
    composite.getVerticalBar().setIncrement(fontHeight);
    composite.getVerticalBar().setPageIncrement(pageHeight);
    composite.getHorizontalBar().setIncrement(fontWidth);
    composite.getHorizontalBar().setPageIncrement(pageWidth);
}
项目:Hydrograph    文件:PropertyDialogBuilder.java   
private void attachMouseScrollButtonListener(final ScrolledComposite scrolledComposite){
    scrolledComposite.addListener(SWT.MouseWheel, new Listener() {
        @Override
        public void handleEvent(Event event) {
            int wheelCount = event.count;
            wheelCount = (int) Math.ceil(wheelCount / 3.0f);
            while (wheelCount < 0) {
                scrolledComposite.getVerticalBar().setIncrement(4);
                wheelCount++;
            }

            while (wheelCount > 0) {
                scrolledComposite.getVerticalBar().setIncrement(-4);
                wheelCount--;
            }
        }
    });
}
项目:Hydrograph    文件:JoinMapDialog.java   
private void attachMouseScrollButtonListener(final ScrolledComposite scrolledComposite){
    scrolledComposite.addListener(SWT.MouseWheel, new Listener() {
        @Override
        public void handleEvent(Event event) {
            int wheelCount = event.count;
            wheelCount = (int) Math.ceil(wheelCount / 3.0f);
            while (wheelCount < 0) {
                scrolledComposite.getVerticalBar().setIncrement(4);
                wheelCount++;
            }

            while (wheelCount > 0) {
                scrolledComposite.getVerticalBar().setIncrement(-4);
                wheelCount--;
            }
        }
    });
}
项目:BiglyBT    文件:ConfigView.java   
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().contains(text) || compositeHasText(
                        composite, text))) {
            foundItems.add(items[i]);

            ensureExpandedTo(items[i]);
            items[i].setFont(filterFoundFont);
        } else {
            items[i].setFont(null);
        }
        filterTree(items[i].getItems(), text, foundItems);
    }
}
项目:BiglyBT    文件:ViewUtils.java   
public static void setViewRequiresOneDownload(Composite genComposite) {
    if (genComposite == null || genComposite.isDisposed()) {
        return;
    }
    Utils.disposeComposite(genComposite, false);

    Label lab = new Label(genComposite, SWT.NULL);
    GridData gridData = new GridData(SWT.CENTER, SWT.CENTER, true, true);
    gridData.verticalIndent = 10;
    lab.setLayoutData(gridData);
    Messages.setLanguageText(lab, "view.one.download.only");

    genComposite.layout(true);

    Composite parent = genComposite.getParent();
    if (parent instanceof ScrolledComposite) {
        ScrolledComposite scrolled_comp = (ScrolledComposite) parent;

        Rectangle r = scrolled_comp.getClientArea();
        scrolled_comp.setMinSize(genComposite.computeSize(r.width, SWT.DEFAULT ));
    }

}
项目:team-explorer-everywhere    文件:NotesCheckinControl.java   
protected NotesCheckinControl(final Composite parent, final int style, final CheckinControlOptions options) {
    super(parent, style, Messages.getString("NotesCheckinControl.Title"), CheckinSubControlType.CHECKIN_NOTES); //$NON-NLS-1$

    this.options = options;

    final FillLayout layout = new FillLayout();
    layout.marginHeight = 0;
    layout.marginWidth = 0;
    setLayout(layout);

    final int rootStyle = options.isForDialog() ? SWT.BORDER : SWT.NONE;
    rootComposite = new ScrolledComposite(this, SWT.V_SCROLL | rootStyle);
    rootComposite.setLayout(new FillLayout());
    rootComposite.setExpandHorizontal(true);
    rootComposite.setExpandVertical(true);

    addDisposeListener(new DisposeListener() {
        @Override
        public void widgetDisposed(final DisposeEvent e) {
            if (pendingCheckin != null) {
                pendingCheckin.getPendingChanges().removeAffectedTeamProjectsChangedListener(teamProjectsListener);
            }
        }
    });
}
项目:google-cloud-eclipse    文件:DeployPropertyPage.java   
private Runnable getLayoutChangedHandler() {
  return new Runnable() {

    @Override
    public void run() {
      // resize the page to work around https://bugs.eclipse.org/bugs/show_bug.cgi?id=265237
      Composite parent = getActivePanel().getParent();
      while (parent != null) {
        if (parent instanceof ScrolledComposite) {
          ScrolledComposite scrolledComposite = (ScrolledComposite) parent;
          scrolledComposite.setMinSize(getActivePanel().getParent().computeSize(SWT.DEFAULT, SWT.DEFAULT));
          getActivePanel().layout();
          return;
        }
        parent = parent.getParent();
      }
    }
  };
}
项目:openjfx-8u-dev-tests    文件:FXCanvasScrollApp.java   
protected FXCanvasScrollApp() {
    shell = new Shell();
    shell.setText(this.getClass().getSimpleName());
    shell.setLayout(new FillLayout());

    ScrolledComposite scrollPane = new ScrolledComposite(shell, SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL);
    FXCanvas fxCanvas = new FXCanvas(scrollPane, SWT.BORDER);
    fxCanvas.setScene(createScene(SCROLL_CONTAINER_ID));
    scrollPane.setContent(fxCanvas);
    scrollPane.setExpandHorizontal(true);
    scrollPane.setExpandVertical(true);
    fxCanvas.pack();
    scrollPane.setMinSize(fxCanvas.getSize());

    shell.pack();
    Monitor monitor = shell.getMonitor();
    Rectangle monitorRect = monitor.getClientArea();
    Rectangle shellRect = shell.getBounds();
    shellRect.x = Math.max(0, (monitorRect.width - shellRect.width) / 2);
    shellRect.y = Math.max(0, (monitorRect.height - shellRect.height) / 2);
    shell.setBounds(shellRect);
    shell.open();
}
项目:lider-ahenk-installer    文件:LiderClusterConfPage.java   
private void handleRemoveButtonClick(SelectionEvent event) {
    Button btnThis = (Button) event.getSource();
    Composite parent = btnThis.getParent();
    Control[] children = parent.getChildren();
    if (children != null) {
        for (int i = 0; i < children.length; i++) {
            if (children[i].equals(btnThis) && i - 1 > 0) {
                Group group = (Group) children[i - 1];
                Control[] childrenOfGroup = group.getChildren();
                Label number = (Label) childrenOfGroup[0];
                Integer intNumber = Integer.parseInt(number.getText());
                nodeMap.remove(intNumber);
                children[i - 1].dispose();
                children[i].dispose();
                redraw();
                break;
            }
        }
    }

    innerContainer.setSize(innerContainer.computeSize(SWT.DEFAULT, SWT.DEFAULT));
    ((ScrolledComposite) cmpMain).setMinSize(innerContainer.computeSize(SWT.DEFAULT, SWT.DEFAULT));

    updatePageCompleteStatus();
}
项目:lider-ahenk-installer    文件:XmppClusterConfPage.java   
private void handleRemoveButtonClick(SelectionEvent event) {
    Button btnThis = (Button) event.getSource();
    Composite parent = btnThis.getParent();
    Control[] children = parent.getChildren();
    if (children != null) {
        for (int i = 0; i < children.length; i++) {
            if (children[i].equals(btnThis) && i - 1 > 0) {
                Group group = (Group) children[i - 1];
                Control[] childrenOfGroup = group.getChildren();
                Label number = (Label) childrenOfGroup[0];
                Integer intNumber = Integer.parseInt(number.getText());
                nodeMap.remove(intNumber);
                children[i - 1].dispose();
                children[i].dispose();
                redraw();
                break;
            }
        }
    }

    innerContainer.setSize(innerContainer.computeSize(SWT.DEFAULT, SWT.DEFAULT));
    ((ScrolledComposite) cmpMain).setMinSize(innerContainer.computeSize(SWT.DEFAULT, SWT.DEFAULT));

    updatePageCompleteStatus();
}
项目:angular-eclipse    文件:AngularGlobalPreferencesPage.java   
private void setSize(Composite composite) {
    if (composite != null) {
        // Note: The font is set here in anticipation that the class
        // inheriting
        // this base class may add widgets to the dialog. setSize
        // is assumed to be called just before we go live.
        applyDialogFont(composite);
        Point minSize = composite.computeSize(SWT.DEFAULT, SWT.DEFAULT);
        composite.setSize(minSize);
        // set scrollbar composite's min size so page is expandable but
        // has scrollbars when needed
        if (composite.getParent() instanceof ScrolledComposite) {
            ScrolledComposite sc1 = (ScrolledComposite) composite.getParent();
            sc1.setMinSize(minSize);
            sc1.setExpandHorizontal(true);
            sc1.setExpandVertical(true);
        }
    }
}
项目:angular-eclipse    文件:HTMLAngularGlobalPreferencesPage.java   
private void setSize(Composite composite) {
    if (composite != null) {
        // Note: The font is set here in anticipation that the class inheriting
        //       this base class may add widgets to the dialog.   setSize
        //       is assumed to be called just before we go live.
        applyDialogFont(composite);
        Point minSize = composite.computeSize(SWT.DEFAULT, SWT.DEFAULT);
        composite.setSize(minSize);
        // set scrollbar composite's min size so page is expandable but
        // has scrollbars when needed
        if (composite.getParent() instanceof ScrolledComposite) {
            ScrolledComposite sc1 = (ScrolledComposite) composite.getParent();
            sc1.setMinSize(minSize);
            sc1.setExpandHorizontal(true);
            sc1.setExpandVertical(true);
        }
    }
}
项目:angular-eclipse    文件:HTMLAngularEditorPreferencesPage.java   
private void setSize(Composite composite) {
    if (composite != null) {
        // Note: The font is set here in anticipation that the class
        // inheriting
        // this base class may add widgets to the dialog. setSize
        // is assumed to be called just before we go live.
        applyDialogFont(composite);
        Point minSize = composite.computeSize(SWT.DEFAULT, SWT.DEFAULT);
        composite.setSize(minSize);
        // set scrollbar composite's min size so page is expandable but
        // has scrollbars when needed
        if (composite.getParent() instanceof ScrolledComposite) {
            ScrolledComposite sc1 = (ScrolledComposite) composite.getParent();
            sc1.setMinSize(minSize);
            sc1.setExpandHorizontal(true);
            sc1.setExpandVertical(true);
        }
    }
}
项目:ARXPlugin    文件:LayoutGeneral.java   
/**
 * Creates the Complete General Tab
 * @param parent The Parent Folder
 * @param meta The Meta Include for this Project
 * @param props The PropsUI from the Kettle Project
 * @param fieldNames The FieldNames from the Previous Step
 */
public LayoutGeneral(final CTabFolder parent, ARXPluginMeta meta, final PropsUI props, String[] fieldNames) {
    this.meta = meta;
    this.props = props;
    this.fieldNames = fieldNames;
    composites = new LayoutCompositeInterface[2];

    CTabItem tabGeneral = new CTabItem(parent, SWT.NONE);
    tabGeneral.setText(Resources.getMessage("General.2"));
    ScrolledComposite scroller = new ScrolledComposite(parent, SWT.V_SCROLL | SWT.H_SCROLL);
    this.build(scroller);
    tabGeneral.setControl(scroller);
    {

    }
}
项目:TranskribusSwtGui    文件:PortalWidget.java   
private void reattachWidget(Position pos) {
    SashForm sf = positionSashFormMap.get(pos);
    ScrolledComposite w = widgets.get(pos);
    if (w.getParent() == sf) // already attached to SashForm -> do nothing!
        return;

    w.setParent(sf); // set parent to SashForm again

    // move to left or right side of SashForm depending on flag in position:
    if (pos.isLeftSideOfSashForm)
        w.moveAbove(null);
    else
        w.moveBelow(null);

    sf.layout(true);
}
项目:afbb-bibo    文件:AbstractView.java   
@Override
public void createPartControl(final Composite parent) {
    try {
        final Composite outer = toolkit.createComposite(parent, SWT.NONE);
        final GridLayout layout = new GridLayout(1, false);
        layout.marginHeight = layout.marginWidth = 0;
        outer.setLayout(layout);
        final GridData layoutData = new GridData(GridData.FILL_BOTH);
        outer.setLayoutData(layoutData);

        createValidationComposite(outer);

        final ScrolledComposite content = new ScrolledComposite(outer, SWT.H_SCROLL | SWT.V_SCROLL);
        content.setExpandHorizontal(true);
        content.setExpandVertical(true);
        content.setLayout(layout);
        content.setLayoutData(layoutData);
        final Composite children = initUi(content);
        content.setMinSize(children.computeSize(SWT.DEFAULT, SWT.DEFAULT));
        content.setContent(children);
        createBinding();
        additionalTasks();
    } catch (final ConnectException e) {
        handle(e);
    }
}
项目:mappwidget    文件:MainView.java   
private void fillTop(Composite top, ScrolledComposite scrolledComposite)
{
    GridLayout layout = new GridLayout();
    layout.numColumns = 1;

    GridData data = new GridData();
    data.grabExcessHorizontalSpace = true;
    data.horizontalAlignment = GridData.FILL;

    top.setLayoutData(data);
    top.setLayout(layout);

    scrolledComposite.setMinSize(500, 250);
    scrolledComposite.setExpandHorizontal(true);
    scrolledComposite.setExpandVertical(true);
    scrolledComposite.setContent(top);
}
项目:PDFReporter-Studio    文件:PermissionPage.java   
private void createByUser(CTabFolder tabFolder) {
    CTabItem bptab = new CTabItem(tabFolder, SWT.NONE);
    bptab.setText(Messages.PermissionPage_5);

    scUser = new ScrolledComposite(tabFolder, SWT.H_SCROLL | SWT.V_SCROLL);
    scUser.setLayoutData(new GridData(GridData.FILL_BOTH));

    cmpUser = new Composite(scUser, SWT.NONE);
    cmpUser.setLayout(new GridLayout(2, true));

    scUser.setContent(cmpUser);
    // Set the minimum size
    scUser.setMinSize(cmpUser.computeSize(SWT.DEFAULT, SWT.DEFAULT).x, cmpUser.computeSize(SWT.DEFAULT, SWT.DEFAULT).y);

    // Expand both horizontally and vertically
    scUser.setExpandHorizontal(true);
    scUser.setExpandVertical(true);

    bptab.setControl(scUser);
}
项目:PDFReporter-Studio    文件:PermissionPage.java   
private void createByRole(CTabFolder tabFolder) {
    CTabItem bptab = new CTabItem(tabFolder, SWT.NONE);
    bptab.setText(Messages.PermissionPage_6);

    scRole = new ScrolledComposite(tabFolder, SWT.H_SCROLL | SWT.V_SCROLL);
    scRole.setLayoutData(new GridData(GridData.FILL_BOTH));

    cmpRole = new Composite(scRole, SWT.NONE);
    cmpRole.setLayout(new GridLayout(2, true));

    scRole.setContent(cmpRole);
    // Set the minimum size
    scRole.setMinSize(cmpRole.computeSize(SWT.DEFAULT, SWT.DEFAULT).x, cmpRole.computeSize(SWT.DEFAULT, SWT.DEFAULT).y);

    // Expand both horizontally and vertically
    scRole.setExpandHorizontal(true);
    scRole.setExpandVertical(true);

    bptab.setControl(scRole);
}
项目:PDFReporter-Studio    文件:ShowServersPage.java   
@Override
public void createControl(Composite parent) {
    Composite mainComposite = new Composite(parent, SWT.NONE);
    mainComposite.setLayout(GridLayoutFactory.fillDefaults().create());

    Label titleLabel = new Label(mainComposite, SWT.NONE);
    titleLabel.setText(Messages.ShowServersPage_label);

    ScrolledComposite scrollComp = new ScrolledComposite(mainComposite, SWT.V_SCROLL | SWT.H_SCROLL);
    scrollComp.setLayoutData(GridDataFactory.fillDefaults().grab(true, true).hint(SWT.DEFAULT, 200).create());
    scrollComp.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
    scrollComp.setLayout(new GridLayout(1,false));
    scrollComp.setExpandHorizontal(true);
    scrollComp.setExpandVertical(true);
    content = new Composite(scrollComp, SWT.NONE);
    scrollComp.setContent(content);
    content.setLayout(new GridLayout(1,false));
    content.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
    setControl(mainComposite);
}
项目:PDFReporter-Studio    文件:ConnectToDomainWizardPage.java   
@Override
public void createControl(Composite parent) {

    //Calculate which parameters are needed and where they are needed
    String datasetName = (String)connectedDataset.getPropertyActualValue(JRDesignDataset.PROPERTY_NAME);
    runReferences = DeleteDatasetCommand.getDatasetUsage(connectedDataset.getRoot().getChildren(), datasetName);
    missingParamOnMain = getMissingParameterOnMainDataset();
    missingParamOnDataset = getMissingParameterOnDataset();
    missingParamOnRun = getMissingDatasetsRun();

    //Create the appropriate controls for this parameters
  ScrolledComposite scrollComposite = new ScrolledComposite(parent, SWT.V_SCROLL);
  scrollComposite.setExpandVertical(true);
    Composite mainComposite = new Composite(scrollComposite, SWT.NONE);
    scrollComposite.setContent(mainComposite);
    mainComposite.setLayout(new GridLayout(1,false));
    if (missingParamOnMain.isEmpty() && missingParamOnRun.isEmpty() && missingParamOnRun.isEmpty()){
        new Label(mainComposite, SWT.NONE).setText(Messages.ConnectToDomainWizardPage_noChangesLabel);
    } else createNotEmptyContent(mainComposite);
    mainComposite.setLayoutData(new GridData(GridData.FILL_BOTH));
    scrollComposite.setMinSize(mainComposite.computeSize(SWT.DEFAULT, SWT.DEFAULT));
    mainComposite.setSize(mainComposite.computeSize(SWT.DEFAULT, SWT.DEFAULT));
   UIUtils.resizeAndCenterShell(parent.getShell(), 650, 550);
    setControl(mainComposite);
}
项目:PDFReporter-Studio    文件:ShowAdaptersPage.java   
@Override
public void createControl(Composite parent) {   

    Composite mainComposite = new Composite(parent, SWT.NONE);
    mainComposite.setLayout(GridLayoutFactory.fillDefaults().create());


    Label titleLabel = new Label(mainComposite, SWT.NONE);
    titleLabel.setText(Messages.ShowAdaptersPage_label);
    ScrolledComposite scrollComp = new ScrolledComposite(mainComposite, SWT.V_SCROLL | SWT.H_SCROLL);
    scrollComp.setLayoutData(GridDataFactory.fillDefaults().grab(true, true).hint(SWT.DEFAULT, 200).create());
    scrollComp.setLayout(new GridLayout(1,false));
    scrollComp.setExpandHorizontal(true);
    scrollComp.setExpandVertical(true);
    content = new Composite(scrollComp, SWT.NONE);
    scrollComp.setContent(content);
    content.setLayout(new GridLayout(1,false));
    content.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
    setControl(mainComposite);
}
项目:PDFReporter-Studio    文件:FormattingToolsView.java   
@Override
public void createPartControl(Composite parent) {
    scrollComp = new ScrolledComposite(parent, SWT.V_SCROLL);
    scrollComp.setLayoutData(new GridData(GridData.FILL_BOTH));
    scrollComp.setLayout(new GridLayout(1,false));
    scrollComp.setExpandVertical(true);
    scrollComp.setExpandHorizontal(true);
    scrollComp.addControlListener(new ControlAdapter() {
        @Override
        public void controlResized(ControlEvent e) {
            refreshScrolledHeight();
        }
    });
    mainContainer = new Composite(scrollComp, SWT.BORDER);
    mainContainer.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
    scrollComp.setContent(mainContainer);
   mainContainer.setLayout(new ButtonFillLayout());

    IWorkbenchPart editor = getContributingPart();
    if (editor instanceof CachedSelectionProvider){
        CachedSelectionProvider cachedSelEditor = (CachedSelectionProvider)editor;
        cachedSelEditor.getSelectionCache().addSelectionChangeListener(selectionListener);
    } 
}
项目:PDFReporter-Studio    文件:ExcelExporterPreferencePage.java   
private void createJExcelAPI(CTabFolder tabFolder) {
    CTabItem ptab = new CTabItem(tabFolder, SWT.NONE);
    ptab.setText(Messages.ExcelExporterPreferencePage_60);

    ScrolledComposite scompo = new ScrolledComposite(tabFolder, SWT.V_SCROLL | SWT.H_SCROLL);
    scompo.setExpandHorizontal(true);
    scompo.setExpandVertical(true);

    Composite sc = new Composite(scompo, SWT.NONE);
    sc.setLayout(new GridLayout(3, false));

    BooleanFieldEditor bf = new BooleanFieldEditor(XlsExporterConfiguration.PROPERTY_CREATE_CUSTOM_PALETTE,
            Messages.ExcelExporterPreferencePage_61, sc);
    addField(bf);
    HelpSystem.setHelp(bf.getDescriptionControl(sc), StudioPreferencePage.REFERENCE_PREFIX + bf.getPreferenceName());

    addField(new BooleanFieldEditor(JxlExporterConfiguration.PROPERTY_USE_TEMP_FILE,
            Messages.ExcelExporterPreferencePage_62, sc));
    addField(new BooleanFieldEditor(JxlReportConfiguration.PROPERTY_COMPLEX_FORMAT,
            Messages.ExcelExporterPreferencePage_63, sc));

    scompo.setMinSize(sc.getSize());
    scompo.setContent(sc);
    ptab.setControl(scompo);
}
项目:PDFReporter-Studio    文件:ODSExporterPreferencePage.java   
private void createJExcelAPI(CTabFolder tabFolder) {
    CTabItem ptab = new CTabItem(tabFolder, SWT.NONE);
    ptab.setText(Messages.ExcelExporterPreferencePage_60);

    ScrolledComposite scompo = new ScrolledComposite(tabFolder, SWT.V_SCROLL | SWT.H_SCROLL);
    scompo.setExpandHorizontal(true);
    scompo.setExpandVertical(true);

    Composite sc = new Composite(scompo, SWT.NONE);
    sc.setLayout(new GridLayout(3, false));

    BooleanFieldEditor bf = new BooleanFieldEditor(XlsExporterConfiguration.PROPERTY_CREATE_CUSTOM_PALETTE,
            Messages.ExcelExporterPreferencePage_61, sc);
    addField(bf);
    HelpSystem.setHelp(bf.getDescriptionControl(sc), StudioPreferencePage.REFERENCE_PREFIX + bf.getPreferenceName());

    addField(new BooleanFieldEditor(NSF_EXPORT_XLS_USE_TMP_FILE, Messages.ExcelExporterPreferencePage_62, sc));
    addField(new BooleanFieldEditor(NSF_EXPORT_XLS_CELL_COMPLEX_FORMAT, Messages.ExcelExporterPreferencePage_63, sc));

    scompo.setMinSize(sc.getSize());
    scompo.setContent(sc);
    ptab.setControl(scompo);
}
项目:PDFReporter-Studio    文件:VExporter.java   
@Override
protected Control createControl(Composite parent) {
    scompo = new ScrolledComposite(parent, SWT.V_SCROLL | SWT.H_SCROLL);
    scompo.setExpandHorizontal(true);
    scompo.setExpandVertical(true);
    scompo.setAlwaysShowScrollBars(false);
    scompo.setMinSize(100, 100);

    composite = new Composite(scompo, SWT.BORDER);
    composite.setBackgroundMode(SWT.INHERIT_FORCE);
    composite.setBackground(parent.getBackground());
    GridLayout layout = new GridLayout();
    layout.marginBottom = 20;
    composite.setLayout(layout);
    scompo.setContent(composite);

    return scompo;
}
项目:PDFReporter-Studio    文件:ParametersDialog.java   
private void createBParam(FormToolkit toolkit, CTabFolder tabFolder) {
    CTabItem bptab = new CTabItem(tabFolder, SWT.NONE);
    bptab.setText(Messages.ParametersDialog_built_in_parameters);

    ScrolledComposite scompo = new ScrolledComposite(tabFolder, SWT.V_SCROLL | SWT.H_SCROLL);
    scompo.setExpandHorizontal(true);
    scompo.setExpandVertical(true);

    Composite sectionClient = toolkit.createComposite(scompo);
    sectionClient.setLayout(new GridLayout(2, false));

    for (JRParameter p : prompts)
        if (!p.isForPrompting() || p.isSystemDefined())
            createInput(toolkit, sectionClient, (JRDesignParameter) p);
    sectionClient.pack();
    scompo.setMinSize(sectionClient.getSize());
    scompo.setContent(sectionClient);
    bptab.setControl(scompo);
}
项目:PDFReporter-Studio    文件:ParametersDialog.java   
private void createUserParam(FormToolkit toolkit, CTabFolder tabFolder) {
    if (canShowParameters()) {
        CTabItem ptab = new CTabItem(tabFolder, SWT.NONE);
        ptab.setText(Messages.ParametersDialog_user_parameters);

        ScrolledComposite scompo = new ScrolledComposite(tabFolder, SWT.V_SCROLL | SWT.H_SCROLL);
        scompo.setExpandHorizontal(true);
        scompo.setExpandVertical(true);

        Composite sectionClient = toolkit.createComposite(scompo);
        sectionClient.setLayout(new GridLayout(2, false));

        for (JRParameter p : prompts)
            if (p.isForPrompting() && !p.isSystemDefined())
                createInput(toolkit, sectionClient, (JRDesignParameter) p);
        sectionClient.pack();
        scompo.setMinSize(sectionClient.getSize());
        scompo.setContent(sectionClient);
        ptab.setControl(scompo);
    }
}
项目:PDFReporter-Studio    文件:TabbedPropertyComposite.java   
/**
 * Calculate the real height of displayed sections in the properties tab.
 * Then Update the minimum height of the scrolled composite, to make the scrollbars
 * appear only when they are needed. The update is done only if it is necessary
 *
 */
public void updatePageMinimumSize(){
    Control topControl = cachedLayout.topControl;
    if (topControl != null && topControl instanceof ScrolledComposite){
        int height = 0;
        int width = getBounds().width;
        ScrolledComposite scrolledComposite = (ScrolledComposite)topControl;
        // When i calculate the height it is really important to give the real width
        // of the composite, since it is used to calculate the number of columns
        height = scrolledComposite.getContent().computeSize(width, SWT.DEFAULT).y;
        int actualMinheight = scrolledComposite.getMinHeight();
        boolean barVisible = scrolledComposite.getVerticalBar().isVisible();
        if (barVisible || height > actualMinheight) {
            scrolledComposite.setMinHeight(height);
        }
    }
}
项目:gama    文件:PopulationInspectView.java   
private void createMenus(final Composite parent) {
    final ScrolledComposite scroll = new ScrolledComposite(parent, SWT.V_SCROLL);
    scroll.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, true, 1, 1));
    scroll.setExpandHorizontal(true);
    scroll.setExpandVertical(true);
    attributesMenu = new Composite(scroll, SWT.NONE);
    scroll.setContent(attributesMenu);
    final GridLayout layout = new GridLayout(1, false);
    layout.marginWidth = 0;
    layout.marginHeight = 0;
    layout.verticalSpacing = 1;
    attributesMenu.setLayout(layout);
    attributesMenu.setBackground(IGamaColors.WHITE.color());
    fillAttributeMenu();
    final Point size = attributesMenu.computeSize(SWT.DEFAULT, SWT.DEFAULT, true);
    attributesMenu.setSize(size);
    attributesMenu.layout(true, true);
    scroll.setMinSize(size);

}
项目:gama    文件:ErrorView.java   
@Override
protected ParameterExpandItem createItem(final Composite parent, final GamaRuntimeException data,
        final boolean expanded, final GamaUIColor color) {
    createViewer(parent);
    if (getViewer() == null) { return null; }
    final ScrolledComposite control = createItemContentsFor(data);
    ParameterExpandItem item;
    if (expanded) {
        createStackTrace(control, data);
        item = createItem(parent, data, control, expanded, color);
    } else {
        item = createItem(parent, data, control, expanded, color);
        item.onExpand(() -> createStackTrace(control, data));
    }
    return item;
}
项目:gama    文件:ParameterExpandItem.java   
/**
 * Sets the expanded state of the receiver.
 *
 * @param expanded
 *            the new expanded state
 *
 * @exception SWTException
 *                <ul>
 *                <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
 *                <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
 *                </ul>
 */
public void setExpanded(final boolean expanded) {
    if (parent == null) { return; }
    // checkWidget();
    this.expanded = expanded;
    if (onExpandBlock != null) {
        if (expanded) {
            onExpandBlock.run();
            setHeight(control.computeSize(SWT.DEFAULT, SWT.DEFAULT).y);
        } else {
            for (final Control c : control.getChildren()) {
                c.dispose();
            }
            if (control instanceof ScrolledComposite) {
                ((ScrolledComposite) control).setContent(null);
            }
        }
    }
    parent.showItem(this);
}
项目:eclipse-wtp-json    文件:EmptyFilePreferencePage.java   
private void setSize(Composite composite) {
    if (composite != null) {
        // Note: The font is set here in anticipation that the class inheriting
        //       this base class may add widgets to the dialog.   setSize
        //       is assumed to be called just before we go live.
        applyDialogFont(composite);
        Point minSize = composite.computeSize(SWT.DEFAULT, SWT.DEFAULT);
        composite.setSize(minSize);
        // set scrollbar composite's min size so page is expandable but
        // has scrollbars when needed
        if (composite.getParent() instanceof ScrolledComposite) {
            ScrolledComposite sc1 = (ScrolledComposite) composite.getParent();
            sc1.setMinSize(minSize);
            sc1.setExpandHorizontal(true);
            sc1.setExpandVertical(true);
        }
    }
}
项目:mytourbook    文件:Map3StatisticsView.java   
private void createUI(final Composite parent) {

        _tk = new FormToolkit(parent.getDisplay());

        _scrolledContainer = new ScrolledComposite(parent, SWT.V_SCROLL);
        {
            _scrolledContent = _tk.createComposite(_scrolledContainer);
            GridDataFactory.fillDefaults().applyTo(_scrolledContent);
            GridLayoutFactory.swtDefaults().numColumns(1).applyTo(_scrolledContent);
            {
                createUI_10_StatisticsContainer(_scrolledContent);
            }

            // setup scrolled container
            _scrolledContainer.setExpandVertical(true);
            _scrolledContainer.setExpandHorizontal(true);
            _scrolledContainer.addControlListener(new ControlAdapter() {
                @Override
                public void controlResized(final ControlEvent e) {
                    onResizeScrolledContainer(_scrolledContent);
                }
            });

            _scrolledContainer.setContent(_scrolledContent);
        }
    }
项目:mytourbook    文件:DialogMap3ColorEditor.java   
private Composite createUI_52_VertexScrolledContainer(final Composite parent) {

        // scrolled container
        _vertexScrolledContainer = new ScrolledComposite(parent, SWT.V_SCROLL);
        GridDataFactory.fillDefaults().grab(true, true).applyTo(_vertexScrolledContainer);
        _vertexScrolledContainer.setExpandVertical(true);
        _vertexScrolledContainer.setExpandHorizontal(true);

        // vertex container
        final Composite vertexContainer = new Composite(_vertexScrolledContainer, SWT.NONE);
        GridDataFactory.fillDefaults().grab(true, true).applyTo(vertexContainer);
        GridLayoutFactory.fillDefaults()//
                .numColumns(6)
                .applyTo(vertexContainer);
//      vertexContainer.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_GRAY));

        _vertexScrolledContainer.setContent(vertexContainer);
        _vertexScrolledContainer.addControlListener(new ControlAdapter() {
            @Override
            public void controlResized(final ControlEvent e) {
                _vertexScrolledContainer.setMinSize(vertexContainer.computeSize(SWT.DEFAULT, SWT.DEFAULT));
            }
        });

        return vertexContainer;
    }
项目:mytourbook    文件:DialogEasyImportConfig.java   
private Composite createUI_568_IL_SpeedTourType_ScrolledContainer(final Composite parent) {

        // scrolled container
        _speedTourType_ScrolledContainer = new ScrolledComposite(parent, SWT.V_SCROLL);
        GridDataFactory.fillDefaults().grab(true, true).applyTo(_speedTourType_ScrolledContainer);
        _speedTourType_ScrolledContainer.setExpandVertical(true);
        _speedTourType_ScrolledContainer.setExpandHorizontal(true);

        // container
        final Composite speedTTContainer = new Composite(_speedTourType_ScrolledContainer, SWT.NONE);
        GridDataFactory.fillDefaults().grab(true, true).applyTo(speedTTContainer);
        GridLayoutFactory
                .fillDefaults()//
                .numColumns(5)
                .applyTo(speedTTContainer);

        _speedTourType_ScrolledContainer.setContent(speedTTContainer);
        _speedTourType_ScrolledContainer.addControlListener(new ControlAdapter() {
            @Override
            public void controlResized(final ControlEvent e) {
                _speedTourType_ScrolledContainer.setMinSize(speedTTContainer.computeSize(SWT.DEFAULT, SWT.DEFAULT));
            }
        });

        return speedTTContainer;
    }
项目:mytourbook    文件:DialogSelectSRTMColors.java   
private Composite createUI_72_VertexScrolledContainer(final Composite parent) {

        // scrolled container
        _vertexScrolledContainer = new ScrolledComposite(parent, SWT.V_SCROLL);
        GridDataFactory.fillDefaults().grab(false, true).applyTo(_vertexScrolledContainer);
        _vertexScrolledContainer.setExpandVertical(true);
        _vertexScrolledContainer.setExpandHorizontal(true);

        // vertex container
        final Composite vertexContainer = new Composite(_vertexScrolledContainer, SWT.NONE);
        GridLayoutFactory.fillDefaults().numColumns(3).applyTo(vertexContainer);

        _vertexScrolledContainer.setContent(vertexContainer);
        _vertexScrolledContainer.addControlListener(new ControlAdapter() {
            @Override
            public void controlResized(final ControlEvent e) {
                _vertexScrolledContainer.setMinSize(vertexContainer.computeSize(SWT.DEFAULT, SWT.DEFAULT));
            }
        });

        return vertexContainer;
    }
项目:mytourbook    文件:BuildToolWizardConfigurationPage.java   
public void createControl(Composite parent) {       
    // Create a scrollable container to hold components
    // This is useful when users are using a lower resolution.
    ScrolledComposite comp = new ScrolledComposite(parent, SWT.V_SCROLL | SWT.H_SCROLL);
    Composite container = new Composite(comp, SWT.NONE);
    container.setLayout(new GridLayout(1, false));
    container.setLayoutData(new GridData(GridData.FILL_BOTH));

    createConfigurationArea(container);

    createLanguagePackFilteredListArea(container);

    createCoverageReportFilteredListArea(container);

    setControl(container);
    Dialog.applyDialogFont(container);
    setPageComplete(!"".equals(fWorkingDirectoryLocationText.getText()) && !"".equals(fTranslationCatalogueLocationText.getText()));

    // Scrollable container properties
    comp.setContent(container);
    comp.setMinHeight(500);
    comp.setExpandHorizontal(true);
    comp.setExpandVertical(true);
}