org.eclipse.swt.widgets.Composite Java Examples
The following examples show how to use
org.eclipse.swt.widgets.Composite.
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: ExportToTranslationDictionaryDialog.java From ermasterr with Apache License 2.0 | 6 votes |
private void createTable(final Composite parent) { final GridData gridData = new GridData(); gridData.heightHint = 150; gridData.horizontalSpan = 2; gridData.horizontalAlignment = GridData.FILL; gridData.grabExcessHorizontalSpace = true; dictionaryTable = new Table(parent, SWT.FULL_SELECTION | SWT.BORDER | SWT.MULTI); dictionaryTable.setHeaderVisible(true); dictionaryTable.setLinesVisible(true); dictionaryTable.setLayoutData(gridData); parent.pack(); final int width = dictionaryTable.getBounds().width; final TableColumn physicalNameTableColumn = new TableColumn(dictionaryTable, SWT.LEFT); physicalNameTableColumn.setText(ResourceString.getResourceString("label.physical.name")); physicalNameTableColumn.setWidth(width / 2 - 5); final TableColumn logicalNameTableColumn = new TableColumn(dictionaryTable, SWT.LEFT); logicalNameTableColumn.setText(ResourceString.getResourceString("label.logical.name")); logicalNameTableColumn.setWidth(width / 2 - 5); }
Example #2
Source File: AbapGitStagingView.java From ADT_Frontend with MIT License | 6 votes |
private void createCommitMessageComposite(Composite parent) { Composite commitMessageComposite = this.toolkit.createComposite(parent); this.toolkit.paintBordersFor(commitMessageComposite); GridLayoutFactory.fillDefaults().numColumns(1).applyTo(commitMessageComposite); GridDataFactory.fillDefaults().grab(true, true).applyTo(commitMessageComposite); this.commitMessageTextViewer = new TextViewer(commitMessageComposite, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL); this.commitMessageTextViewer.setData(FormToolkit.KEY_DRAW_BORDER, FormToolkit.TREE_BORDER); GridDataFactory.fillDefaults().grab(true, true).applyTo(this.commitMessageTextViewer.getTextWidget()); this.commitMessageTextViewer.getTextWidget().setAlwaysShowScrollBars(false); this.commitMessageTextViewer.getTextWidget().setFont(JFaceResources.getTextFont()); SWTUtil.addTextEditMenu(this.commitMessageTextViewer.getTextWidget()); //draw a line to hint the max commit line length createMarginPainter(this.commitMessageTextViewer); this.commitMessageTextViewer.getTextWidget().addModifyListener(e -> validateInputs()); }
Example #3
Source File: FromViewDocListControl.java From depan with Apache License 2.0 | 6 votes |
public FromViewDocListControl(Composite parent) { super(parent); Map<String, FromViewDocContributor> byView = FromViewDocRegistry.getRegistryContributionMap(); Map<String, FromGraphDocContributor> byNodes = FromGraphDocRegistry.getRegistryContributionMap(); Map<String, Object> choices = Maps.newHashMap(); choices.putAll(byView); for (Entry<String, FromGraphDocContributor> byNode : byNodes.entrySet()) { choices.put(byNode.getKey() + " (nodes)", byNode.getValue()); } setInput(getBestFrom(choices), choices); }
Example #4
Source File: JarImportWizardPage.java From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 | 6 votes |
/** * {@inheritDoc} */ public void createControl(final Composite parent) { initializeDialogUnits(parent); final Composite composite= new Composite(parent, SWT.NONE); composite.setLayout(new GridLayout()); composite.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_FILL | GridData.HORIZONTAL_ALIGN_FILL)); createLocationGroup(composite); if (fImportWizard) createInputGroup(composite); createRenameGroup(composite); setPageComplete(false); if (fImportWizard && !fTreeViewer.getControl().isEnabled()) setMessage(JarImportMessages.JarImportWizardPage_no_jar_files, INFORMATION); setControl(composite); Dialog.applyDialogFont(composite); PlatformUI.getWorkbench().getHelpSystem().setHelp(composite, IJavaHelpContextIds.JARIMPORT_WIZARD_PAGE); }
Example #5
Source File: Regression_118773_swt.java From birt with Eclipse Public License 1.0 | 6 votes |
/** * Get the connection with SWT device to render the graphics. */ Regression_118773_swt( Composite parent, int style ) { super( parent, style ); contextMap = new HashMap( ); final PluginSettings ps = PluginSettings.instance( ); try { idr = ps.getDevice( "dv.SWT" );//$NON-NLS-1$ idr.setProperty( IDeviceRenderer.UPDATE_NOTIFIER, this ); } catch ( ChartException ex ) { ex.printStackTrace( ); } cm = Title.BarChart( ); }
Example #6
Source File: TableLayoutComposite.java From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 | 6 votes |
/** * Creates a new <code>TableLayoutComposite</code>. * * @param parent the parent composite * @param style the SWT style */ public TableLayoutComposite(Composite parent, int style) { super(parent, style); addControlListener(new ControlAdapter() { @Override public void controlResized(ControlEvent e) { Rectangle area= getClientArea(); Table table= (Table)getChildren()[0]; Point preferredSize= computeTableSize(table); int width= area.width - 2 * table.getBorderWidth(); if (preferredSize.y > area.height) { // Subtract the scrollbar width from the total column width // if a vertical scrollbar will be required Point vBarSize = table.getVerticalBar().getSize(); width -= vBarSize.x; } layoutTable(table, width, area, table.getSize().x < area.width); } }); }
Example #7
Source File: JobEntryCopyFilesDialog.java From pentaho-kettle with Apache License 2.0 | 6 votes |
protected Button createSettingsButton( Composite p, String text, String title, Control top, SelectionAdapter sa ) { Button button = new Button( p, SWT.CHECK ); button.setText( BaseMessages.getString( PKG, text ) ); button.setToolTipText( BaseMessages.getString( PKG, title ) ); props.setLook( button ); FormData fd = new FormData(); fd.left = new FormAttachment( 0, Const.MARGIN * 2 ); if ( top == null ) { fd.top = new FormAttachment( 0, 10 ); } else { fd.top = new FormAttachment( top, 5 ); } fd.right = new FormAttachment( 100, 0 ); button.setLayoutData( fd ); button.addSelectionListener( sa ); return button; }
Example #8
Source File: AbstractEditor.java From gama with GNU General Public License v3.0 | 6 votes |
protected Control createEditorControl(final Composite comp) { Control paramControl; try { paramControl = !isEditable ? createLabelParameterControl(comp) : isCombo ? createComboParameterControl(comp) : createCustomParameterControl(comp); } catch (final GamaRuntimeException e1) { e1.addContext("The editor for " + name + " could not be created"); GAMA.reportError(GAMA.getRuntimeScope(), e1, false); return null; } final GridData data = getParameterGridData(); paramControl.setLayoutData(data); paramControl.setBackground(comp.getBackground()); addToolbarHiders(paramControl); return paramControl; }
Example #9
Source File: Expression.java From Rel with Apache License 2.0 | 6 votes |
@Override protected void buildControlPanel(Composite container) { container.setLayout(new GridLayout(2, false)); Label label = new Label(container, SWT.None); label.setText("Expression:"); Text expression = new Text(container, SWT.None); expression.setText(operatorLabel.getText()); expression.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1)); expression.addModifyListener(new ModifyListener() { @Override public void modifyText(ModifyEvent e) { operatorLabel.setText(expression.getText()); Expression.this.pack(); } }); }
Example #10
Source File: BatchQADialog.java From tmxeditor8 with GNU General Public License v2.0 | 6 votes |
@Override protected Control createDialogArea(Composite parent) { Composite tparent = (Composite) super.createDialogArea(parent); GridData parentData = new GridData(SWT.FILL, SWT.FILL, true, true); parentData.widthHint = 600; parentData.heightHint = 300; tparent.setLayoutData(parentData); GridLayoutFactory.fillDefaults().extendedMargins(-1, -1, -1, 8).numColumns(1).applyTo(tparent); createLogoArea(tparent); createFileDataGroup(tparent); tableViewer.getTable().setFocus(); return tparent; }
Example #11
Source File: IndexTabWrapper.java From ermasterr with Apache License 2.0 | 6 votes |
private void initTable(final Composite parent) { final GridData gridData = new GridData(); gridData.horizontalSpan = 3; gridData.grabExcessHorizontalSpace = true; gridData.horizontalAlignment = GridData.FILL; gridData.heightHint = 200; indexTable = new Table(parent, SWT.BORDER | SWT.HIDE_SELECTION); indexTable.setHeaderVisible(true); indexTable.setLayoutData(gridData); indexTable.setLinesVisible(true); CompositeFactory.createTableColumn(indexTable, "label.column.name", -1); final TableColumn separatorColumn = CompositeFactory.createTableColumn(indexTable, "", 3); separatorColumn.setResizable(false); }
Example #12
Source File: ViewProperties.java From arx with Apache License 2.0 | 5 votes |
/** * Constructor. * * @param parent * @param controller * @param target * @param reset */ protected ViewProperties(final Composite parent, final Controller controller, final ModelPart target, final ModelPart reset) { // Register controller.addListener(ModelPart.SELECTED_VIEW_CONFIG, this); controller.addListener(ModelPart.SELECTED_ATTRIBUTE, this); controller.addListener(ModelPart.ATTRIBUTE_TYPE, this); controller.addListener(ModelPart.ATTRIBUTE_TYPE_BULK_UPDATE, this); controller.addListener(ModelPart.METRIC, this); controller.addListener(ModelPart.ATTRIBUTE_WEIGHT, this); controller.addListener(ModelPart.GS_FACTOR, this); controller.addListener(ModelPart.MAX_OUTLIERS, this); controller.addListener(ModelPart.DATA_TYPE, this); controller.addListener(ModelPart.COST_BENEFIT_MODEL, this); controller.addListener(ModelPart.MODEL, this); controller.addListener(target, this); if (reset != null) { controller.addListener(reset, this); } this.reset = reset; this.root = parent; this.controller = controller; this.context.setTarget(target); }
Example #13
Source File: LoginDialog.java From neoscada with Eclipse Public License 1.0 | 5 votes |
@Override protected Control createButtonBar ( final Composite parent ) { final Control control = super.createButtonBar ( parent ); update (); loadFrom (); return control; }
Example #14
Source File: ExpandedContentManagerTest.java From pentaho-kettle with Apache License 2.0 | 5 votes |
@Test public void testHideExpandedContentManager() throws Exception { TransGraph transGraph = mock( TransGraph.class ); Browser browser = mock( Browser.class ); SashForm sashForm = mock( SashForm.class ); Composite parent = setupExpandedContentMocks( transGraph, browser, sashForm ); ExpandedContentManager.hideExpandedContent( transGraph ); verify( browser ).moveBelow( null ); verify( parent ).layout( true, true ); verify( parent ).redraw(); verify( sashForm ).setWeights( new int[] { 3, 2, 1 } ); }
Example #15
Source File: IndexDialog.java From ermaster-b with Apache License 2.0 | 5 votes |
/** * {@inheritDoc} */ @Override protected void createButtonsForButtonBar(Composite parent) { createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true); createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false); }
Example #16
Source File: TexInformationControl.java From texlipse with Eclipse Public License 1.0 | 5 votes |
/** * Creates a composite with a ScrolledFormText to display the info text */ private void initTextBox() { textComposite = new Composite(shell, SWT.NONE); textComposite.setLayout(new FillLayout()); GridData gdata = new GridData(SWT.FILL, SWT.TOP, true, false); textComposite.setLayoutData(gdata); hoverText = new StyledText(textComposite, SWT.WRAP); hoverText.setBackground(display.getSystemColor(SWT.COLOR_INFO_BACKGROUND)); }
Example #17
Source File: H5ResourcePage.java From dawnsci with Eclipse Public License 1.0 | 5 votes |
protected final void createDestinationGroup(Composite containerGroup) { // container label Label resourcesLabel = new Label(containerGroup, SWT.NONE); resourcesLabel.setText("Parent Folder "); // container name entry field this.containerNameField = new Text(containerGroup, SWT.SINGLE | SWT.BORDER); containerNameField.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false)); final String containerPath = getContainerPath(selection); if (containerPath!=null) containerNameField.setText(containerPath); containerNameField.addModifyListener(new ModifyListener() { @Override public void modifyText(ModifyEvent e) { dialogChanged(); } }); // container browse button Button containerBrowseButton = new Button(containerGroup, SWT.PUSH); containerBrowseButton.setText("Browse..."); containerBrowseButton.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false)); containerBrowseButton.addListener(SWT.Selection, new Listener() { @Override public void handleEvent(Event event) { final IPath path = queryForContainer(getSpecifiedContainer(),"Choose folder to import to", "Choose Folder"); containerNameField.setText(path.toString()); dialogChanged(); } }); setButtonLayoutData(containerBrowseButton); }
Example #18
Source File: ContentAssistPreferencePage.java From APICloud-Studio with GNU General Public License v3.0 | 5 votes |
/** * createUserAgentGroupContent * * @param parent */ protected void createUserAgentGroupContent(Composite parent) { createNatureSelector(parent); createUserAgentTable(parent); createUserAgentButtons(parent); createFilterSelector(parent); UserAgentManager manager = UserAgentManager.getInstance(); // initialize nature to user agent map userAgentsByNatureID = new HashMap<String, IUserAgent[]>(); if (isProjectPreferencePage()) { try { IProject project = getProject(); if (project.isAccessible()) { String[] aptanaNatures = ResourceUtil.getAptanaNatures(project.getDescription()); if (!ArrayUtil.isEmpty(aptanaNatures)) { userAgentsByNatureID.put(aptanaNatures[0], manager.getActiveUserAgents(project)); } } } catch (CoreException e) { IdeLog.logError(CommonEditorPlugin.getDefault(), e); } } else { // Filter selection only visible on the workspace setting level. for (String natureID : ResourceUtil.getAptanaNaturesMap().values()) { userAgentsByNatureID.put(natureID, manager.getActiveUserAgents(natureID)); } } updateUserAgentSelection(); }
Example #19
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 #20
Source File: EditorSelection.java From arx with Apache License 2.0 | 5 votes |
@Override public void createControl(final Composite parent) { combo = new Combo(parent, SWT.READ_ONLY); combo.setItems(elems); combo.select(indexOf(getValue())); combo.setLayoutData(SWTUtil.createFillHorizontallyGridData()); combo.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(final SelectionEvent arg0) { if (combo.getSelectionIndex() >= 0) { setValue(elems[combo.getSelectionIndex()]); } } }); }
Example #21
Source File: UIUtil.java From birt with Eclipse Public License 1.0 | 5 votes |
/** * Notice: Please dispose the image after done. * * @param composite * @return */ public static Image newImageFromComposite( Composite composite ) { Point compositeSize = composite.getSize( ); GC gc = new GC( composite ); Image image = new Image( Display.getCurrent( ), compositeSize.x, compositeSize.y ); gc.copyArea( image, 0, 0 ); gc.dispose( ); return image; }
Example #22
Source File: ChartCubeFilterConditionBuilder.java From birt with Eclipse Public License 1.0 | 5 votes |
private int create2ValueComposite( Composite condition ) { if ( expressionValue1 != null && !expressionValue1.isDisposed( ) ) { return 0; } if ( valueListComposite != null && !valueListComposite.isDisposed( ) ) { valueListComposite.dispose( ); valueListComposite = null; } GridData expgd = new GridData( ); expgd.widthHint = 100; expressionValue1 = createExpressionValue( condition ); expressionValue1.setLayoutData( expgd ); dummy1 = createDummy( condition, 3 ); andLable = new Label( condition, SWT.NONE ); andLable.setText( Messages.getString( "FilterConditionBuilder.text.AND" ) ); //$NON-NLS-1$ andLable.setEnabled( false ); andLable.setVisible( false ); dummy2 = createDummy( condition, 3 ); expressionValue2 = createExpressionValue( condition ); expressionValue2.setLayoutData( expgd ); expressionValue2.setVisible( false ); ExpressionButtonUtil.getExpressionButton( expressionValue2 ) .getControl( ) .setVisible( false ); condition.getParent( ).layout( true, true ); return 1; }
Example #23
Source File: ComponentRiskThresholds.java From arx with Apache License 2.0 | 5 votes |
/** * Creates a label * @param root * @param text */ private void createLabel(Composite root, String text) { // Label CLabel label = new CLabel(root, SWT.CENTER); label.setText(text); label.setLayoutData(SWTUtil.createFillHorizontallyGridData(true, 2)); label.setToolTipText(text); }
Example #24
Source File: GridAttributesComposite.java From birt with Eclipse Public License 1.0 | 5 votes |
/** * @param parent * @param style */ public GridAttributesComposite( Composite parent, int style, int optionalStyles, ChartWizardContext context, Grid grid, int orientation, boolean bTicksVisible, Grid defGrid ) { super( parent, style ); this.orientation = orientation; this.context = context; this.bTicksVisible = bTicksVisible; this.defGrid = defGrid; setOptionalStyles( optionalStyles ); init( grid ); placeComponents( ); }
Example #25
Source File: StylePreferencePage.java From neoscada with Eclipse Public License 1.0 | 5 votes |
private void createDescription ( final Composite parent ) { final Label label = new Label ( parent, SWT.NONE ); label.setText ( Messages.StylePreferencePage_Description_Label ); this.descriptionArea = new Text ( parent, SWT.MULTI | SWT.READ_ONLY | SWT.BORDER | SWT.WRAP ); final GridData gd = new GridData ( SWT.FILL, SWT.FILL, true, true ); gd.widthHint = 300; // a bit hacky this.descriptionArea.setLayoutData ( gd ); }
Example #26
Source File: TestDataEditTest.java From ermaster-b with Apache License 2.0 | 5 votes |
private void initialize(Composite parent) { ERDiagram diagram = new ERDiagram(MySQLDBManager.ID); ERTable table = new ERTable(); table.setPhysicalName("table1"); table.setLogicalName("table1"); TypeData typeData = new TypeData(null, null, false, null, false, null); Word word1 = new Word("a", "a", SqlType.valueOfId("bigint"), typeData, null, MySQLDBManager.ID); NormalColumn column1 = new NormalColumn(word1, true, true, true, true, null, null, null, null, null); Word word2 = new Word("a", "a", SqlType.valueOfId("bigint"), typeData, null, MySQLDBManager.ID); NormalColumn column2 = new NormalColumn(word2, true, true, true, true, null, null, null, null, null); table.addColumn(column1); table.addColumn(column2); diagram.addContent(table); TestDataDialog dialog = new TestDataDialog(shell, diagram, new TestData()); dialog.open(); }
Example #27
Source File: SocialIndicatorEditor.java From olca-app with Mozilla Public License 2.0 | 5 votes |
private void createQuantityCombo(FormToolkit tk, Composite comp) { UI.formLabel(comp, tk, M.Quantity); quantityCombo = new FlowPropertyViewer(comp); quantityCombo.setInput(Database.get()); FlowProperty aq = getModel().activityQuantity; if (aq != null) { quantityCombo.select(Descriptor.of(aq)); } quantityCombo.addSelectionChangedListener(this::quantityChanged); new CommentControl(comp, getToolkit(), "activityQuantity", getComments()); }
Example #28
Source File: CamelMultiPageTalendEditor.java From tesb-studio-se with Apache License 2.0 | 5 votes |
@Override protected void createPages() { createPage0(); createPage1(); createPage2(); if (getPageCount() == 1) { Composite container = getContainer(); if (container instanceof CTabFolder) { ((CTabFolder) container).setTabHeight(0); } } }
Example #29
Source File: InstallNpmDependencyDialog.java From n4js with Eclipse Public License 1.0 | 5 votes |
@Override protected Control createDialogArea(Composite parent) { final Group customDialogArea = new Group(parent, SHADOW_ETCHED_IN); customDialogArea.setLayout(GridLayoutFactory.fillDefaults().numColumns(1).equalWidth(false).create()); customDialogArea.setLayoutData(GridDataFactory.fillDefaults().grab(true, true).align(FILL, TOP).create()); createNameArea(customDialogArea, PACKAGE_NAME, this::handlePackageNameInput); createVersionArea(customDialogArea, VERSION_OPTIONAL, this::handleVersionInput); return customDialogArea; }
Example #30
Source File: AddGetterSetterAction.java From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 | 5 votes |
@Override protected Composite createSelectionButtons(Composite composite) { Composite buttonComposite= super.createSelectionButtons(composite); GridLayout layout= new GridLayout(); buttonComposite.setLayout(layout); createGetterSetterButtons(buttonComposite); layout.marginHeight= 0; layout.marginWidth= 0; layout.numColumns= 1; return buttonComposite; }