Java Code Examples for org.eclipse.swt.layout.GridData#FILL_VERTICAL
The following examples show how to use
org.eclipse.swt.layout.GridData#FILL_VERTICAL .
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: JavaTemplatePreferencePage.java From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 | 6 votes |
@Override protected SourceViewer createViewer(Composite parent) { IDocument document= new Document(); JavaTextTools tools= JavaPlugin.getDefault().getJavaTextTools(); tools.setupJavaDocumentPartitioner(document, IJavaPartitions.JAVA_PARTITIONING); IPreferenceStore store= JavaPlugin.getDefault().getCombinedPreferenceStore(); SourceViewer viewer= new JavaSourceViewer(parent, null, null, false, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL, store); SimpleJavaSourceViewerConfiguration configuration= new SimpleJavaSourceViewerConfiguration(tools.getColorManager(), store, null, IJavaPartitions.JAVA_PARTITIONING, false); viewer.configure(configuration); viewer.setEditable(false); viewer.setDocument(document); Font font= JFaceResources.getFont(PreferenceConstants.EDITOR_TEXT_FONT); viewer.getTextWidget().setFont(font); new JavaSourcePreviewerUpdater(viewer, configuration, store); Control control= viewer.getControl(); GridData data= new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.FILL_VERTICAL); control.setLayoutData(data); return viewer; }
Example 2
Source File: JarRefactoringDialog.java From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 | 5 votes |
/** * {@inheritDoc} */ @Override protected Control createDialogArea(final Composite parent) { final Composite container= (Composite) super.createDialogArea(parent); initializeDialogUnits(container); final Composite composite= new Composite(container, SWT.NULL); final GridLayout layout= new GridLayout(); layout.marginHeight= 0; layout.marginWidth= 0; composite.setLayout(layout); composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.FILL_VERTICAL)); final RefactoringHistoryControlConfiguration configuration= new RefactoringHistoryControlConfiguration(null, true, true) { @Override public final String getWorkspaceCaption() { return JarPackagerMessages.JarRefactoringDialog_workspace_caption; } }; fHistoryControl= (ISortableRefactoringHistoryControl) RefactoringUI.createSortableRefactoringHistoryControl(composite, configuration); fHistoryControl.createControl(); boolean sortProjects= true; final IDialogSettings settings= fSettings; if (settings != null) sortProjects= settings.getBoolean(SETTING_SORT); if (sortProjects) fHistoryControl.sortByProjects(); else fHistoryControl.sortByDate(); GridData data= new GridData(GridData.FILL_HORIZONTAL | GridData.FILL_VERTICAL); data.heightHint= convertHeightInCharsToPixels(32); data.widthHint= convertWidthInCharsToPixels(72); fHistoryControl.getControl().setLayoutData(data); fHistoryControl.setInput(fHistory); fHistoryControl.setCheckedDescriptors(fData.getRefactoringDescriptors()); createPlainLabel(composite, JarPackagerMessages.JarPackageWizardPage_options_label); createOptionsGroup(composite); Dialog.applyDialogFont(parent); return composite; }
Example 3
Source File: TmDbManagerDialog.java From translationstudio8 with GNU General Public License v2.0 | 5 votes |
/** * @param control * the <code>Control</code> to lay out. */ protected void layoutTreeAreaControl(Control control) { GridData gd = new GridData(GridData.FILL_VERTICAL); gd.widthHint = getLastRightWidth(); gd.verticalSpan = 1; control.setLayoutData(gd); }
Example 4
Source File: TmDbManagerDialog.java From translationstudio8 with GNU General Public License v2.0 | 5 votes |
/** * Create contents of the dialog. * @param parent */ @Override protected Control createDialogArea(Composite parent) { final Composite composite = (Composite) super.createDialogArea(parent); GridLayout parentLayout = ((GridLayout) composite.getLayout()); parentLayout.numColumns = 4; parentLayout.marginHeight = 0; parentLayout.marginWidth = 0; parentLayout.marginTop = 0; parentLayout.verticalSpacing = 0; parentLayout.horizontalSpacing = 0; Control treeControl = createTreeAreaContents(composite); createSash(composite, treeControl); Label versep = new Label(composite, SWT.SEPARATOR | SWT.VERTICAL); GridData verGd = new GridData(GridData.FILL_VERTICAL | GridData.GRAB_VERTICAL); versep.setLayoutData(verGd); versep.setLayoutData(new GridData(SWT.LEFT, SWT.FILL, false, true)); Composite pageAreaComposite = new Composite(composite, SWT.NONE); pageAreaComposite.setLayoutData(new GridData(GridData.FILL_BOTH)); GridLayout layout = new GridLayout(1, true); layout.marginHeight = 0; layout.marginWidth = 0; layout.verticalSpacing = 0; pageAreaComposite.setLayout(layout); // Build the Page container Composite pageContainer = createPageContainer(pageAreaComposite); GridData pageContainerData = new GridData(GridData.FILL_BOTH); pageContainerData.horizontalIndent = IDialogConstants.HORIZONTAL_MARGIN; pageContainer.setLayoutData(pageContainerData); // Build the separator line Label bottomSeparator = new Label(parent, SWT.HORIZONTAL | SWT.SEPARATOR); bottomSeparator.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.GRAB_HORIZONTAL)); return composite; }
Example 5
Source File: ElementNamesConfigurationBlock.java From birt with Eclipse Public License 1.0 | 5 votes |
private Composite createBuildPathTabContent( Composite parent ) { Composite pageContent = new Composite( parent, SWT.NONE ); GridData data = new GridData( GridData.FILL_HORIZONTAL | GridData.FILL_VERTICAL | GridData.VERTICAL_ALIGN_BEGINNING ); data.grabExcessHorizontalSpace = true; pageContent.setLayoutData( data ); GridLayout layout = new GridLayout( ); layout.marginHeight = 0; layout.marginWidth = 0; pageContent.setLayout( layout ); createTable( pageContent ); createTableViewer( ); tableViewer.setContentProvider( new ContentProvider( ) ); tableViewer.setLabelProvider( new ElementNameLabelProvider( ) ); // The input for the table viewer is the instance of ItemContentList itemContentList = new ItemContentList( this, getKeys( ) ); tableViewer.setInput( itemContentList ); sortTable(tableViewer.getTable().getColumn(0), true); return pageContent; }
Example 6
Source File: TmDbManagerDialog.java From tmxeditor8 with GNU General Public License v2.0 | 5 votes |
/** * Create contents of the dialog. * @param parent */ @Override protected Control createDialogArea(Composite parent) { final Composite composite = (Composite) super.createDialogArea(parent); GridLayout parentLayout = ((GridLayout) composite.getLayout()); parentLayout.numColumns = 4; parentLayout.marginHeight = 0; parentLayout.marginWidth = 0; parentLayout.marginTop = 0; parentLayout.verticalSpacing = 0; parentLayout.horizontalSpacing = 0; Control treeControl = createTreeAreaContents(composite); createSash(composite, treeControl); Label versep = new Label(composite, SWT.SEPARATOR | SWT.VERTICAL); GridData verGd = new GridData(GridData.FILL_VERTICAL | GridData.GRAB_VERTICAL); versep.setLayoutData(verGd); versep.setLayoutData(new GridData(SWT.LEFT, SWT.FILL, false, true)); Composite pageAreaComposite = new Composite(composite, SWT.NONE); pageAreaComposite.setLayoutData(new GridData(GridData.FILL_BOTH)); GridLayout layout = new GridLayout(1, true); layout.marginHeight = 0; layout.marginWidth = 0; layout.verticalSpacing = 0; pageAreaComposite.setLayout(layout); // Build the Page container Composite pageContainer = createPageContainer(pageAreaComposite); GridData pageContainerData = new GridData(GridData.FILL_BOTH); pageContainerData.horizontalIndent = IDialogConstants.HORIZONTAL_MARGIN; pageContainer.setLayoutData(pageContainerData); // Build the separator line Label bottomSeparator = new Label(parent, SWT.HORIZONTAL | SWT.SEPARATOR); bottomSeparator.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.GRAB_HORIZONTAL)); return composite; }
Example 7
Source File: TermDbManagerDialog.java From tmxeditor8 with GNU General Public License v2.0 | 5 votes |
/** * Create contents of the dialog. * @param parent */ @Override protected Control createDialogArea(Composite parent) { final Composite composite = (Composite) super.createDialogArea(parent); GridLayout parentLayout = ((GridLayout) composite.getLayout()); parentLayout.numColumns = 4; parentLayout.marginHeight = 0; parentLayout.marginWidth = 0; parentLayout.marginTop = 0; parentLayout.verticalSpacing = 0; parentLayout.horizontalSpacing = 0; Control treeControl = createTreeAreaContents(composite); createSash(composite, treeControl); Label versep = new Label(composite, SWT.SEPARATOR | SWT.VERTICAL); GridData verGd = new GridData(GridData.FILL_VERTICAL | GridData.GRAB_VERTICAL); versep.setLayoutData(verGd); versep.setLayoutData(new GridData(SWT.LEFT, SWT.FILL, false, true)); Composite pageAreaComposite = new Composite(composite, SWT.NONE); pageAreaComposite.setLayoutData(new GridData(GridData.FILL_BOTH)); GridLayout layout = new GridLayout(1, true); layout.marginHeight = 0; layout.marginWidth = 0; layout.verticalSpacing = 0; pageAreaComposite.setLayout(layout); // Build the Page container Composite pageContainer = createPageContainer(pageAreaComposite); GridData pageContainerData = new GridData(GridData.FILL_BOTH); pageContainerData.horizontalIndent = IDialogConstants.HORIZONTAL_MARGIN; pageContainer.setLayoutData(pageContainerData); // Build the separator line Label bottomSeparator = new Label(parent, SWT.HORIZONTAL | SWT.SEPARATOR); bottomSeparator.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.GRAB_HORIZONTAL)); return composite; }
Example 8
Source File: BulletListBlock.java From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 | 5 votes |
private Control createControl(Composite parent) { fStyledText= new StyledText(parent, SWT.FLAT | SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL); fStyledText.setEditable(false); Cursor arrowCursor= fStyledText.getDisplay().getSystemCursor(SWT.CURSOR_ARROW); fStyledText.setCursor(arrowCursor); // Don't set caret to 'null' as this causes https://bugs.eclipse.org/293263 // fStyledText.setCaret(null); final GridData data= new GridData(GridData.FILL_HORIZONTAL | GridData.FILL_VERTICAL); fStyledText.setLayoutData(data); configureStyledText(fText, fEnabled); return fStyledText; }
Example 9
Source File: ChartConfigurationBlock.java From birt with Eclipse Public License 1.0 | 5 votes |
protected Composite createBuildPathTabContent( Composite parent ) { Composite pageContent = new Composite( parent, SWT.NONE ); GridData data = new GridData( GridData.FILL_HORIZONTAL | GridData.FILL_VERTICAL | GridData.VERTICAL_ALIGN_BEGINNING ); data.grabExcessHorizontalSpace = true; pageContent.setLayoutData( data ); GridLayout layout = new GridLayout( ); layout.marginHeight = 0; layout.marginWidth = 0; layout.numColumns = 3; pageContent.setLayout( layout ); String[] enableDisableValues = new String[]{ ENABLED, DISABLED }; addCheckBox( pageContent, ENABLE_BUTTON, PREF_ENALBE_LIVE, enableDisableValues, 0 ); addTextField( pageContent, Messages.getString( "ChartPreferencePage.Label.MaxRowNumber" ), //$NON-NLS-1$ PREF_MAX_ROW, 0, 0 ); return pageContent; }
Example 10
Source File: TermDbManagerDialog.java From tmxeditor8 with GNU General Public License v2.0 | 5 votes |
/** * @param control * the <code>Control</code> to lay out. */ protected void layoutTreeAreaControl(Control control) { GridData gd = new GridData(GridData.FILL_VERTICAL); gd.widthHint = getLastRightWidth(); gd.verticalSpan = 1; control.setLayoutData(gd); }
Example 11
Source File: BidiPropertiesConfigurationBlock.java From birt with Eclipse Public License 1.0 | 5 votes |
private Composite createBuildPathTabContent( Composite parent ) { String[] bidiValues = new String[]{ TRUE, FALSE }; Composite pageContent = new Composite( parent, SWT.NONE ); GridData data = new GridData( GridData.FILL_HORIZONTAL | GridData.FILL_VERTICAL | GridData.VERTICAL_ALIGN_BEGINNING ); data.grabExcessHorizontalSpace = true; pageContent.setLayoutData( data ); GridLayout layout = new GridLayout( ); layout.marginHeight = 0; layout.marginWidth = 0; layout.numColumns = 3; pageContent.setLayout( layout ); addComboBox( pageContent, DEFAULT_DIRECTION, PREF_LTR_BIDI_DIRECTION, bidiValues, new String[]{ LTR_DIRECTION, RTL_DIRECTION }, 0 ); return pageContent; }
Example 12
Source File: TmDbManagerDialog.java From tmxeditor8 with GNU General Public License v2.0 | 5 votes |
/** * @param control * the <code>Control</code> to lay out. */ protected void layoutTreeAreaControl(Control control) { GridData gd = new GridData(GridData.FILL_VERTICAL); gd.widthHint = getLastRightWidth(); gd.verticalSpan = 1; control.setLayoutData(gd); }
Example 13
Source File: SWTHelper.java From elexis-3-core with Eclipse Public License 1.0 | 5 votes |
/** * Ein GridData-Objekt erzeugen, das den horizontalen und/oder vertikalen Freiraum ausfüllt. * * @param horizontal * true, wenn horizontal gefüllt werden soll * @param vertical * true, wenn vertikal gefüllt werden soll. * @return ein neu erzeugtes, direkt verwendbares GridData-Objekt */ public static GridData getFillGridData(final int hSpan, final boolean hFill, final int vSpan, final boolean vFill){ int ld = 0; if (hFill) { ld = GridData.FILL_HORIZONTAL | GridData.GRAB_HORIZONTAL; } if (vFill) { ld |= GridData.FILL_VERTICAL | GridData.GRAB_VERTICAL; } GridData ret = new GridData(ld); ret.horizontalSpan = (hSpan < 1) ? 1 : hSpan; ret.verticalSpan = vSpan < 1 ? 1 : vSpan; return ret; }
Example 14
Source File: FormatterConfigurationBlock.java From xtext-xtend with Eclipse Public License 2.0 | 5 votes |
@Override protected void configurePreview(Composite composite, int numColumns, ProfileManager profileManager) { createLabel(composite, Messages.FormatterConfigurationBlock_XtendCodePreview, numColumns); XtendFormatterPreview xtendPreview = previewFactory.createNewPreview(composite, PreviewCode.defaultPreviewText()); final GridData gd = new GridData(GridData.FILL_VERTICAL | GridData.HORIZONTAL_ALIGN_FILL); gd.horizontalSpan = numColumns; gd.verticalSpan = 7; gd.widthHint = 0; gd.heightHint = 0; xtendPreview.getEditorViewer().getControl().setLayoutData(gd); profileManager.addObserver(xtendPreview.getObserver()); xtendPreview.doUpdate(profileManager.getSelected().getSettings()); }
Example 15
Source File: TabPageNewLines.java From xds-ide with Eclipse Public License 1.0 | 5 votes |
private void configurePreview(Composite composite, int numColumns) { SWTFactory.createLabel(composite, Messages.IndentationTabPage_Preview+':', numColumns); fPreview = new FormatterPreview(composite, "newlines_preview.mod", XdsSourceType.Modula); //$NON-NLS-1$ final GridData gd = new GridData(GridData.FILL_VERTICAL | GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL); gd.horizontalSpan = numColumns; gd.widthHint = 0; gd.heightHint = 0; fPreview.getTextWidget().setLayoutData(gd); fPreview.setProfile(fp); }
Example 16
Source File: TabPageWhiteSpace.java From xds-ide with Eclipse Public License 1.0 | 5 votes |
private void configurePreview(Composite composite, int numColumns) { SWTFactory.createLabel(composite, Messages.IndentationTabPage_Preview+':', numColumns); fPreview = new FormatterPreview(composite, "indent_preview.mod", XdsSourceType.Modula); //$NON-NLS-1$ final GridData gd = new GridData(GridData.FILL_VERTICAL | GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL); gd.horizontalSpan = numColumns; gd.widthHint = 0; gd.heightHint = 0; fPreview.getTextWidget().setLayoutData(gd); fPreview.setProfile(fp); }
Example 17
Source File: FormatterPreferencePage.java From xds-ide with Eclipse Public License 1.0 | 5 votes |
private void configurePreview(Composite composite, int numColumns, ProfileManager profileManager) { SWTFactory.createLabel(composite, Messages.FormatterPreferencePage_Preview+':', numColumns); fPreview = new FormatterPreview(composite, "indent_preview.mod", XdsSourceType.Modula); //$NON-NLS-1$ final GridData gd = new GridData(GridData.FILL_VERTICAL | GridData.HORIZONTAL_ALIGN_FILL); gd.horizontalSpan = numColumns; gd.verticalSpan= 7; gd.widthHint = 0; gd.heightHint = 0; fPreview.getTextWidget().setLayoutData(gd); }
Example 18
Source File: TabLineWrapping.java From xds-ide with Eclipse Public License 1.0 | 5 votes |
private void configurePreview(Composite composite, int numColumns) { SWTFactory.createLabel(composite, Messages.IndentationTabPage_Preview+':', numColumns); fPreview = new FormatterPreview(composite, "indent_preview.mod", XdsSourceType.Modula); //$NON-NLS-1$ final GridData gd = new GridData(GridData.FILL_VERTICAL | GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL); gd.horizontalSpan = numColumns; gd.widthHint = 0; gd.heightHint = 0; fPreview.getTextWidget().setLayoutData(gd); fPreview.turnOnMarginPainter(); fPreview.setProfile(fp); }
Example 19
Source File: CaptureDialog.java From logbook with MIT License | 4 votes |
/** * Create contents of the dialog. */ private void createContents() { // シェル this.shell = new Shell(this.getParent(), this.getStyle()); this.shell.setText(this.getText()); // レイアウト GridLayout glShell = new GridLayout(1, false); glShell.horizontalSpacing = 1; glShell.marginHeight = 1; glShell.marginWidth = 1; glShell.verticalSpacing = 1; this.shell.setLayout(glShell); // 太字にするためのフォントデータを作成する FontData defaultfd = this.shell.getFont().getFontData()[0]; FontData fd = new FontData(defaultfd.getName(), defaultfd.getHeight(), SWT.BOLD); this.font = new Font(Display.getDefault(), fd); // コンポジット Composite rangeComposite = new Composite(this.shell, SWT.NONE); rangeComposite.setLayout(new GridLayout(2, false)); // 範囲設定 this.text = new Text(rangeComposite, SWT.BORDER | SWT.READ_ONLY); GridData gdText = new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1); gdText.widthHint = 120; this.text.setLayoutData(gdText); this.text.setText("範囲が未設定です"); Button button = new Button(rangeComposite, SWT.NONE); button.setText("範囲を選択"); button.addSelectionListener(new SelectRectangleAdapter()); // コンポジット this.composite = new Composite(this.shell, SWT.NONE); GridLayout loglayout = new GridLayout(3, false); this.composite.setLayout(loglayout); this.composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.FILL_VERTICAL)); // 周期設定 this.interval = new Button(this.composite, SWT.CHECK); this.interval.addSelectionListener((SelectedListener) e -> { this.capture.setText(getCaptureButtonText(false, this.interval.getSelection())); }); this.interval.setText("周期"); this.intervalms = new Spinner(this.composite, SWT.BORDER); this.intervalms.setMaximum(60000); this.intervalms.setMinimum(100); this.intervalms.setSelection(1000); this.intervalms.setIncrement(100); Label label = new Label(this.composite, SWT.NONE); label.setText("ミリ秒"); this.capture = new Button(this.shell, SWT.NONE); this.capture.setFont(this.font); GridData gdCapture = new GridData(GridData.FILL_HORIZONTAL | GridData.FILL_VERTICAL); gdCapture.horizontalSpan = 3; gdCapture.heightHint = 64; this.capture.setLayoutData(gdCapture); this.capture.setEnabled(false); this.capture.setText(getCaptureButtonText(false, this.interval.getSelection())); this.capture.addSelectionListener(new CaptureStartAdapter()); this.shell.pack(); }
Example 20
Source File: ExpressionBuilderConfigurationBlock.java From birt with Eclipse Public License 1.0 | 4 votes |
private Composite createBuildPathTabContent( Composite parent ) { IExpressionSupport[] supports = ExpressionSupportManager.getExpressionSupports( ); String[] supportDisplayNames = new String[supports.length]; String[] supportNames = new String[supports.length]; for ( int i = 0; i < supports.length; i++ ) { supportDisplayNames[i] = supports[i].getDisplayName( ); supportNames[i] = supports[i].getName( ); } Composite pageContent = new Composite( parent, SWT.NONE ); GridData data = new GridData( GridData.FILL_HORIZONTAL | GridData.FILL_VERTICAL | GridData.VERTICAL_ALIGN_BEGINNING ); data.grabExcessHorizontalSpace = true; pageContent.setLayoutData( data ); GridLayout layout = new GridLayout( ); layout.marginHeight = 0; layout.marginWidth = 0; layout.numColumns = 3; pageContent.setLayout( layout ); addComboBox( pageContent, DEFAULT_UNIT, PREF_DEFAULT_UNIT, supportNames, supportDisplayNames, 0 ); new Label( pageContent, SWT.NONE ); this.addLabelledTextField( pageContent, DEFAULT_FISCAL_START, PREF_FISCAL_START, 10, 0, false ); return pageContent; }