Java Code Examples for org.eclipse.swt.layout.GridData#FILL_HORIZONTAL
The following examples show how to use
org.eclipse.swt.layout.GridData#FILL_HORIZONTAL .
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: ExtractClassWizard.java From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 | 6 votes |
private void createClassNameInput(Composite result) { Label label= new Label(result, SWT.LEAD); label.setText(RefactoringMessages.ExtractClassWizard_label_class_name); final Text text= new Text(result, SWT.SINGLE | SWT.BORDER); fClassNameDecoration= new ControlDecoration(text, SWT.TOP | SWT.LEAD); text.setText(fDescriptor.getClassName()); text.selectAll(); text.setFocus(); text.addModifyListener(new ModifyListener() { public void modifyText(ModifyEvent e) { fDescriptor.setClassName(text.getText()); validateRefactoring(); } }); GridData gridData= new GridData(GridData.FILL_HORIZONTAL); gridData.horizontalIndent= FieldDecorationRegistry.getDefault().getMaximumDecorationWidth(); text.setLayoutData(gridData); }
Example 2
Source File: FilteredTypesSelectionDialog.java From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 | 6 votes |
@Override protected Control createExtendedContentArea(Composite parent) { Control addition= null; if (fExtension != null) { addition= fExtension.createContentArea(parent); if (addition != null) { GridData gd= new GridData(GridData.FILL_HORIZONTAL); gd.horizontalSpan= 2; addition.setLayoutData(gd); } fExtension.initialize(this); } return addition; }
Example 3
Source File: ChannelPropertiesEditionPartImpl.java From eip-designer with Apache License 2.0 | 6 votes |
/** * @param parent the parent composite * */ protected Composite createToEndpointFlatComboViewer(Composite parent) { createDescription(parent, EipViewsRepository.Channel.Properties.toEndpoint, EipMessages.ChannelPropertiesEditionPart_ToEndpointLabel); toEndpoint = new EObjectFlatComboViewer(parent, !propertiesEditionComponent.isRequired(EipViewsRepository.Channel.Properties.toEndpoint, EipViewsRepository.SWT_KIND)); toEndpoint.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory)); toEndpoint.addSelectionChangedListener(new ISelectionChangedListener() { public void selectionChanged(SelectionChangedEvent event) { propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(ChannelPropertiesEditionPartImpl.this, EipViewsRepository.Channel.Properties.toEndpoint, PropertiesEditionEvent.CHANGE, PropertiesEditionEvent.SET, null, getToEndpoint())); } }); GridData toEndpointData = new GridData(GridData.FILL_HORIZONTAL); toEndpoint.setLayoutData(toEndpointData); toEndpoint.setID(EipViewsRepository.Channel.Properties.toEndpoint); SWTUtils.createHelpButton(parent, propertiesEditionComponent.getHelpContent(EipViewsRepository.Channel.Properties.toEndpoint, EipViewsRepository.SWT_KIND), null); //$NON-NLS-1$ // Start of user code for createToEndpointFlatComboViewer // End of user code return parent; }
Example 4
Source File: ConditionalRoutePropertiesEditionPartImpl.java From eip-designer with Apache License 2.0 | 6 votes |
/** * @param parent the parent composite * */ protected Composite createChannelFlatComboViewer(Composite parent) { createDescription(parent, EipViewsRepository.ConditionalRoute.Properties.channel, EipMessages.ConditionalRoutePropertiesEditionPart_ChannelLabel); channel = new EObjectFlatComboViewer(parent, !propertiesEditionComponent.isRequired(EipViewsRepository.ConditionalRoute.Properties.channel, EipViewsRepository.SWT_KIND)); channel.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory)); channel.addSelectionChangedListener(new ISelectionChangedListener() { public void selectionChanged(SelectionChangedEvent event) { propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(ConditionalRoutePropertiesEditionPartImpl.this, EipViewsRepository.ConditionalRoute.Properties.channel, PropertiesEditionEvent.CHANGE, PropertiesEditionEvent.SET, null, getChannel())); } }); GridData channelData = new GridData(GridData.FILL_HORIZONTAL); channel.setLayoutData(channelData); channel.setID(EipViewsRepository.ConditionalRoute.Properties.channel); SWTUtils.createHelpButton(parent, propertiesEditionComponent.getHelpContent(EipViewsRepository.ConditionalRoute.Properties.channel, EipViewsRepository.SWT_KIND), null); //$NON-NLS-1$ // Start of user code for createChannelFlatComboViewer // End of user code return parent; }
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: ResequencerPropertiesEditionPartForm.java From eip-designer with Apache License 2.0 | 5 votes |
/** * */ protected Composite createFromChannelsReferencesTable(FormToolkit widgetFactory, Composite parent) { this.fromChannels = new ReferencesTable(getDescription(EipViewsRepository.Resequencer.Properties.fromChannels, EipMessages.ResequencerPropertiesEditionPart_FromChannelsLabel), new ReferencesTableListener () { public void handleAdd() { addFromChannels(); } public void handleEdit(EObject element) { editFromChannels(element); } public void handleMove(EObject element, int oldIndex, int newIndex) { moveFromChannels(element, oldIndex, newIndex); } public void handleRemove(EObject element) { removeFromFromChannels(element); } public void navigateTo(EObject element) { } }); this.fromChannels.setHelpText(propertiesEditionComponent.getHelpContent(EipViewsRepository.Resequencer.Properties.fromChannels, EipViewsRepository.FORM_KIND)); this.fromChannels.createControls(parent, widgetFactory); this.fromChannels.addSelectionListener(new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { if (e.item != null && e.item.getData() instanceof EObject) { propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(ResequencerPropertiesEditionPartForm.this, EipViewsRepository.Resequencer.Properties.fromChannels, PropertiesEditionEvent.CHANGE, PropertiesEditionEvent.SELECTION_CHANGED, null, e.item.getData())); } } }); GridData fromChannelsData = new GridData(GridData.FILL_HORIZONTAL); fromChannelsData.horizontalSpan = 3; this.fromChannels.setLayoutData(fromChannelsData); this.fromChannels.disableMove(); fromChannels.setID(EipViewsRepository.Resequencer.Properties.fromChannels); fromChannels.setEEFType("eef::AdvancedReferencesTable"); //$NON-NLS-1$ // Start of user code for createFromChannelsReferencesTable // End of user code return parent; }
Example 7
Source File: TrimTraceDialog.java From tracecompass with Eclipse Public License 2.0 | 5 votes |
private void createNewTraceNameGroup(Composite parent) { setStatusLineAboveButtons(true); Font font = parent.getFont(); Composite folderGroup = new Composite(parent, SWT.NONE); GridLayout layout = new GridLayout(); layout.numColumns = 2; folderGroup.setLayout(layout); folderGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); String name = fElement.getName(); // New trace name label Label newTaceLabel = new Label(folderGroup, SWT.NONE); newTaceLabel.setFont(font); newTaceLabel.setText(Messages.RenameTraceDialog_TraceNewName); // New trace name entry field GridData data = new GridData(GridData.FILL_HORIZONTAL); data.widthHint = IDialogConstants.ENTRY_FIELD_WIDTH; Text newElementName = new Text(folderGroup, SWT.BORDER); newElementName.setLayoutData(data); newElementName.setFont(font); newElementName.setFocus(); newElementName.setText(name); newElementName.setSelection(0, name.length()); newElementName.addListener(SWT.Modify, event -> validateNewTraceName()); fNewElementName = newElementName; validateNewTraceName(); }
Example 8
Source File: MListEditor.java From e4macs with Eclipse Public License 1.0 | 5 votes |
/** * Helper method to create a push button. * * @param parent the parent control * @param key the resource name used to supply the button's label text * @return Button */ private Button createPushButton(Composite parent, String key) { Button button = new Button(parent, SWT.PUSH); String buttonText = JFaceResources.getString(key); button.setText(buttonText); button.setFont(parent.getFont()); GridData data = new GridData(GridData.FILL_HORIZONTAL); int widthHint = convertHorizontalDLUsToPixels(button, IDialogConstants.BUTTON_WIDTH); data.widthHint = Math.max(widthHint, button.computeSize(SWT.DEFAULT, SWT.DEFAULT, true).x); button.setLayoutData(data); button.addSelectionListener(getSelectionListener()); return button; }
Example 9
Source File: NeedleComposite.java From birt with Eclipse Public License 1.0 | 5 votes |
private void construct( Composite coParent, ChartWizardContext wizardContext, DialSeries series, NeedleAttributesContext needleAttributeContext ) { this.series = series; DialSeries defSeries = (DialSeries) ChartDefaultValueUtil.getDefaultSeries( series ); GridLayout gl = new GridLayout( 1, true ); gl.verticalSpacing = 0; gl.marginWidth = 10; gl.marginHeight = 0; setLayout( gl ); liacNeedle = new LineAttributesComposite( this, SWT.NONE, needleAttributeContext.lineOptionalStyles, wizardContext, series.getNeedle( ).getLineAttributes( ), defSeries.getNeedle( ).getLineAttributes( ) ); GridData gdLIACNeedle = new GridData( GridData.FILL_HORIZONTAL ); liacNeedle.setLayoutData( gdLIACNeedle ); liacNeedle.addListener( this ); if( needleAttributeContext.bEnableHeadStyle ) { cmbHeadStyle = new HeadStyleAttributeComposite( this, SWT.NONE, series.getNeedle( ).getDecorator( ), series.getNeedle( ), "decorator", //$NON-NLS-1$ wizardContext ); GridData gdCMBHeadStyle = new GridData( GridData.FILL_HORIZONTAL ); cmbHeadStyle.setLayoutData( gdCMBHeadStyle ); cmbHeadStyle.addListener( this ); } }
Example 10
Source File: ParameterDialog.java From birt with Eclipse Public License 1.0 | 5 votes |
private void createStartPointSection( Group displayOptionSection ) { IDialogHelperProvider helperProvider = (IDialogHelperProvider) ElementAdapterManager.getAdapter( this, IDialogHelperProvider.class ); if ( helperProvider != null ) { startPointTypeHelper = helperProvider.createHelper( this, HELPER_KEY_STARTPOINT ); } if ( startPointTypeHelper != null ) { startPointTypeHelper.createContent( displayOptionSection ); GridData data = new GridData( GridData.FILL_HORIZONTAL ); data.horizontalSpan = 2; startPointTypeHelper.getControl( ).setLayoutData( data ); startPointTypeHelper.addListener( SWT.Modify, new Listener( ) { public void handleEvent( Event event ) { startPointTypeHelper.update( false ); } } ); } }
Example 11
Source File: SSLEditor.java From http4e with Apache License 2.0 | 5 votes |
@Override protected Control createDialogArea( Composite parent){ getShell().setText("SSL Parameters"); final Composite returnvalue = (Composite) super.createDialogArea(parent); returnvalue.setLayout(new GridLayout(5, true)); new Label(returnvalue, SWT.NONE).setText("Keystore File Name:"); fileName = new Text(returnvalue, SWT.BORDER); GridData data = new GridData(GridData.FILL_HORIZONTAL); data.horizontalSpan = 4; fileName.setLayoutData(data); Button open = new Button(returnvalue, SWT.PUSH); open.setText("Open..."); open.addSelectionListener(new SelectionAdapter() { public void widgetSelected( SelectionEvent event){ FileDialog dlg = new FileDialog(returnvalue.getShell(), SWT.OPEN); dlg.setFilterNames(FILTER_NAMES); dlg.setFilterExtensions(FILTER_EXTS); String fn = dlg.open(); if (fn != null) { fileName.setText(fn); } } }); return returnvalue; }
Example 12
Source File: GroupSortingDialog.java From birt with Eclipse Public License 1.0 | 5 votes |
/** * Create composite of group area. * * @param cmpBasic */ protected void createGroupArea( Composite cmpBasic ) { Composite cmpGrouping = new Composite( cmpBasic, SWT.NONE ); GridData gdCMPGrouping = new GridData( GridData.FILL_HORIZONTAL ); gdCMPGrouping.horizontalSpan = 2; cmpGrouping.setLayoutData( gdCMPGrouping ); cmpGrouping.setLayout( new FillLayout( ) ); fGroupingComposite = createSeriesGroupingComposite( cmpGrouping ); }
Example 13
Source File: ServiceActivatorPropertiesEditionPartForm.java From eip-designer with Apache License 2.0 | 5 votes |
/** * */ protected Composite createFromChannelsReferencesTable(FormToolkit widgetFactory, Composite parent) { this.fromChannels = new ReferencesTable(getDescription(EipViewsRepository.ServiceActivator.Properties.fromChannels, EipMessages.ServiceActivatorPropertiesEditionPart_FromChannelsLabel), new ReferencesTableListener () { public void handleAdd() { addFromChannels(); } public void handleEdit(EObject element) { editFromChannels(element); } public void handleMove(EObject element, int oldIndex, int newIndex) { moveFromChannels(element, oldIndex, newIndex); } public void handleRemove(EObject element) { removeFromFromChannels(element); } public void navigateTo(EObject element) { } }); this.fromChannels.setHelpText(propertiesEditionComponent.getHelpContent(EipViewsRepository.ServiceActivator.Properties.fromChannels, EipViewsRepository.FORM_KIND)); this.fromChannels.createControls(parent, widgetFactory); this.fromChannels.addSelectionListener(new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { if (e.item != null && e.item.getData() instanceof EObject) { propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(ServiceActivatorPropertiesEditionPartForm.this, EipViewsRepository.ServiceActivator.Properties.fromChannels, PropertiesEditionEvent.CHANGE, PropertiesEditionEvent.SELECTION_CHANGED, null, e.item.getData())); } } }); GridData fromChannelsData = new GridData(GridData.FILL_HORIZONTAL); fromChannelsData.horizontalSpan = 3; this.fromChannels.setLayoutData(fromChannelsData); this.fromChannels.disableMove(); fromChannels.setID(EipViewsRepository.ServiceActivator.Properties.fromChannels); fromChannels.setEEFType("eef::AdvancedReferencesTable"); //$NON-NLS-1$ // Start of user code for createFromChannelsReferencesTable // End of user code return parent; }
Example 14
Source File: TLAFilteredItemsSelectionDialog.java From tlaplus with MIT License | 5 votes |
protected Control createExtendedContentArea(final Composite parent) { final Composite content = new Composite(parent, SWT.BORDER); final GridData layoutData = new GridData(GridData.FILL_HORIZONTAL); layoutData.heightHint = 200; content.setLayoutData(layoutData); final GridLayout layout = new GridLayout(); layout.numColumns = 1; layout.marginWidth = 0; layout.marginHeight = 0; content.setLayout(layout); sourceViewer = new SourceViewer(content, null, SWT.WRAP | SWT.V_SCROLL); sourceViewer.getTextWidget().setLayoutData(new GridData(GridData.FILL_BOTH)); sourceViewer.getTextWidget().setWordWrap(true); sourceViewer.getTextWidget().setEditable(false); sourceViewer.getTextWidget().setFont(TLCUIActivator.getDefault().getCourierFont()); // The weights can only be set *after* its nested controls (content // above) are added. Thus it's done here instead of createContentControl(..). final int top = getDialogSettings().get(SASH_RATIO_TOP) == null ? 75 : getDialogSettings().getInt(SASH_RATIO_TOP); final int bottom = getDialogSettings().get(SASH_RATIO_BOTTOM) == null ? 25 : getDialogSettings().getInt(SASH_RATIO_BOTTOM); sashForm.setWeights(new int[] { top, bottom }); return content; }
Example 15
Source File: AlreadyExistsDialog.java From APICloud-Studio with GNU General Public License v3.0 | 5 votes |
private Label createLabel(String text) { final GridData gd = new GridData(GridData.FILL_HORIZONTAL); gd.horizontalSpan = NUM_COLUMNS; gd.widthHint = convertWidthInCharsToPixels(60); final Label label = new Label(fComposite, SWT.WRAP); label.setText(text); label.setLayoutData(gd); return label; }
Example 16
Source File: SWTFactory.java From tlaplus with MIT License | 5 votes |
/** * Creates a vertical spacer for separating components. If applied to a * <code>GridLayout</code>, this method will automatically span all of the columns of the parent * to make vertical space * * @param parent the parent composite to add this spacer to * @param numlines the number of vertical lines to make as space */ public static void createVerticalSpacer(Composite parent, int numlines) { Label lbl = new Label(parent, SWT.NONE); GridData gd = new GridData(GridData.FILL_HORIZONTAL); Layout layout = parent.getLayout(); if(layout instanceof GridLayout) { gd.horizontalSpan = ((GridLayout)parent.getLayout()).numColumns; } gd.heightHint = numlines; lbl.setLayoutData(gd); }
Example 17
Source File: FillChooserComposite.java From birt with Eclipse Public License 1.0 | 5 votes |
/** * */ private void placeComponents( ) { // THE LAYOUT OF THIS COMPOSITE (FILLS EVERYTHING INSIDE IT) FillLayout flMain = new FillLayout( ); flMain.marginHeight = 0; flMain.marginWidth = 0; setLayout( flMain ); // THE LAYOUT OF THE OUTER COMPOSITE (THAT GROWS VERTICALLY BUT ANCHORS // ITS CONTENT NORTH) cmpContentOuter = new Composite( this, SWT.NONE ); GridLayout glContentOuter = new GridLayout( ); glContentOuter.verticalSpacing = 0; glContentOuter.horizontalSpacing = 0; glContentOuter.marginHeight = 0; glContentOuter.marginWidth = 0; glContentOuter.numColumns = 1; cmpContentOuter.setLayout( glContentOuter ); // THE LAYOUT OF THE INNER COMPOSITE (ANCHORED NORTH AND ENCAPSULATES // THE CANVAS + BUTTON) cmpContentInner = new Composite( cmpContentOuter, SWT.BORDER ); GridLayout glContentInner = new GridLayout( ); glContentInner.verticalSpacing = 0; glContentInner.horizontalSpacing = 0; glContentInner.marginHeight = 0; glContentInner.marginWidth = 0; glContentInner.numColumns = 2; cmpContentInner.setLayout( glContentInner ); GridData gdContentInner = new GridData( GridData.FILL_HORIZONTAL ); cmpContentInner.setLayoutData( gdContentInner ); // THE CANVAS cnvSelection = new FillCanvas( cmpContentInner, SWT.NONE, this.bAutoEnabled, wizardContext == null ? null : wizardContext.getImageServiceProvider( ) ); cnvSelection.setTextIndent( 8 ); GridData gdCNVSelection = new GridData( GridData.FILL_BOTH ); gdCNVSelection.heightHint = iSize; cnvSelection.setLayoutData( gdCNVSelection ); initFill( ); // THE BUTTON btnDown = new Button( cmpContentInner, SWT.ARROW | SWT.DOWN ); GridData gdBDown = new GridData( GridData.FILL ); gdBDown.verticalAlignment = GridData.BEGINNING; gdBDown.widthHint = iSize - 2; gdBDown.heightHint = iSize; btnDown.setLayoutData( gdBDown ); btnDown.addSelectionListener( this ); addDisposeListener( this ); Listener listener = new Listener( ) { public void handleEvent( Event event ) { handleEventCanvas( event ); } }; int[] textEvents = { SWT.KeyDown, SWT.MouseDown, SWT.Traverse, SWT.FocusIn, SWT.FocusOut }; for ( int i = 0; i < textEvents.length; i++ ) { cnvSelection.addListener( textEvents[i], listener ); } }
Example 18
Source File: InterativeConsoleCommandsPreferencesEditor.java From Pydev with Eclipse Public License 1.0 | 4 votes |
private GridData createComboGridData() { GridData data = new GridData(GridData.FILL_HORIZONTAL); data.grabExcessHorizontalSpace = true; return data; }
Example 19
Source File: EditTemplateDialog.java From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 | 4 votes |
private static GridData getButtonGridData() { GridData data= new GridData(GridData.FILL_HORIZONTAL); return data; }
Example 20
Source File: BaseSwtStringParameter.java From BiglyBT with GNU General Public License v2.0 | 4 votes |
public BaseSwtStringParameter(Composite composite, String paramID, String labelKey, String suffixKey, SwtParameterValueProcessor<PARAMTYPE, String> valueProcessor) { super(paramID); createStandardLabel(composite, labelKey); Composite parent; if (suffixKey == null) { parent = composite; } else { ourParent = parent = new Composite(composite, SWT.NONE); GridLayout gridLayout = new GridLayout(2, false); gridLayout.marginHeight = gridLayout.marginWidth = 0; parent.setLayout(gridLayout); if (doGridData(composite)) { parent.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); } } inputField = new Textbox(parent); setMainControl(inputField); if (doGridData(composite)) { GridData gridData = new GridData(GridData.FILL_HORIZONTAL); inputField.setLayoutData(gridData); } if (suffixKey != null) { lblSuffix = new Label(parent, SWT.WRAP); Messages.setLanguageText(lblSuffix, suffixKey); lblSuffix.setLayoutData( Utils.getWrappableLabelGridData(1, GridData.FILL_HORIZONTAL)); ClipboardCopy.addCopyToClipMenu(lblSuffix); } if (valueProcessor != null) { setValueProcessor(valueProcessor); } else if (paramID != null) { setConfigValueProcessor(String.class); } else { refreshControl(); } rebuildVerifyListener(); inputField.addListener(SWT.Modify, event -> { // setText and user input will call this -- don't put text changes here validate(inputField.getText()); }); inputField.addListener(SWT.FocusOut, e -> setValue(inputField.getText())); }