org.eclipse.swt.widgets.Composite#computeSize ( )源码实例Demo

下面列出了org.eclipse.swt.widgets.Composite#computeSize ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: cppcheclipse   文件: FieldEditorOverlayPage.java
/**
 * Must be called for each composite after some fieldeditors are added,
 * because each field editor resets the parent's layout manager in
 * FieldEditor::createControl
 * 
 * @param composite
 */
protected void setCompositeLayout(Composite composite) {

	Point size = composite.computeSize(SWT.DEFAULT, SWT.DEFAULT);
	composite.setSize(size);
	composite.setFont(getFieldEditorParent().getFont());

	GridLayout layout = new GridLayout(2, false);
	/*
	 * layout.numColumns = 1; layout.marginLeft = 40; layout.marginHeight =
	 * 10;
	 */
	layout.horizontalSpacing = 8;
	composite.setLayout(layout);

	GridData gd = new GridData();
	gd.horizontalSpan = 2;
	composite.setLayoutData(gd);
}
 
/**
 * Do layout. Several magic #s in here...
 * 
 * @param scrolledComposite
 */
private void setupScrolledComposite() {
  setAlwaysShowScrollBars(true);

  scrolledCanvas = new Composite(this, SWT.NONE);
  GridLayoutFactory.fillDefaults().spacing(0, 0).applyTo(scrolledCanvas);

  setMinWidth(100);
  setMinHeight(100);
  setExpandHorizontal(true);
  setExpandVertical(true);
  setMinHeight(1);

  Point size = scrolledCanvas.computeSize(getParent().getSize().x,
      SWT.DEFAULT, true);
  scrolledCanvas.setSize(size);

  addControlListener(new ControlAdapter() {
    @Override
    public void controlResized(ControlEvent e) {
      doUpdateContentSize();
      updateScrollIncrements();
    }
  });
  setContent(scrolledCanvas);
}
 
@Override
protected Control createContents(Composite parent) {
	ScrolledPageContent scrolled= new ScrolledPageContent(parent, SWT.H_SCROLL | SWT.V_SCROLL);
	scrolled.setExpandHorizontal(true);
	scrolled.setExpandVertical(true);

	Composite control= new Composite(scrolled, SWT.NONE);
	GridLayout layout= new GridLayout();
	layout.numColumns= 2;
	layout.marginWidth= 0;
	layout.marginHeight= 0;
	control.setLayout(layout);

	createFavoriteList(control);

	initialize();

	scrolled.setContent(control);
	final Point size= control.computeSize(SWT.DEFAULT, SWT.DEFAULT);
	scrolled.setMinSize(size.x, size.y);

	Dialog.applyDialogFont(scrolled);

	return scrolled;
}
 
/**
 * Creates page for appearance preferences.
 *
 * @param parent the parent composite
 * @return the control for the preference page
 */
public Control createControl(Composite parent) {
	initializeDialogUnits(parent);

	ScrolledPageContent scrolled= new ScrolledPageContent(parent, SWT.H_SCROLL | SWT.V_SCROLL);
	scrolled.setExpandHorizontal(true);
	scrolled.setExpandVertical(true);


	Composite composite= new Composite(scrolled, SWT.NONE);
	GridLayout layout= new GridLayout();
	layout.marginWidth= 0;
	layout.marginHeight= 0;
	composite.setLayout(layout);

	createHeader(composite);
	createAppearancePage(composite);

	scrolled.setContent(composite);
	final Point size= composite.computeSize(SWT.DEFAULT, SWT.DEFAULT);
	scrolled.setMinSize(size.x, size.y);
	return scrolled;

}
 
源代码5 项目: birt   文件: TaskSelectType.java
protected void createBottomTypeArea( Composite parent )
{
	ScrolledComposite sc = new ScrolledComposite( parent, SWT.V_SCROLL
			| SWT.H_SCROLL );
	{
		GridLayout layout = new GridLayout( );
		sc.setLayout( layout );
		GridData gridData = new GridData( GridData.FILL_BOTH );
		sc.setLayoutData( gridData );
		sc.setExpandHorizontal( true );
		sc.setExpandVertical( true );
	}

	cmpType = new Composite( sc, SWT.NONE );
	cmpType.setLayout( new GridLayout( 2, false ) );
	cmpType.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) );
	sc.setContent( cmpType );

	createLeftTypeTable( cmpType );
	populateChartTypes( );

	createRightDetails( cmpType );

	Point size = cmpType.computeSize( SWT.DEFAULT, SWT.DEFAULT );
	sc.setMinSize( size );
}
 
源代码6 项目: birt   文件: MongoDBDataSourcePageHelper.java
public Composite createPageControls( Composite parent )
{
	ScrolledComposite scrolledComposite = new ScrolledComposite( parent,
			SWT.V_SCROLL | SWT.H_SCROLL );
	scrolledComposite.setAlwaysShowScrollBars( false );
	scrolledComposite.setExpandHorizontal(true);
	scrolledComposite.setExpandVertical(true);
	scrolledComposite.setLayout( new FillLayout( ) );
	Composite composite = new Composite( scrolledComposite, SWT.NONE );
	composite.setLayout( new GridLayout( ) );

	createURIRadioButtonsArea( composite );

	createClientSettingsArea( composite );
	
	createKerberosSettingsArea( composite );
	Point size = composite.computeSize( SWT.DEFAULT, SWT.DEFAULT );
	scrolledComposite.setMinWidth( size.x + 250 );
	scrolledComposite.setMinHeight( size.y + 20 );
	scrolledComposite.setContent( composite );
	return composite;

}
 
源代码7 项目: olca-app   文件: Trees.java
public static TreeViewer createViewer(
		Composite parent, String[] headers, IBaseLabelProvider label) {
	TreeViewer viewer = new TreeViewer(parent,
			SWT.BORDER | SWT.FULL_SELECTION | SWT.VIRTUAL | SWT.MULTI);
	Tree tree = viewer.getTree();
	boolean hasColumns = headers != null && headers.length > 0;
	tree.setLinesVisible(hasColumns);
	tree.setHeaderVisible(hasColumns);
	if (hasColumns) {
		createColumns(viewer, headers, label);
	}
	if (label != null) {
		viewer.setLabelProvider(label);
	}
	GridData data = UI.gridData(tree, true, true);
	data.minimumHeight = 120;
	Point p = parent.computeSize(SWT.DEFAULT, SWT.DEFAULT);
	data.heightHint = p.y < 120 ? 120 : p.y;
	return viewer;
}
 
源代码8 项目: bonita-studio   文件: DataWizardPage.java
@Override
public void handleValueChange(final ValueChangeEvent event) {
    final DataType newType = (DataType) event.diff.getNewValue();
    if (newType instanceof JavaType && !(data instanceof JavaObjectData)) {
        final JavaObjectData javaData = ProcessFactory.eINSTANCE.createJavaObjectData();
        javaData.setDataType(newType);
        javaData.setClassName(List.class.getName());
        copyDataFeature(javaData);
        data = javaData;
        updateDatabinding();
    } else if (newType instanceof XMLType && !(data instanceof XMLData)) {
        final XMLData xmlData = ProcessFactory.eINSTANCE.createXMLData();
        xmlData.setDataType(newType);
        copyDataFeature(xmlData);
        data = xmlData;
    } else {
        if (!data.eClass().equals(ProcessPackage.Literals.DATA)) {
            Data simpleData = ProcessFactory.eINSTANCE.createData();
            simpleData.setDataType(newType);
            copyDataFeature(simpleData);
            data = simpleData;
        } else {
            data.setDataType(newType);
        }
    }

    updateMoreSection(newType);
    updateBrowseXMLButton(newType);
    if (mainComposite != null && !mainComposite.isDisposed()) {
        final Composite parent = mainComposite.getParent();
        final Point defaultSize = parent.getSize();
        final Point size = parent.computeSize(SWT.DEFAULT, SWT.DEFAULT, true);
        parent.setSize(defaultSize.x, size.y);
        parent.layout(true, true);
    }
    updateDatabinding();
}
 
源代码9 项目: tracecompass   文件: HistogramView.java
public PackedScrolledComposite(Composite parent, int style) {
    super(parent, style);
    Composite composite = new Composite(parent, SWT.H_SCROLL | SWT.V_SCROLL);
    composite.setSize(1, 1);
    fScrollBarSize = composite.computeSize(0, 0);
    composite.dispose();
}
 
@Override
public void refresh() {
       final Composite shell = parent.getShell();
       final Point compositesize = parent.getSize();
       final Point newcompositesize = computeSize(SWT.DEFAULT, SWT.DEFAULT, true);
       final Point defaultSize = shell.getSize();
       final Point size = shell.computeSize(SWT.DEFAULT, SWT.DEFAULT, true);
       if (compositesize.x < newcompositesize.x) {
           shell.setSize(size.x, defaultSize.y);
       }
       shell.layout(true, true);

       if (parent.getParent() instanceof ScrolledComposite) {
           final ScrolledComposite scrolledComposite = (ScrolledComposite) parent.getParent();
           scrolledComposite.setMinSize(computeSize(SWT.DEFAULT, SWT.DEFAULT));
           Display.getDefault().asyncExec(new Runnable() {

               @Override
               public void run() {
                   scrolledComposite.getVerticalBar().setSelection(scrolledComposite.getVerticalBar().getMaximum());
               }
           });

       }
	if (tabbedPropertySheetPage != null) {
		tabbedPropertySheetPage.resizeScrolledComposite();
	}
}
 
/**
 * Creates page for mark occurrences preferences.
 *
 * @param parent the parent composite
 * @return the control for the preference page
 */
public Control createControl(Composite parent) {
	ScrolledPageContent scrolled= new ScrolledPageContent(parent, SWT.H_SCROLL | SWT.V_SCROLL);
	scrolled.setExpandHorizontal(true);
	scrolled.setExpandVertical(true);

	Composite control= new Composite(scrolled, SWT.NONE);
	GridLayout layout= new GridLayout();
	layout.marginWidth= 0;
	layout.marginHeight= 0;
	control.setLayout(layout);

	addSmartInsertModeMessage(control);

	Composite composite;

	composite= createSubsection(control, null, PreferencesMessages.SmartTypingConfigurationBlock_autoclose_title);
	addAutoclosingSection(composite);

	composite= createSubsection(control, null, PreferencesMessages.SmartTypingConfigurationBlock_automove_title);
	addAutopositionSection(composite);

	composite= createSubsection(control, null, PreferencesMessages.SmartTypingConfigurationBlock_indentation_title);
	addIndentationSection(composite);

	composite= createSubsection(control, null, PreferencesMessages.SmartTypingConfigurationBlock_pasting_title);
	addPasteSection(composite);

	composite= createSubsection(control, null, PreferencesMessages.SmartTypingConfigurationBlock_strings_title);
	addStringsSection(composite);

	scrolled.setContent(control);
	final Point size= control.computeSize(SWT.DEFAULT, SWT.DEFAULT);
	scrolled.setMinSize(size.x, size.y);
	return scrolled;
}
 
源代码12 项目: olca-app   文件: ModelCheckBoxTree.java
public void drawOn(Composite comp, FormToolkit tk) {
	tree = new CheckboxTreeViewer(comp,
			SWT.VIRTUAL | SWT.MULTI | SWT.BORDER);
	tree.setUseHashlookup(true);
	tree.setContentProvider(new NavigationContentProvider());
	tree.setLabelProvider(new NavigationLabelProvider(false));
	tree.setComparator(new NavigationComparator());
	tree.addFilter(new ModelTypeFilter(types));
	tree.addCheckStateListener(this);
	ColumnViewerToolTipSupport.enableFor(tree);
	if (tk != null) {
		tk.adapt(tree.getTree());
	}

	// compute a height hint
	GridData data = UI.gridData(tree.getTree(), true, true);
	data.minimumHeight = 120;
	Point p = comp.computeSize(SWT.DEFAULT, SWT.DEFAULT);
	data.heightHint = p.y < 120 ? 120 : p.y;

	if (types == null || types.length == 0)
		return;
	if (types.length == 1) {
		tree.setInput(Navigator.findElement(types[0]));
	} else {
		List<INavigationElement<?>> elems = Arrays.stream(types)
				.map(type -> Navigator.findElement(type))
				.filter(elem -> !elem.getChildren().isEmpty())
				.collect(Collectors.toList());
		tree.setInput(elems);
	}
	tree.expandToLevel(2);
}
 
/**
 * Create contents of the preference page.
 * @param parent
 */
@Override
public Control createContents(Composite parent) {
	Composite container = new Composite(parent, SWT.NULL);
	container.setLayout(new GridLayout(1, false));

	// source language control
	Group sourceLanguageGrp = new Group(container, SWT.NONE);
	sourceLanguageGrp.setLayout(new GridLayout(1, false));
	sourceLanguageGrp.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
	sourceLanguageGrp.setText(Messages.getString("projectsetting.ProjectSettingLanguagePage.sourceLanguageGrp"));

	srcLangComboViewer = new TableComboViewer(sourceLanguageGrp, SWT.READ_ONLY | SWT.BORDER);
	TableCombo tableCombo = srcLangComboViewer.getTableCombo();
	// set options.
	tableCombo.setShowTableLines(false);
	tableCombo.setShowTableHeader(false);
	tableCombo.setDisplayColumnIndex(-1);
	tableCombo.setShowImageWithinSelection(true);
	tableCombo.setShowColorWithinSelection(false);
	tableCombo.setShowFontWithinSelection(false);
	tableCombo.setVisibleItemCount(20);

	srcLangComboViewer.getTableCombo().setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
	srcLangComboViewer.setLabelProvider(new LanguageLabelProvider());
	srcLangComboViewer.setContentProvider(new ArrayContentProvider());
	srcLangComboViewer.setInput(languages);
	srcLangComboViewer.setComparer(elementComparer);
	initDataBindings();
	// end source language

	// target language control
	Group targetLanguageGrp = new Group(container, SWT.NONE);
	targetLanguageGrp.setLayout(new GridLayout(3, false));
	targetLanguageGrp.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, true, 1, 1));
	targetLanguageGrp.setText(Messages.getString("projectsetting.ProjectSettingLanguagePage.targetLanguageGrp"));
	targetLangControl.createControl(targetLanguageGrp);
	parent.computeSize(SWT.DEFAULT, SWT.DEFAULT);
	return container;
}
 
源代码14 项目: tmxeditor8   文件: ProjectSettingLanguagePage.java
/**
 * Create contents of the preference page.
 * @param parent
 */
@Override
public Control createContents(Composite parent) {
	Composite container = new Composite(parent, SWT.NULL);
	container.setLayout(new GridLayout(1, false));

	// source language control
	Group sourceLanguageGrp = new Group(container, SWT.NONE);
	sourceLanguageGrp.setLayout(new GridLayout(1, false));
	sourceLanguageGrp.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
	sourceLanguageGrp.setText(Messages.getString("projectsetting.ProjectSettingLanguagePage.sourceLanguageGrp"));

	srcLangComboViewer = new TableComboViewer(sourceLanguageGrp, SWT.READ_ONLY | SWT.BORDER);
	TableCombo tableCombo = srcLangComboViewer.getTableCombo();
	// set options.
	tableCombo.setShowTableLines(false);
	tableCombo.setShowTableHeader(false);
	tableCombo.setDisplayColumnIndex(-1);
	tableCombo.setShowImageWithinSelection(true);
	tableCombo.setShowColorWithinSelection(false);
	tableCombo.setShowFontWithinSelection(false);
	tableCombo.setVisibleItemCount(20);

	srcLangComboViewer.getTableCombo().setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
	srcLangComboViewer.setLabelProvider(new LanguageLabelProvider());
	srcLangComboViewer.setContentProvider(new ArrayContentProvider());
	srcLangComboViewer.setInput(languages);
	srcLangComboViewer.setComparer(elementComparer);
	initDataBindings();
	// end source language

	// target language control
	Group targetLanguageGrp = new Group(container, SWT.NONE);
	targetLanguageGrp.setLayout(new GridLayout(3, false));
	targetLanguageGrp.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, true, 1, 1));
	targetLanguageGrp.setText(Messages.getString("projectsetting.ProjectSettingLanguagePage.targetLanguageGrp"));
	targetLangControl.createControl(targetLanguageGrp);
	parent.computeSize(SWT.DEFAULT, SWT.DEFAULT);
	return container;
}
 
源代码15 项目: birt   文件: ParameterDialog.java
protected Control createDialogArea( Composite parent )
{
	setMessage( Messages.getString( "ParameterDialog.message" ) ); //$NON-NLS-1$
	ScrolledComposite scrollContent = new ScrolledComposite( (Composite) super.createDialogArea( parent ),
			SWT.H_SCROLL | SWT.V_SCROLL );
	scrollContent.setAlwaysShowScrollBars( false );
	scrollContent.setExpandHorizontal( true );
	scrollContent.setMinWidth( 600 );
	scrollContent.setLayout( new FillLayout( ) );
	scrollContent.setLayoutData( new GridData( GridData.FILL_BOTH ) );

	displayArea = new Composite( scrollContent, SWT.NONE );

	Composite topComposite = new Composite( displayArea, SWT.NONE );
	topComposite.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) );
	topComposite.setLayout( new GridLayout( 2, false ) );

	createPropertiesSection( topComposite );
	createDisplayOptionsSection( topComposite );
	createValuesDefineSection( displayArea );
	displayArea.setLayout( new GridLayout( ) );

	Point size = displayArea.computeSize( SWT.DEFAULT, SWT.DEFAULT );
	displayArea.setSize( size );

	scrollContent.setContent( displayArea );

	UIUtil.bindHelp( parent, IHelpContextIds.PARAMETER_DIALOG_ID );
	return scrollContent;
}
 
源代码16 项目: translationstudio8   文件: AddTermToTBDialog.java
@Override
protected Control createDialogArea(Composite parent) {
	Composite tparent = (Composite) super.createDialogArea(parent);
	GridLayoutFactory.swtDefaults().extendedMargins(5, 5, 10, 0).numColumns(2).equalWidth(true).applyTo(tparent);
	GridData parentData = new GridData(GridData.FILL_BOTH);
	tparent.setLayoutData(parentData);

	Composite cmpTerm = new Composite(tparent, SWT.NONE);
	GridLayoutFactory.fillDefaults().numColumns(2).equalWidth(false).applyTo(cmpTerm);
	GridDataFactory.swtDefaults().applyTo(cmpTerm);
	Label lblSource = new Label(cmpTerm, SWT.NONE);
	lblSource.setText(Messages.getString("dialog.AddTermToTBDialog.lblSource"));
	GridDataFactory.fillDefaults().align(SWT.RIGHT, SWT.CENTER).applyTo(lblSource);
	txtSrc = new Text(cmpTerm, SWT.BORDER);
	GridData txtData = new GridData();
	// 解决在 Windows 下文本框高度太小的问题
	txtData.widthHint = 290;
	txtSrc.setLayoutData(txtData);
	Label lblTarget = new Label(cmpTerm, SWT.NONE);
	lblTarget.setText(Messages.getString("dialog.AddTermToTBDialog.lblTarget"));
	GridDataFactory.fillDefaults().align(SWT.RIGHT, SWT.CENTER).applyTo(lblTarget);
	txtTgt = new Text(cmpTerm, SWT.BORDER);
	txtTgt.setLayoutData(txtData);

	Composite cmpLang = new Composite(tparent, SWT.NONE);
	GridLayoutFactory.fillDefaults().numColumns(2).equalWidth(false).applyTo(cmpLang);
	GridDataFactory.fillDefaults().applyTo(cmpLang);
	Label lblSrcLang = new Label(cmpLang, SWT.NONE);
	lblSrcLang.setText(Messages.getString("dialog.AddTermToTBDialog.lblSrcLang"));
	GridDataFactory.fillDefaults().align(SWT.RIGHT, SWT.CENTER).applyTo(lblSrcLang);
	cmbSrcLang = new TableComboViewer(cmpLang, SWT.READ_ONLY | SWT.BORDER);
	cmbSrcLang.getTableCombo().setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
	cmbSrcLang.setContentProvider(new ArrayContentProvider());

	Label lblTgtLang = new Label(cmpLang, SWT.NONE);
	lblTgtLang.setText(Messages.getString("dialog.AddTermToTBDialog.lblTgtLang"));
	GridDataFactory.fillDefaults().align(SWT.RIGHT, SWT.CENTER).applyTo(lblTgtLang);
	cmbTgtLang = new TableComboViewer(cmpLang, SWT.READ_ONLY | SWT.BORDER);
	cmbTgtLang.getTableCombo().setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
	cmbTgtLang.setContentProvider(new ArrayContentProvider());
	Composite cmpProperty = new Composite(tparent, SWT.None);
	GridLayoutFactory.fillDefaults().numColumns(2).equalWidth(false).applyTo(cmpProperty);
	GridDataFactory.fillDefaults().span(2, 1).applyTo(cmpProperty);
	Label lblProperty = new Label(cmpProperty, SWT.None);
	lblProperty.setText(Messages.getString("dialog.AddTermToTBDialog.lblProperty"));
	GridDataFactory.fillDefaults().align(SWT.RIGHT, SWT.CENTER).applyTo(lblProperty);
	txtProperty = new Text(cmpProperty, SWT.BORDER);
	txtProperty.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
	initProperty();
	tparent.computeSize(SWT.DEFAULT, SWT.DEFAULT);
	return tparent;
}
 
源代码17 项目: birt   文件: AbstractBindingDialogHelper.java
protected void setContentSize( Composite composite )
{
	Point size = composite.computeSize( SWT.DEFAULT, SWT.DEFAULT );
	composite.setSize( Math.max( size.x, 400 ), Math.max( size.y,
			isAggregate( ) ? 320 : 50 ) );
}
 
源代码18 项目: birt   文件: MongoDBDataSetWizardPage.java
public void createPageCustomControl( Composite parent )
{
	sComposite = new ScrolledComposite( parent, SWT.H_SCROLL | SWT.V_SCROLL );
	sComposite.setLayout( new GridLayout( ) );
	sComposite.setLayoutData( new GridData( GridData.FILL_BOTH ) );
	sComposite.setMinWidth( 600 );
	sComposite.setExpandHorizontal( true );

	Composite mainComposite = new Composite( sComposite, SWT.NONE );
	mainComposite.setLayout( new GridLayout( 1, false ) );
	GridData gridData = new GridData( GridData.FILL_BOTH );
	mainComposite.setLayoutData( gridData );

	createTopArea( mainComposite );

	createFieldsSelectionArea( mainComposite );

	createBottomArea( mainComposite );

	Point size = mainComposite.computeSize( SWT.DEFAULT, SWT.DEFAULT );
	mainComposite.setSize( size.x, size.y );

	sComposite.setContent( mainComposite );
	setControl( sComposite );
	setPageComplete( false );

	try
	{
		initPageInfos( );
	}
	catch ( final OdaException e )
	{
		initializeControl( );
		Display.getDefault( ).asyncExec( new Runnable( ) {

			public void run( )
			{
				String errorMsg = UIHelper.getUserErrorMessage( "MongoDBDataSetWizardPage.MessageDialog.ErrorMessage.InitPage", e ); //$NON-NLS-1$
				ExceptionHandler.showException( sComposite.getShell( ),
						Messages.getString( "MongoDBDataSetWizardPage.MessageDialog.title.GeneralError" ), //$NON-NLS-1$
						errorMsg,
						e );
			}
		} );

		return;
	}

	initializeControl( );

	resetLabelWidth( );

	modelChanged = false;

	UIHelper.setSystemHelp( getControl( ),
			IHelpConstants.CONTEXT_ID_WIZARD_DATASET_MONGODB );
}
 
源代码19 项目: birt   文件: GroupDialog.java
protected Control createDialogArea( Composite parent )
{
	// Assert.isNotNull( dataSetList );

	if ( sytleChoicesAll == null )
	{
		sytleChoicesAll = getAllStyleChoices( );
	}

	// Composite topComposite = (Composite) super.createDialogArea( parent
	// );

	ScrolledComposite scrollContent = new ScrolledComposite( (Composite) super.createDialogArea( parent ),
			SWT.H_SCROLL | SWT.V_SCROLL );
	scrollContent.setAlwaysShowScrollBars( false );
	scrollContent.setExpandHorizontal( true );
	scrollContent.setMinWidth( 600 );
	scrollContent.setLayout( new FillLayout( ) );
	scrollContent.setLayoutData( new GridData( GridData.FILL_BOTH ) );

	applyDialogFont( scrollContent );

	Composite topComposite = new Composite( scrollContent, SWT.NONE );
	GridLayout layout = new GridLayout( );
	layout.marginHeight = convertVerticalDLUsToPixels( IDialogConstants.VERTICAL_MARGIN );
	layout.marginWidth = convertHorizontalDLUsToPixels( IDialogConstants.HORIZONTAL_MARGIN );
	layout.verticalSpacing = convertVerticalDLUsToPixels( IDialogConstants.VERTICAL_SPACING );
	layout.horizontalSpacing = convertHorizontalDLUsToPixels( IDialogConstants.HORIZONTAL_SPACING );
	topComposite.setLayout( layout );

	createTitleArea( topComposite );

	Composite composite = new Composite( topComposite, SWT.NONE );
	composite.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) );
	composite.setLayout( new GridLayout( 2, true ) );
	createFieldArea( composite );
	createGroupArea( composite );
	createBookmarkArea( topComposite );
	createTOCArea( topComposite );
	createFilterSortingArea( topComposite );
	UIUtil.bindHelp( parent, IHelpContextIds.GROUP_DIALOG_ID );

	Point size = topComposite.computeSize( SWT.DEFAULT, SWT.DEFAULT );
	topComposite.setSize( size.x, size.y );

	scrollContent.setContent( topComposite );

	return scrollContent;
}
 
源代码20 项目: birt   文件: CascadingParametersDialog.java
protected Control createDialogArea( Composite parent )
{
	// Composite composite = (Composite) super.createDialogArea( parent );

	ScrolledComposite sc = new ScrolledComposite( (Composite) super.createDialogArea( parent ),
			SWT.H_SCROLL | SWT.V_SCROLL );
	sc.setLayout( new FillLayout( ) );
	sc.setLayoutData( new GridData( GridData.FILL_BOTH ) );
	applyDialogFont( sc );

	mainContent = new Composite( sc, SWT.NONE );
	GridLayout layout = new GridLayout( );
	layout.marginHeight = convertVerticalDLUsToPixels( IDialogConstants.VERTICAL_MARGIN );
	layout.marginWidth = convertHorizontalDLUsToPixels( IDialogConstants.HORIZONTAL_MARGIN );
	layout.verticalSpacing = convertVerticalDLUsToPixels( IDialogConstants.VERTICAL_SPACING );
	layout.horizontalSpacing = convertHorizontalDLUsToPixels( IDialogConstants.HORIZONTAL_SPACING );
	mainContent.setLayout( layout );

	UIUtil.bindHelp( parent, IHelpContextIds.CASCADING_PARAMETER_DIALOG_ID );

	GridData data = new GridData( GridData.FILL_BOTH );

	maxStrLengthProperty = getMaxStrLength( PROPERTY_LABEL_STRING,
			mainContent );

	maxStrLengthOption = getMaxStrLength( OPTION_LABEL_STRING, mainContent );

	mainContent.setLayoutData( data );

	createGeneralPart( mainContent );

	createChoicePart( mainContent );

	createDynamicParamsPart( mainContent );

	createPropertiesPart( mainContent );

	createSortingArea( mainContent );

	createOptionsPart( mainContent );

	createLabel( mainContent, null );
	errorMessageLine = new CLabel( mainContent, SWT.NONE );
	GridData msgLineGridData = new GridData( GridData.FILL_HORIZONTAL );
	msgLineGridData.horizontalSpan = 2;
	errorMessageLine.setLayoutData( msgLineGridData );

	sc.setContent( mainContent );
	sc.setExpandHorizontal( true );
	// sc.setExpandVertical( true );
	sc.setMinWidth( 500 );
	// sc.setMinHeight( 570 );

	Point size = mainContent.computeSize( SWT.DEFAULT, SWT.DEFAULT );
	mainContent.setSize( size );

	return sc;
}