Java Code Examples for org.eclipse.swt.layout.GridData#VERTICAL_ALIGN_FILL

The following examples show how to use org.eclipse.swt.layout.GridData#VERTICAL_ALIGN_FILL . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TaskSelectType.java    From birt with Eclipse Public License 1.0 6 votes vote down vote up
/**
 * This method initializes cmpSubTypes
 * 
 */
protected void createComposite( Vector<IChartSubType> vSubTypes )
{
	Label lblSubtypes = new Label( cmpRight, SWT.NO_FOCUS );
	{
		lblSubtypes.setText( Messages.getString( "TaskSelectType.Label.SelectSubtype" ) ); //$NON-NLS-1$
		GridData gd = new GridData( GridData.FILL_HORIZONTAL );
		gd.horizontalIndent = 5;
		lblSubtypes.setLayoutData( gd );
	}

	GridData gdTypes = new GridData( GridData.FILL_HORIZONTAL
			| GridData.VERTICAL_ALIGN_FILL );
	cmpSubTypes = new Composite( cmpRight, SWT.NONE );
	createSubtypeBtnGroups( vSubTypes );
	cmpSubTypes.setLayoutData( gdTypes );
	cmpSubTypes.setToolTipText( Messages.getString( "TaskSelectType.Label.ChartSubtypes" ) ); //$NON-NLS-1$
	cmpSubTypes.setLayout( new GridLayout( ) );
	cmpSubTypes.setVisible( true );
}
 
Example 2
Source File: ExceptionDialog.java    From birt with Eclipse Public License 1.0 6 votes vote down vote up
protected Text createTextArea(Composite parent) {
	_textArea = new Text(parent, SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL
			| SWT.MULTI);

	StringWriter sw = new StringWriter();
	PrintWriter pw = new PrintWriter(sw);
	_exception.printStackTrace(pw);

	_textArea.setText(sw.toString());

	GridData data = new GridData(GridData.HORIZONTAL_ALIGN_FILL
			| GridData.GRAB_HORIZONTAL | GridData.VERTICAL_ALIGN_FILL
			| GridData.GRAB_VERTICAL);
	data.heightHint = 200;
	data.horizontalSpan = 2;
	_textArea.setLayoutData(data);
	_textArea.setFont(parent.getFont());
	_textArea.setEditable(false);
	_textCreated = true;
	return _textArea;
}
 
Example 3
Source File: ExceptionDialog.java    From birt with Eclipse Public License 1.0 6 votes vote down vote up
protected Text createTextArea( Composite parent )
{
	_textArea = new Text( parent, SWT.BORDER
			| SWT.H_SCROLL | SWT.V_SCROLL | SWT.MULTI );

	StringWriter sw = new StringWriter( );
	PrintWriter pw = new PrintWriter( sw );
	_exception.printStackTrace( pw );

	_textArea.setText( sw.toString( ) );

	GridData data = new GridData( GridData.HORIZONTAL_ALIGN_FILL
			| GridData.GRAB_HORIZONTAL | GridData.VERTICAL_ALIGN_FILL
			| GridData.GRAB_VERTICAL );
	data.heightHint = 200;
	data.horizontalSpan = 2;
	_textArea.setLayoutData( data );
	_textArea.setFont( parent.getFont( ) );
	_textArea.setEditable( false );
	_textCreated = true;
	return _textArea;
}
 
Example 4
Source File: DerbyPropertiesPage.java    From gemfirexd-oss with Apache License 2.0 5 votes vote down vote up
protected GridData getSeperatorLabelGridData() {

    GridData gridData = new GridData(GridData.BEGINNING |
                            GridData.HORIZONTAL_ALIGN_FILL |
                            GridData.GRAB_VERTICAL |
                            GridData.BEGINNING |
                            GridData.VERTICAL_ALIGN_BEGINNING |
                            GridData.VERTICAL_ALIGN_FILL) ;
    gridData.horizontalSpan = 2;
    gridData.grabExcessVerticalSpace  = false;
    gridData.grabExcessHorizontalSpace = true;
    return gridData;

}
 
Example 5
Source File: SDView.java    From tracecompass with Eclipse Public License 2.0 5 votes vote down vote up
@Override
public void createPartControl(Composite c) {
    Composite parent = new Composite(c, SWT.NONE);
    GridLayout parentLayout = new GridLayout();
    parentLayout.numColumns = 2;
    parentLayout.marginWidth = 0;
    parentLayout.marginHeight = 0;
    parent.setLayout(parentLayout);

    GridData timeLayoutdata = new GridData(GridData.GRAB_VERTICAL | GridData.VERTICAL_ALIGN_FILL);
    timeLayoutdata.widthHint = 10;
    GridData seqDiagLayoutData = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL | GridData.GRAB_VERTICAL | GridData.VERTICAL_ALIGN_FILL);
    fTimeCompressionBar = new TimeCompressionBar(parent, SWT.NONE);
    fTimeCompressionBar.setLayoutData(timeLayoutdata);
    fSdWidget = new SDWidget(parent, SWT.NONE);
    fSdWidget.setLayoutData(seqDiagLayoutData);
    fSdWidget.setSite(this);
    fSdWidget.setTimeBar(fTimeCompressionBar);

    // Add this view to the key bindings manager
    KeyBindingsManager.getInstance().add(this.getSite().getId());

    createCoolbarContent();

    hookContextMenu();

    fTimeCompressionBar.setVisible(false);
    parent.layout(true);

    fPrintActionHandler = new ActionHandler(new Print(this));
    getSite().getPage().addPartListener(this);

    fNeedInit = restoreLoader();
}
 
Example 6
Source File: DerbyPropertiesPage.java    From gemfirexd-oss with Apache License 2.0 5 votes vote down vote up
protected GridData getSeperatorLabelGridData() {

    GridData gridData = new GridData(GridData.BEGINNING |
                            GridData.HORIZONTAL_ALIGN_FILL |
                            GridData.GRAB_VERTICAL |
                            GridData.BEGINNING |
                            GridData.VERTICAL_ALIGN_BEGINNING |
                            GridData.VERTICAL_ALIGN_FILL) ;
    gridData.horizontalSpan = 2;
    gridData.grabExcessVerticalSpace  = false;
    gridData.grabExcessHorizontalSpace = true;
    return gridData;

}
 
Example 7
Source File: IgnoreResourcesDialog.java    From APICloud-Studio with GNU General Public License v3.0 5 votes vote down vote up
private Label createIndentedLabel(Composite parent, String text, int indent) {
	Label label = new Label(parent, SWT.LEFT);
	label.setText(text);
	GridData data = new GridData(GridData.VERTICAL_ALIGN_FILL | GridData.FILL_HORIZONTAL);
	data.horizontalIndent = indent;
	label.setLayoutData(data);
	return label;
}
 
Example 8
Source File: CustomDataSetWizardPage.java    From birt with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * Creates custom control for user-defined query text.
 */
private Control createPageControl( Composite parent )
{
    Composite composite = new Composite( parent, SWT.NONE );
    composite.setLayout( new GridLayout( 1, false ) );
    GridData gridData = new GridData( GridData.HORIZONTAL_ALIGN_FILL
            | GridData.VERTICAL_ALIGN_FILL );

    composite.setLayoutData( gridData );

    Label fieldLabel = new Label( composite, SWT.NONE );
    fieldLabel.setText( "&Query Text:" );

    m_queryTextField = new Text( composite, SWT.BORDER
            | SWT.V_SCROLL | SWT.H_SCROLL );
    GridData data = new GridData( GridData.FILL_HORIZONTAL );
    data.heightHint = 100;
    m_queryTextField.setLayoutData( data );
    m_queryTextField.addModifyListener( new ModifyListener( )
    {
        public void modifyText( ModifyEvent e )
        {
            validateData();
        }
    } );

    setPageComplete( false );
    return composite;
}
 
Example 9
Source File: DoubleBufferedLabel.java    From BiglyBT with GNU General Public License v2.0 4 votes vote down vote up
public DoubleBufferedLabel(
	Composite 	parent,
	int 		style )
{
	super( parent, style | SWT.DOUBLE_BUFFERED );

	this.style = style;
			
		// only support GridLayout I'm afraid...

	GridData gridData = new GridData(GridData.HORIZONTAL_ALIGN_CENTER | GridData.VERTICAL_ALIGN_FILL);

	setLayoutData(gridData);

	addPaintListener(this);
}
 
Example 10
Source File: MinMaxDialog.java    From tracecompass with Eclipse Public License 2.0 4 votes vote down vote up
/**
 * Method to create a grid data base on horizontal span.
 * @param span The horizontal span
 * @return a grid data object
 */
protected GridData newGridData(int span) {
    GridData data = new GridData(GridData.GRAB_VERTICAL | GridData.VERTICAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL);
    data.horizontalSpan = span;
    return data;
}
 
Example 11
Source File: SDViewerPage.java    From tracecompass with Eclipse Public License 2.0 4 votes vote down vote up
@Override
protected Control createContents(Composite parent) {
    GridLayout gl = new GridLayout();
    gl.marginHeight = 0;
    gl.marginWidth = 0;
    parent.setLayout(gl);
    Composite page = new Composite(parent, SWT.NONE);
    GridLayout pageLayout = new GridLayout();
    pageLayout.numColumns = 2;
    GridData pageLayoutdata = new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_VERTICAL | GridData.VERTICAL_ALIGN_FILL);
    page.setLayoutData(pageLayoutdata);
    page.setLayout(pageLayout);

    fTooltip = new BooleanFieldEditor(ISDPreferences.PREF_TOOLTIP, Messages.SequenceDiagram_ShowTooltips, page);
    fTooltip.setPreferenceStore(fPreferences.getPreferenceStore());
    fTooltip.load();

    // link font with zoom pref
    fLink = new BooleanFieldEditor(ISDPreferences.PREF_LINK_FONT, Messages.SequenceDiagram_IncreaseFontSizeWhenZooming, page);
    fLink.setPreferenceStore(fPreferences.getPreferenceStore());
    fLink.load();

    fNoExternalTime = new BooleanFieldEditor(ISDPreferences.PREF_EXCLUDE_EXTERNAL_TIME, Messages.SequenceDiagram_ExcludeExternalTime, page);
    fNoExternalTime.setPreferenceStore(fPreferences.getPreferenceStore());
    fNoExternalTime.load();

    // use gradient color pref
    fUseGrad = new BooleanFieldEditor(ISDPreferences.PREF_USE_GRADIENT, Messages.SequenceDiagram_UseGradientColor, page);
    fUseGrad.setPreferenceStore(fPreferences.getPreferenceStore());
    fUseGrad.load();

    Label separator = new Label(page, SWT.SEPARATOR | SWT.HORIZONTAL | SWT.SHADOW_NONE);
    GridData sepData = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL | GridData.VERTICAL_ALIGN_FILL);
    separator.setLayoutData(sepData);

    Composite prefPage = new Composite(page, SWT.NONE);
    GridLayout prefPageLayout = new GridLayout();
    prefPage.setLayoutData(pageLayoutdata);
    prefPageLayout.numColumns = 1;
    prefPage.setLayout(prefPageLayout);

    // swimLane width pref
    fLifelineWidth = new IntegerFieldEditor(ISDPreferences.PREF_LIFELINE_WIDTH, Messages.SequenceDiagram_LifelineWidth, prefPage);
    fLifelineWidth.setPreferenceStore(fPreferences.getPreferenceStore());
    fLifelineWidth.setValidRange(119, 500);
    fLifelineWidth.load();

    // not very nice
    new Label(prefPage, SWT.SEPARATOR | SWT.HORIZONTAL | SWT.SHADOW_NONE);
    new Label(prefPage, SWT.SEPARATOR | SWT.HORIZONTAL | SWT.SHADOW_NONE);

    // Font list pref
    fClassItemList = new List(prefPage, SWT.SINGLE | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
    GridData tabItemLayoutdata = new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_VERTICAL | GridData.VERTICAL_ALIGN_FILL);
    fClassItemList.setLayoutData(tabItemLayoutdata);

    String[] fontList2 = SDViewPref.getFontList2();
    for (int i = 0; i < fontList2.length; i++) {
        fClassItemList.add(fontList2[i]);
    }
    fClassItemList.setSelection(0);
    fClassItemList.addSelectionListener(this);
    fButtonArea = new Composite(prefPage, SWT.NONE);
    GridData tabItemLayoutdata2 = new GridData(GridData.HORIZONTAL_ALIGN_FILL/* |GridData.GRAB_HORIZONTAL */| GridData.GRAB_VERTICAL | GridData.VERTICAL_ALIGN_FILL);
    fButtonArea.setLayoutData(tabItemLayoutdata2);
    GridLayout buttonAreaLayout = new GridLayout();
    buttonAreaLayout.numColumns = 1;
    fButtonArea.setLayout(buttonAreaLayout);

    // font selector initialise for the lifeline font pref
    String[] fontList = SDViewPref.getFontList();
    fFont = new FontFieldEditor(fontList[0], "",//$NON-NLS-1$
            Messages.SequenceDiagram_AaBbYyZz, fButtonArea);
    fFont.getPreviewControl().setSize(500, 500);
    fFont.setPreferenceStore(fPreferences.getPreferenceStore());
    fFont.load();

    fBackGroundColor = new ColorFieldEditor(fontList[0] + SDViewPref.BACK_COLOR_POSTFIX, Messages.SequenceDiagram_Background, fButtonArea);
    fBackGroundColor.setPreferenceStore(fPreferences.getPreferenceStore());
    fBackGroundColor.load();

    fLineColor = new ColorFieldEditor(fontList[0] + SDViewPref.FORE_COLOR_POSTFIX, Messages.SequenceDiagram_Lines, fButtonArea);
    fLineColor.setPreferenceStore(fPreferences.getPreferenceStore());
    fLineColor.load();

    fTextColor = new ColorFieldEditor(fontList[0] + SDViewPref.TEXT_COLOR_POSTFIX, Messages.SequenceDiagram_Text, fButtonArea);
    fTextColor.setPreferenceStore(fPreferences.getPreferenceStore());
    fTextColor.load();
    swapPref(true);
    Dialog.applyDialogFont(page);

    return page;
}
 
Example 12
Source File: SDPrintDialogUI.java    From tracecompass with Eclipse Public License 2.0 2 votes vote down vote up
/**
 * Creates new grid data object.
 *
 * @param span
 *            horizontal span.
 * @return grid data
 */
protected GridData newGridData(int span) {
    GridData data = new GridData(GridData.GRAB_VERTICAL | GridData.VERTICAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL);
    data.horizontalSpan = span;
    return data;
}