Java Code Examples for org.eclipse.swt.SWT#LEFT
The following examples show how to use
org.eclipse.swt.SWT#LEFT .
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: Database.java From scava with Eclipse Public License 2.0 | 7 votes |
@Override protected Control createContents(Composite parent) { Composite top = new Composite(parent, SWT.LEFT); top.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); GridLayout gl_top = new GridLayout(); gl_top.numColumns = 2; top.setLayout(gl_top); Label lblNewLabel = new Label(top, SWT.NONE); lblNewLabel.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1)); lblNewLabel.setText("Erase database entries"); Button btnNewButton = new Button(top, SWT.NONE); btnNewButton.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { } }); btnNewButton.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1)); btnNewButton.setText("Erase"); return top; }
Example 2
Source File: ComponentTitledSeparator.java From arx with Apache License 2.0 | 6 votes |
/** * Create the content */ private void createContent() { switch (this.alignment) { case SWT.CENTER: createSeparator(); createTitle(); createSeparator(); break; case SWT.LEFT: createTitle(); createSeparator(); break; default: createSeparator(); createTitle(); break; } }
Example 3
Source File: OptionsConfigurationBlock.java From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 | 6 votes |
protected Combo addInversedComboBox(Composite parent, String label, Key key, String[] values, String[] valueLabels, int indent) { GridData gd= new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING); gd.horizontalIndent= indent; gd.horizontalSpan= 3; Composite composite= new Composite(parent, SWT.NONE); GridLayout layout= new GridLayout(); layout.marginHeight= 0; layout.marginWidth= 0; layout.numColumns= 2; composite.setLayout(layout); composite.setLayoutData(gd); Combo comboBox= newComboControl(composite, key, values, valueLabels); comboBox.setFont(JFaceResources.getDialogFont()); comboBox.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL)); Label labelControl= new Label(composite, SWT.LEFT | SWT.WRAP); labelControl.setText(label); labelControl.setLayoutData(new GridData()); fLabels.put(comboBox, labelControl); return comboBox; }
Example 4
Source File: AbstractPaintManager.java From nebula with Eclipse Public License 2.0 | 5 votes |
public void drawArrowHead(final int x, final int y, final int face, final GC gc) { switch (face) { case SWT.UP: gc.drawLine(x, y + 3, x, y + 3); gc.drawLine(x - 1, y + 4, x + 1, y + 4); gc.drawLine(x - 2, y + 5, x + 2, y + 5); gc.drawLine(x - 3, y + 6, x + 3, y + 6); gc.drawLine(x - 4, y + 7, x + 4, y + 7); break; case SWT.DOWN: gc.drawLine(x, y + 7, x, y + 7); gc.drawLine(x - 1, y + 6, x + 1, y + 6); gc.drawLine(x - 2, y + 5, x + 2, y + 5); gc.drawLine(x - 3, y + 4, x + 3, y + 4); gc.drawLine(x - 4, y + 3, x + 4, y + 3); break; case SWT.RIGHT: // don't need 1 as a line will be on it gc.drawLine(x + 3, y - 4, x + 3, y + 4); gc.drawLine(x + 4, y - 3, x + 4, y + 3); gc.drawLine(x + 5, y - 2, x + 5, y + 2); gc.drawLine(x + 6, y - 1, x + 6, y + 1); break; case SWT.LEFT: // don't need 1 as a line will be on it gc.drawLine(x - 3, y - 4, x - 3, y + 4); gc.drawLine(x - 4, y - 3, x - 4, y + 3); gc.drawLine(x - 5, y - 2, x - 5, y + 2); gc.drawLine(x - 6, y - 1, x - 6, y + 1); break; default: break; } }
Example 5
Source File: SVNWizardPage.java From APICloud-Studio with GNU General Public License v3.0 | 5 votes |
/** * Creates a new checkbox instance and sets the default layout data. * * @param group the composite in which to create the checkbox * @param label the string to set into the checkbox * @return the new checkbox */ protected Button createCheckBox(Composite group, String label) { Button button = new Button(group, SWT.CHECK | SWT.LEFT); button.setText(label); GridData data = new GridData(); data.horizontalSpan = 2; button.setLayoutData(data); return button; }
Example 6
Source File: FormPage.java From birt with Eclipse Public License 1.0 | 5 votes |
/** * Layouts widgets for simple UI type. * */ protected void normallLayout( ) { FormLayout layout = new FormLayout( ); layout.marginHeight = WidgetUtil.SPACING; layout.marginWidth = WidgetUtil.SPACING; layout.spacing = WidgetUtil.SPACING; setLayout( layout ); // int height = QUICK_BUTTON_HEIGHT - 2; FormData data = new FormData( ); data.right = new FormAttachment( 100 ); // data.height = height; btnDown.setLayoutData( data ); data = new FormData( ); data.right = new FormAttachment( btnDown, 0, SWT.LEFT ); // data.height = height; btnUp.setLayoutData( data ); data = new FormData( ); data.right = new FormAttachment( btnUp, 0, SWT.LEFT ); // data.height = height; btnDel.setLayoutData( data ); data = new FormData( ); data.right = new FormAttachment( btnDel, 0, SWT.LEFT ); // data.height = height; btnAdd.setLayoutData( data ); data = new FormData( ); data.top = new FormAttachment( btnUp, 0, SWT.BOTTOM ); data.left = new FormAttachment( 0, 0, SWT.LEFT ); data.right = new FormAttachment( 100 ); data.bottom = new FormAttachment( 100 ); table.setLayoutData( data ); }
Example 7
Source File: UtilsUI.java From EasyShell with Eclipse Public License 2.0 | 5 votes |
static public Label createLabel(Composite parent, String imageId, String text, String tooltip) { Label label = new Label(parent, SWT.LEFT); label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END)); if (text != null) { label.setText(text); label.setToolTipText(tooltip); } label.setImage(Activator.getImage(imageId)); return label; }
Example 8
Source File: TimeGraphFindDialog.java From tracecompass with Eclipse Public License 2.0 | 5 votes |
/** * Creates the status and close section of the dialog. * * @param parent * the parent composite * @return the status and close button */ private Composite createStatusAndCloseButton(Composite parent) { Composite panel = new Composite(parent, SWT.NULL); GridLayout layout = new GridLayout(); layout.numColumns = 2; layout.marginWidth = 0; layout.marginHeight = 0; panel.setLayout(layout); fStatusLabel = new Label(panel, SWT.LEFT); fStatusLabel.setText(Messages.TimeGraphFindDialog_StatusWrappedLabel); setGridData(fStatusLabel, SWT.FILL, true, SWT.CENTER, false); GridData gd = (GridData) fStatusLabel.getLayoutData(); gd.widthHint = fStatusLabel.computeSize(SWT.DEFAULT, SWT.DEFAULT).x; fStatusLabel.setText(""); //$NON-NLS-1$ Composite buttonSection = new Composite(panel, SWT.NULL); GridLayout buttonLayout = new GridLayout(); buttonLayout.numColumns = 2; buttonSection.setLayout(buttonLayout); String label = Messages.TimeGraphFindDialog_CloseButtonLabel; Button closeButton = createButton(buttonSection, 101, label, false); setGridData(closeButton, SWT.RIGHT, false, SWT.BOTTOM, false); fFindNextButton = makeButton(buttonSection, Messages.TimeGraphFindDialog_FindNextButtonLabel, 102, true, new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { performSearch(((e.stateMask & SWT.SHIFT) != 0) ^ isForwardSearch()); updateFindHistory(); } }); setGridData(fFindNextButton, SWT.FILL, true, SWT.FILL, false); return panel; }
Example 9
Source File: DialogField.java From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 | 5 votes |
/** * Creates a spacer control with the given span. The composite is assumed to have * <code>GridLayout</code> as layout. * * @param parent The parent composite * @param span the given span * @return the spacer control */ public static Control createEmptySpace(Composite parent, int span) { Label label= new Label(parent, SWT.LEFT); GridData gd= new GridData(); gd.horizontalAlignment= GridData.BEGINNING; gd.grabExcessHorizontalSpace= false; gd.horizontalSpan= span; gd.horizontalIndent= 0; gd.widthHint= 0; gd.heightHint= 0; label.setLayoutData(gd); return label; }
Example 10
Source File: FormPropertyDescriptor.java From birt with Eclipse Public License 1.0 | 5 votes |
protected void noUpDownLayout( ) { FormLayout layout = new FormLayout( ); layout.marginBottom = WidgetUtil.SPACING; layout.marginTop = 1; layout.marginWidth = WidgetUtil.SPACING; layout.spacing = WidgetUtil.SPACING; formPanel.setLayout( layout ); FormData data = new FormData( ); data.right = new FormAttachment( 90 ); data.top = new FormAttachment( 0, 0 ); data.width = Math.max( btnWidth, btnAdd.computeSize( SWT.DEFAULT, SWT.DEFAULT, true ).x ); btnAdd.setLayoutData( data ); data = new FormData( ); data.top = new FormAttachment( btnAdd, 0, SWT.BOTTOM ); data.left = new FormAttachment( btnAdd, 0, SWT.LEFT ); data.width = Math.max( btnWidth, btnEdit.computeSize( SWT.DEFAULT, SWT.DEFAULT, true ).x ); btnEdit.setLayoutData( data ); data = new FormData( ); data.top = new FormAttachment( btnEdit, 0, SWT.BOTTOM ); data.left = new FormAttachment( btnEdit, 0, SWT.LEFT ); data.width = Math.max( btnWidth, btnDel.computeSize( SWT.DEFAULT, SWT.DEFAULT, true ).x ); btnDel.setLayoutData( data ); data = new FormData( ); data.top = new FormAttachment( btnAdd, 0, SWT.TOP ); data.bottom = new FormAttachment( 100 ); data.left = new FormAttachment( 0, 0 ); data.right = new FormAttachment( btnAdd, 0, SWT.LEFT ); table.setLayoutData( data ); }
Example 11
Source File: FormPage.java From birt with Eclipse Public License 1.0 | 5 votes |
/** * Layouts widgets for simple UI type. * */ protected void normallLayout( ) { FormLayout layout = new FormLayout( ); layout.marginHeight = WidgetUtil.SPACING; layout.marginWidth = WidgetUtil.SPACING; layout.spacing = WidgetUtil.SPACING; setLayout( layout ); // int height = QUICK_BUTTON_HEIGHT - 2; FormData data = new FormData( ); data.right = new FormAttachment( 100 ); // data.height = height; btnDown.setLayoutData( data ); data = new FormData( ); data.right = new FormAttachment( btnDown, 0, SWT.LEFT ); // data.height = height; btnUp.setLayoutData( data ); data = new FormData( ); data.right = new FormAttachment( btnUp, 0, SWT.LEFT ); // data.height = height; btnDel.setLayoutData( data ); data = new FormData( ); data.right = new FormAttachment( btnDel, 0, SWT.LEFT ); // data.height = height; btnAdd.setLayoutData( data ); data = new FormData( ); data.top = new FormAttachment( btnUp, 0, SWT.BOTTOM ); data.left = new FormAttachment( title, 0, SWT.LEFT ); data.right = new FormAttachment( 100 ); data.bottom = new FormAttachment( 100 ); table.setLayoutData( data ); }
Example 12
Source File: ElasticSearchBulkDialog.java From pentaho-kettle with Apache License 2.0 | 4 votes |
public String open() { Shell parent = getParent(); Display display = parent.getDisplay(); shell = new Shell( parent, SWT.DIALOG_TRIM | SWT.RESIZE | SWT.MAX | SWT.MIN ); props.setLook( shell ); setShellImage( shell, model ); lsMod = new ModifyListener() { public void modifyText( ModifyEvent e ) { model.setChanged(); } }; changed = model.hasChanged(); FormLayout formLayout = new FormLayout(); formLayout.marginWidth = Const.FORM_MARGIN; formLayout.marginHeight = Const.FORM_MARGIN; shell.setLayout( formLayout ); shell.setText( BaseMessages.getString( PKG, "ElasticSearchBulkDialog.DialogTitle" ) ); int middle = props.getMiddlePct(); int margin = Const.MARGIN; // Stepname line wlStepname = new Label( shell, SWT.RIGHT ); wlStepname.setText( BaseMessages.getString( PKG, "System.Label.StepName" ) ); props.setLook( wlStepname ); fdlStepname = new FormData(); fdlStepname.left = new FormAttachment( 0, 0 ); fdlStepname.top = new FormAttachment( 0, margin ); fdlStepname.right = new FormAttachment( middle, -margin ); wlStepname.setLayoutData( fdlStepname ); wStepname = new Text( shell, SWT.SINGLE | SWT.LEFT | SWT.BORDER ); wStepname.setText( stepname ); props.setLook( wStepname ); wStepname.addModifyListener( lsMod ); fdStepname = new FormData(); fdStepname.left = new FormAttachment( middle, 0 ); fdStepname.top = new FormAttachment( 0, margin ); fdStepname.right = new FormAttachment( 100, 0 ); wStepname.setLayoutData( fdStepname ); wTabFolder = new CTabFolder( shell, SWT.BORDER ); props.setLook( wTabFolder, Props.WIDGET_STYLE_TAB ); // GENERAL TAB addGeneralTab(); // Servers TAB addServersTab(); // Fields TAB addFieldsTab(); // Settings TAB addSettingsTab(); // //////////// // BUTTONS // // ////////// wOK = new Button( shell, SWT.PUSH ); wOK.setText( BaseMessages.getString( PKG, "System.Button.OK" ) ); wCancel = new Button( shell, SWT.PUSH ); wCancel.setText( BaseMessages.getString( PKG, "System.Button.Cancel" ) ); setButtonPositions( new Button[]{wOK, wCancel}, margin, null ); fdTabFolder = new FormData(); fdTabFolder.left = new FormAttachment( 0, 0 ); fdTabFolder.top = new FormAttachment( wStepname, margin ); fdTabFolder.right = new FormAttachment( 100, 0 ); fdTabFolder.bottom = new FormAttachment( wOK, -margin ); wTabFolder.setLayoutData( fdTabFolder ); // ////////////////// // Std Listeners // // //////////////// addStandardListeners(); wTabFolder.setSelection( 0 ); // Set the shell size, based upon previous time... setSize(); getData( model ); model.setChanged( changed ); shell.open(); while ( !shell.isDisposed() ) { if ( !display.readAndDispatch() ) { display.sleep(); } } return stepname; }
Example 13
Source File: QueryDetailsControl.java From bonita-studio with GNU General Public License v2.0 | 4 votes |
private void createReturnTypeComposite(Composite parent) { Composite returnTypeComposite = formPage.getToolkit().createComposite(parent); returnTypeComposite.setLayout(GridLayoutFactory.fillDefaults().create()); returnTypeComposite.setLayoutData(GridDataFactory.fillDefaults().grab(false, true).create()); Label queryResultTypeLabel = formPage.getToolkit().createLabel(returnTypeComposite, Messages.queryResultType); queryResultTypeLabel.setLayoutData(GridDataFactory.fillDefaults().align(SWT.LEFT, SWT.CENTER).create()); returnTypeComboViewer = new ComboViewer(returnTypeComposite, SWT.BORDER | SWT.READ_ONLY); returnTypeComboViewer.getControl() .setLayoutData(GridDataFactory.fillDefaults().grab(false, false).hint(300, SWT.DEFAULT).create()); returnTypeComboViewer.setContentProvider(ArrayContentProvider.getInstance()); returnTypeComboViewer.setLabelProvider(new QueryResultTypeLabelProvider(boSelectedObservable)); updateReturnTypeViewerInput(); Label queryResultTypeInfoLabel = formPage.getToolkit().createLabel(returnTypeComposite, Messages.queryReturnTypeWarning); queryResultTypeInfoLabel .setLayoutData(GridDataFactory.fillDefaults().align(SWT.LEFT, SWT.CENTER).indent(20, 0).create()); ControlDecoration typeinfo = new ControlDecoration(queryResultTypeInfoLabel, SWT.LEFT); typeinfo.setImage(JFaceResources.getImage(Dialog.DLG_IMG_MESSAGE_INFO)); typeinfo.setMarginWidth(5); querySelectedObservable.addValueChangeListener(e -> { if (isDefault()) { returnTypeComboViewer.getControl().setEnabled(false); } else { returnTypeComboViewer.getControl().setEnabled(true); } }); boSelectedObservable.addValueChangeListener(e -> updateReturnTypeViewerInput()); IObservableValue<String> returnTypeSelectionObservable = ViewerProperties.singleSelection(String.class) .observe(returnTypeComboViewer); IObservableValue<String> returnTypeObservable = EMFObservables.observeDetailValue(Realm.getDefault(), querySelectedObservable, BusinessDataModelPackage.Literals.QUERY__RETURN_TYPE); ctx.bindValue(returnTypeSelectionObservable, returnTypeObservable); returnTypeObservable.addValueChangeListener(e -> queryViewer.refresh()); // might impact the info tooltip for the count queries }
Example 14
Source File: JobDialog.java From pentaho-kettle with Apache License 2.0 | 4 votes |
private void addSettingsTab() { // //////////////////////// // START OF SETTINGS TAB/// // / wSettingsTab = new CTabItem( wTabFolder, SWT.NONE ); wSettingsTab.setText( BaseMessages.getString( PKG, "JobDialog.SettingsTab.Label" ) ); FormLayout LogLayout = new FormLayout(); LogLayout.marginWidth = Const.MARGIN; LogLayout.marginHeight = Const.MARGIN; Composite wSettingsComp = new Composite( wTabFolder, SWT.NONE ); props.setLook( wSettingsComp ); wSettingsComp.setLayout( LogLayout ); wlBatchTrans = new Label( wSettingsComp, SWT.RIGHT ); wlBatchTrans.setText( BaseMessages.getString( PKG, "JobDialog.PassBatchID.Label" ) ); props.setLook( wlBatchTrans ); fdlBatchTrans = new FormData(); fdlBatchTrans.left = new FormAttachment( 0, 0 ); fdlBatchTrans.top = new FormAttachment( 0, margin ); fdlBatchTrans.right = new FormAttachment( middle, -margin ); wlBatchTrans.setLayoutData( fdlBatchTrans ); wBatchTrans = new Button( wSettingsComp, SWT.CHECK ); props.setLook( wBatchTrans ); wBatchTrans.setToolTipText( BaseMessages.getString( PKG, "JobDialog.PassBatchID.Tooltip" ) ); fdBatchTrans = new FormData(); fdBatchTrans.left = new FormAttachment( middle, 0 ); fdBatchTrans.top = new FormAttachment( 0, margin ); fdBatchTrans.right = new FormAttachment( 100, 0 ); wBatchTrans.setLayoutData( fdBatchTrans ); // Shared objects file Label wlSharedObjectsFile = new Label( wSettingsComp, SWT.RIGHT ); wlSharedObjectsFile.setText( BaseMessages.getString( PKG, "JobDialog.SharedObjectsFile.Label" ) ); props.setLook( wlSharedObjectsFile ); FormData fdlSharedObjectsFile = new FormData(); fdlSharedObjectsFile.left = new FormAttachment( 0, 0 ); fdlSharedObjectsFile.right = new FormAttachment( middle, -margin ); fdlSharedObjectsFile.top = new FormAttachment( wBatchTrans, 4 * margin ); wlSharedObjectsFile.setLayoutData( fdlSharedObjectsFile ); wSharedObjectsFile = new TextVar( jobMeta, wSettingsComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER ); wlSharedObjectsFile.setToolTipText( BaseMessages.getString( PKG, "JobDialog.SharedObjectsFile.Tooltip" ) ); wSharedObjectsFile.setToolTipText( BaseMessages.getString( PKG, "JobDialog.SharedObjectsFile.Tooltip" ) ); props.setLook( wSharedObjectsFile ); FormData fdSharedObjectsFile = new FormData(); fdSharedObjectsFile.left = new FormAttachment( middle, 0 ); fdSharedObjectsFile.top = new FormAttachment( wBatchTrans, 4 * margin ); fdSharedObjectsFile.right = new FormAttachment( 100, 0 ); wSharedObjectsFile.setLayoutData( fdSharedObjectsFile ); wSharedObjectsFile.addModifyListener( new ModifyListener() { public void modifyText( ModifyEvent arg0 ) { sharedObjectsFileChanged = true; } } ); FormData fdLogComp = new FormData(); fdLogComp.left = new FormAttachment( 0, 0 ); fdLogComp.top = new FormAttachment( 0, 0 ); fdLogComp.right = new FormAttachment( 100, 0 ); fdLogComp.bottom = new FormAttachment( 100, 0 ); wSettingsComp.setLayoutData( fdLogComp ); wSettingsComp.layout(); wSettingsTab.setControl( wSettingsComp ); // /////////////////////////////////////////////////////////// // / END OF LOG TAB // /////////////////////////////////////////////////////////// }
Example 15
Source File: MessageModal.java From Universal-FE-Randomizer with MIT License | 4 votes |
public MessageModal(Shell parent, String title, String message) { display = Display.getDefault(); yuneImage = new Image(display, Main.class.getClassLoader().getResourceAsStream("YuneIcon_100x100.png")); dialogShell = new Shell(parent, SWT.PRIMARY_MODAL | SWT.DIALOG_TRIM); dialogShell.setText(title); dialogShell.setImage(yuneImage); dialogShell.addListener(SWT.CLOSE, new Listener() { @Override public void handleEvent(Event event) { event.doit = false; } }); FormLayout mainLayout = new FormLayout(); mainLayout.marginWidth = 5; mainLayout.marginHeight = 5; dialogShell.setLayout(mainLayout); imageLabel = new Label(dialogShell, SWT.NONE); imageLabel.setImage(yuneImage); FormData imageData = new FormData(100, 100); imageData.left = new FormAttachment(0, 10); imageData.top = new FormAttachment(0, 10); imageLabel.setLayoutData(imageData); contentGroup = new Composite(dialogShell, SWT.NONE); FormLayout contentLayout = new FormLayout(); contentLayout.marginTop = 5; contentLayout.marginLeft = 5; contentLayout.marginBottom = 5; contentLayout.marginRight = 5; contentGroup.setLayout(contentLayout); titleLabel = new Label(contentGroup, SWT.LEFT); titleLabel.setText(title); FontData normalFont = titleLabel.getFont().getFontData()[0]; Font boldFont = new Font(display, normalFont.getName(), normalFont.getHeight(), SWT.BOLD); titleLabel.setFont(boldFont); FormData titleData = new FormData(); titleData.top = new FormAttachment(0, 0); titleData.left = new FormAttachment(0, 0); titleData.right = new FormAttachment(100, 0); titleLabel.setLayoutData(titleData); descriptionLabel = new Label(contentGroup, SWT.LEFT | SWT.WRAP); descriptionLabel.setText(message); FormData descriptionData = new FormData(); descriptionData.left = new FormAttachment(titleLabel, 0, SWT.LEFT); descriptionData.right = new FormAttachment(titleLabel, 0, SWT.RIGHT); descriptionData.top = new FormAttachment(titleLabel, 10); descriptionData.bottom = new FormAttachment(100, -5); Point expectedSize = descriptionLabel.computeSize(SWT.DEFAULT, SWT.DEFAULT); descriptionData.width = Math.max(200, expectedSize.x); descriptionData.height = Math.max(60, expectedSize.y); descriptionLabel.setLayoutData(descriptionData); FormData groupData = new FormData(); groupData.left = new FormAttachment(imageLabel, 10); groupData.top = new FormAttachment(imageLabel, 0, SWT.TOP); groupData.right = new FormAttachment(100, -10); contentGroup.setLayoutData(groupData); layoutSize(); Rectangle parentBounds = parent.getBounds(); Rectangle dialogBounds = dialogShell.getBounds(); dialogShell.setLocation(parentBounds.x + (parentBounds.width - dialogBounds.width) / 2, parentBounds.y + (parentBounds.height - dialogBounds.height) / 2); }
Example 16
Source File: InputTextVar.java From pentaho-kettle with Apache License 2.0 | 4 votes |
@Override protected void initText( VariableSpace space, Composite composite, int flags ) { input = new TextVar( space, this, SWT.LEFT | SWT.SINGLE | SWT.BORDER ); }
Example 17
Source File: AddOrEditSrxConfigDialog.java From translationstudio8 with GNU General Public License v2.0 | 4 votes |
/** * 创建映身 * @param tparent * ; */ private void createMapGroup(Composite tparent, GridData groupData, GridLayout groupLayout) { Group group = new Group(tparent, SWT.BORDER); group.setLayoutData(groupData); group.setLayout(groupLayout); group.setText(Messages.getString("srx.AddOrEditSrxConfigDialog.group")); mapTableViewer = new TableViewer(group, SWT.FULL_SELECTION | SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL | SWT.MULTI); mapTable = mapTableViewer.getTable(); mapTable.setLinesVisible(true); mapTable.setHeaderVisible(true); GridDataFactory.fillDefaults().span(4, SWT.DEFAULT).grab(true, true).applyTo(mapTable); mapTableViewer.setLabelProvider(new TableViewerLabelProvider()); mapTableViewer.setContentProvider(new ArrayContentProvider()); String[] columnNames = new String[] { Messages.getString("srx.AddOrEditSrxConfigDialog.columnNames1"), Messages.getString("srx.AddOrEditSrxConfigDialog.columnNames2") }; int[] columnAlignments = new int[] { SWT.LEFT, SWT.LEFT }; for (int i = 0; i < columnNames.length; i++) { TableColumn tableColumn = new TableColumn(mapTable, columnAlignments[i]); tableColumn.setText(columnNames[i]); tableColumn.setWidth(50); } refreshTableWidth(mapTable); mapAddBtn = new Button(group, SWT.NONE); mapAddBtn.setText(Messages.getString("srx.AddOrEditSrxConfigDialog.mapAddBtn")); setButtonLayoutData(mapAddBtn); mapEditBtn = new Button(group, SWT.NONE); mapEditBtn.setText(Messages.getString("srx.AddOrEditSrxConfigDialog.mapEditBtn")); setButtonLayoutData(mapEditBtn); mapDeleteBtn = new Button(group, SWT.NONE); mapDeleteBtn.setText(Messages.getString("srx.AddOrEditSrxConfigDialog.mapDeleteBtn")); setButtonLayoutData(mapDeleteBtn); new Label(group, SWT.NONE); mapTableViewer.addDoubleClickListener(new IDoubleClickListener() { public void doubleClick(DoubleClickEvent event) { editMapRules(); } }); }
Example 18
Source File: InputText.java From pentaho-kettle with Apache License 2.0 | 4 votes |
@Override protected void initText( VariableSpace space, Composite composite, int flags ) { input = new Text( this, SWT.LEFT | SWT.SINGLE | SWT.BORDER ); }
Example 19
Source File: ParameterBindingPage.java From birt with Eclipse Public License 1.0 | 4 votes |
protected void buildUI( ) { // sets the layout FormLayout layout = new FormLayout( ); layout.marginHeight = WidgetUtil.SPACING; layout.marginWidth = WidgetUtil.SPACING; layout.spacing = WidgetUtil.SPACING; setLayout( layout ); FormData data; Label title = new Label( this, SWT.NONE ); title.setText( DATA_SET_LABEL ); dataSetName = new Label( this, SWT.NONE ); data = new FormData( ); data.left = new FormAttachment( title, 0, SWT.RIGHT ); data.top = new FormAttachment( title, 0, SWT.CENTER ); data.right = new FormAttachment( 50 ); dataSetName.setLayoutData( data ); // create table and tableViewer TableArea tableArea = new TableArea( this, SWT.SINGLE | SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL | SWT.FULL_SELECTION, new IBaseTableAreaModifier( ) { public boolean editItem( Object element ) { return doEdit( element ); } } ); table = tableArea.getTable( ); for ( int i = 0; i < columnNames.length; i++ ) { TableColumn column = new TableColumn( table, SWT.LEFT ); column.setText( columnNames[i] ); column.setWidth( 200 ); } // layout table data = new FormData( ); data.top = new FormAttachment( title, 0, SWT.BOTTOM ); data.left = new FormAttachment( title, 0, SWT.LEFT ); data.right = new FormAttachment( 100 ); data.bottom = new FormAttachment( 100 ); tableArea.setLayoutData( data ); tableViewer = tableArea.getTableViewer( ); tableViewer.setUseHashlookup( true ); tableViewer.setColumnProperties( columnNames ); tableViewer.setContentProvider( new BindingContentProvider( ) ); tableViewer.setLabelProvider( new BindingLabelProvider( ) ); }
Example 20
Source File: JobExecutorDialog.java From pentaho-kettle with Apache License 2.0 | 4 votes |
private void addResultRowsTab() { final CTabItem wTab = new CTabItem( wTabFolder, SWT.NONE ); wTab.setText( BaseMessages.getString( PKG, "JobExecutorDialog.ResultRows.Title" ) ); wTab.setToolTipText( BaseMessages.getString( PKG, "JobExecutorDialog.ResultRows.Tooltip" ) ); ScrolledComposite scrolledComposite = new ScrolledComposite( wTabFolder, SWT.V_SCROLL | SWT.H_SCROLL ); scrolledComposite.setLayout( new FillLayout() ); Composite wInputComposite = new Composite( scrolledComposite, SWT.NONE ); props.setLook( wInputComposite ); FormLayout tabLayout = new FormLayout(); tabLayout.marginWidth = 15; tabLayout.marginHeight = 15; wInputComposite.setLayout( tabLayout ); wlResultRowsTarget = new Label( wInputComposite, SWT.RIGHT ); props.setLook( wlResultRowsTarget ); wlResultRowsTarget.setText( BaseMessages.getString( PKG, "JobExecutorDialog.ResultRowsTarget.Label" ) ); FormData fdlResultRowsTarget = new FormData(); fdlResultRowsTarget.top = new FormAttachment( 0, 0 ); fdlResultRowsTarget.left = new FormAttachment( 0, 0 ); // First one in the left wlResultRowsTarget.setLayoutData( fdlResultRowsTarget ); wResultRowsTarget = new CCombo( wInputComposite, SWT.SINGLE | SWT.LEFT | SWT.BORDER ); props.setLook( wResultRowsTarget ); wResultRowsTarget.addModifyListener( lsMod ); FormData fdResultRowsTarget = new FormData(); fdResultRowsTarget.width = 250; fdResultRowsTarget.top = new FormAttachment( wlResultRowsTarget, 5 ); fdResultRowsTarget.left = new FormAttachment( 0, 0 ); // To the right wResultRowsTarget.setLayoutData( fdResultRowsTarget ); wlResultFields = new Label( wInputComposite, SWT.NONE ); wlResultFields.setText( BaseMessages.getString( PKG, "JobExecutorDialog.ResultFields.Label" ) ); props.setLook( wlResultFields ); FormData fdlResultFields = new FormData(); fdlResultFields.left = new FormAttachment( 0, 0 ); fdlResultFields.top = new FormAttachment( wResultRowsTarget, 10 ); wlResultFields.setLayoutData( fdlResultFields ); int nrRows = ( jobExecutorMeta.getResultRowsField() != null ? jobExecutorMeta.getResultRowsField().length : 1 ); ColumnInfo[] ciResultFields = new ColumnInfo[] { new ColumnInfo( BaseMessages.getString( PKG, "JobExecutorDialog.ColumnInfo.Field" ), ColumnInfo.COLUMN_TYPE_TEXT, false, false ), new ColumnInfo( BaseMessages.getString( PKG, "JobExecutorDialog.ColumnInfo.Type" ), ColumnInfo.COLUMN_TYPE_CCOMBO, ValueMetaFactory.getValueMetaNames() ), new ColumnInfo( BaseMessages.getString( PKG, "JobExecutorDialog.ColumnInfo.Length" ), ColumnInfo.COLUMN_TYPE_TEXT, false ), new ColumnInfo( BaseMessages.getString( PKG, "JobExecutorDialog.ColumnInfo.Precision" ), ColumnInfo.COLUMN_TYPE_TEXT, false ), }; wResultRowsFields = new TableView( transMeta, wInputComposite, SWT.BORDER | SWT.FULL_SELECTION | SWT.MULTI | SWT.V_SCROLL | SWT.H_SCROLL, ciResultFields, nrRows, false, lsMod, props, false ); FormData fdResultFields = new FormData(); fdResultFields.left = new FormAttachment( 0, 0 ); fdResultFields.top = new FormAttachment( wlResultFields, 5 ); fdResultFields.right = new FormAttachment( 100, 0 ); fdResultFields.bottom = new FormAttachment( 100, 0 ); wResultRowsFields.setLayoutData( fdResultFields ); wResultRowsFields.getTable().addListener( SWT.Resize, new ColumnsResizer( 0, 25, 25, 25, 25 ) ); wInputComposite.pack(); Rectangle bounds = wInputComposite.getBounds(); scrolledComposite.setContent( wInputComposite ); scrolledComposite.setExpandHorizontal( true ); scrolledComposite.setExpandVertical( true ); scrolledComposite.setMinWidth( bounds.width ); scrolledComposite.setMinHeight( bounds.height ); wTab.setControl( scrolledComposite ); wTabFolder.setSelection( wTab ); }