private void initialize() { List<Control> children = new ArrayList<>(Arrays.asList(shlMyanmarTyping.getChildren())); while (!children.isEmpty()) { Control c = children.remove(0); if (c instanceof Composite) { children.addAll(Arrays.asList(((Composite) c).getChildren())); } else if (c instanceof Button) { Button b = (Button) c; MMKey key = MMKey.ALL_MM_KEY_MAP.get(b.getText().charAt(0)); if (key != null) { b.setData(key); b.setText(key.toString()); b.addSelectionListener(listener); } } } text.addModifyListener(modifyListener); text_5.addModifyListener(modifyTextListener); text_1.setEditable(false); text_2.setEditable(false); text_3.setEditable(false); text_4.setEditable(false); text.setFocus(); text.setText(defaultText); text_5.setText("100F"); }
/** Creates the widgets in the "child" group. */ void createChildWidgets() { /* Add common controls */ super.createChildWidgets(); GridData gridData = new GridData(GridData.FILL_HORIZONTAL); gridData.horizontalSpan = 3; Label lblAverage = new Label(childGroup, SWT.NONE); lblAverage.setText("Average"); lblAverage.setLayoutData(gridData); avgText = new Text(childGroup, SWT.BORDER); avgText.setEditable(false); avgText.setLayoutData(gridData); Label lblVariant = new Label(childGroup, SWT.NONE); lblVariant.setText("Variant"); lblVariant.setLayoutData(gridData); variantText = new Text(childGroup, SWT.BORDER); variantText.setEditable(false); variantText.setLayoutData(gridData); Label lblMax = new Label(childGroup, SWT.NONE); lblMax.setText("Max"); lblMax.setLayoutData(gridData); maxText = new Text(childGroup, SWT.BORDER); maxText.setEditable(false); maxText.setLayoutData(gridData); Label lblMin = new Label(childGroup, SWT.NONE); lblMin.setText("Min"); lblMin.setLayoutData(gridData); minText = new Text(childGroup, SWT.BORDER); minText.setEditable(false); minText.setLayoutData(gridData); }
public void setComputingInfrastructureService(ComputingInfrastructureService cis) { changeSupport.firePropertyChange( "instance", this.computingInfrastructureService, this.computingInfrastructureService = cis); if (cis == null) { this.infrastructureLayer = null; this.cloudProvider = null; this.cloudSpecification = null; this.setVisible(false); } else { this.infrastructureLayer = (InfrastructureLayer) computingInfrastructureService.eContainer(); this.cloudProvider = (CloudEnvironment) infrastructureLayer.eContainer(); this.cloudSpecification = SpecificationProviderService.getInstance() .getCloudDefinition(cloudProvider.getCloudEnvironmentDescriptor().getProviderID()); this.setVisible(true); boolean enableChanges = false; // cis.getDescriptor().isEditable(); txtCpu.setEditable(enableChanges); txtCpuUnits.setEditable(enableChanges); txtMemory.setEditable(enableChanges); txtStorage.setEditable(enableChanges); } if (m_bindingContext != null) { m_bindingContext.dispose(); } m_bindingContext = initDataBindings(); }
private void parseSampleURL(DBPDriver driver) { metaURL = null; if (!CommonUtils.isEmpty(driver.getSampleURL())) { isCustom = false; try { metaURL = DriverDescriptor.parseSampleURL(driver.getSampleURL()); } catch (DBException e) { setErrorMessage(e.getMessage()); } final Set<String> properties = metaURL.getAvailableProperties(); urlText.setEditable(false); // urlText.setBackground(urlText.getDisplay().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND)); showControlGroup(GROUP_HOST, properties.contains(DriverDescriptor.PROP_HOST)); showControlGroup(GROUP_SERVER, properties.contains(DriverDescriptor.PROP_SERVER)); showControlGroup(GROUP_DB, properties.contains(DriverDescriptor.PROP_DATABASE)); showControlGroup( GROUP_PATH, properties.contains(DriverDescriptor.PROP_FOLDER) || properties.contains(DriverDescriptor.PROP_FILE)); } else { isCustom = true; showControlGroup(GROUP_HOST, false); showControlGroup(GROUP_SERVER, false); showControlGroup(GROUP_DB, false); showControlGroup(GROUP_PATH, false); urlText.setEditable(true); urlText.setBackground(null); } showControlGroup(GROUP_LOGIN, !driver.isAnonymousAccess()); updateCreateButton(driver); settingsGroup.layout(); }
@Override public void setUnlocked(boolean unlocked) { textStrasse.setEditable(unlocked); textPostleitzahl.setEditable(unlocked); textOrtschaft.setEditable(unlocked); tableCombo.setEnabled(unlocked); }
/* * @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite) */ public void createControl(Composite parent) { WidgetFactory factory = getWidgetFactory(); final int gridDataStyle = GridData.FILL_HORIZONTAL | GridData.GRAB_HORIZONTAL; final GridData fieldGridData = new GridData(gridDataStyle); Composite container = new Composite(parent, SWT.NULL); container.setBackground(parent.getBackground()); container.setForeground(parent.getForeground()); container.setLayout(new GridLayout(2, false)); container.setLayoutData(fieldGridData); Label label = null; // Format code label = new Label(container, SWT.NULL); label.setText(Messages.getString("aaa.mdf.metadict.entity.sqlname.label")); label.setBackground(container.getBackground()); mdSQLName = factory.createText(container, null); mdSQLName.setLayoutData(fieldGridData); mdSQLName.setEditable(false); // Format Finantial Function label = new Label(container, SWT.NULL); label.setText(Messages.getString("aaa.mdf.metadict.entity.name.label")); label.setBackground(container.getBackground()); mdName = factory.createText(container, null); mdName.setLayoutData(fieldGridData); mdName.setEditable(false); initialize(); setControl(container); }
@Override protected void createFieldEditors() { Text text = null; StringFieldEditor databaseDriverNameField = new StringFieldEditor( CommonParameters.DATABASE_DRIVER_NAME, "&Driver Name:", getFieldEditorParent()); text = databaseDriverNameField.getTextControl(getFieldEditorParent()); text.setEditable(false); text.setText( CommonParameters.get(CommonParameters.DATABASE_DRIVER_NAME) != null ? CommonParameters.get(CommonParameters.DATABASE_DRIVER_NAME) : DatabasePreferencePage.N_A); addField(databaseDriverNameField); StringFieldEditor databaseMinorVersionField = new StringFieldEditor( CommonParameters.DATABASE_DRIVER_MINOR_VERSION, "&Minor Version:", getFieldEditorParent()); text = databaseMinorVersionField.getTextControl(getFieldEditorParent()); text.setEditable(false); text.setText( CommonParameters.get(CommonParameters.DATABASE_DRIVER_MINOR_VERSION) != null ? CommonParameters.get(CommonParameters.DATABASE_DRIVER_MINOR_VERSION) : DatabasePreferencePage.N_A); addField(databaseMinorVersionField); StringFieldEditor databaseMajorVersionField = new StringFieldEditor( CommonParameters.DATABASE_DRIVER_MAJOR_VERSION, "&Major Version:", getFieldEditorParent()); text = databaseMajorVersionField.getTextControl(getFieldEditorParent()); text.setEditable(false); text.setText( CommonParameters.get(CommonParameters.DATABASE_DRIVER_MAJOR_VERSION) != null ? CommonParameters.get(CommonParameters.DATABASE_DRIVER_MAJOR_VERSION) : DatabasePreferencePage.N_A); addField(databaseMajorVersionField); StringFieldEditor databaseConnectionClassNameField = new StringFieldEditor( CommonParameters.DATABASE_CONNECTION_CLASS_NAME, "&Connection Class Name:", getFieldEditorParent()); text = databaseConnectionClassNameField.getTextControl(getFieldEditorParent()); text.setEditable(false); text.setText( CommonParameters.get(CommonParameters.DATABASE_CONNECTION_CLASS_NAME) != null ? CommonParameters.get(CommonParameters.DATABASE_CONNECTION_CLASS_NAME) : DatabasePreferencePage.N_A); addField(databaseConnectionClassNameField); }
/** Create contents of the shell. */ protected void createContents() { setText(Messages.getString("ShowAlphaContentWindow.1")); // $NON-NLS-1$ setSize(325, 130); setLayout(new GridLayout()); { composite = new Composite(this, SWT.NONE); composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1)); composite.setLayout(new GridLayout(1, false)); { lblCharactersInThe = new Label(composite, SWT.WRAP); GridData layoutData = new GridData(SWT.FILL, SWT.BEGINNING, true, false); layoutData.widthHint = 130; lblCharactersInThe.setLayoutData(layoutData); if (alpha instanceof BlockAlphabet) { lblCharactersInThe.setText( String.format( Messages.getString("ShowAlphaContentWindow.0"), ((BlockAlphabet) alpha).getBlockName())); // $NON-NLS-1$ } else { lblCharactersInThe.setText(Messages.getString("ShowAlphaContentWindow.2")); // $NON-NLS-1$ } } { text = new Text(composite, SWT.BORDER | SWT.MULTI); text.setEditable(false); text.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1)); text.setText(AbstractAlphabet.alphabetContentAsString(alpha.getCharacterSet())); } } }
protected Control createDialogArea(Composite parent) { parent.setLayout(new GridLayout(1, false)); textArea = new Text(parent, SWT.MULTI | SWT.WRAP | SWT.V_SCROLL | SWT.BORDER); textArea.setEditable(false); GridData textAreaGD = new GridData(SWT.FILL, SWT.FILL, true, true); textArea.setLayoutData(textAreaGD); // Composite buttonComposite = new Composite(parent, SWT.NONE); // buttonComposite.setLayoutData(new GridData(SWT.FILL, SWT.BOTTOM, true, false)); // buttonComposite.setLayout(new GridLayout(2, true)); // // Button saveButton = new Button(buttonComposite, SWT.PUSH); // saveButton.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false)); // saveButton.setText("Save"); // saveButton.addSelectionListener(new SelectionAdapter(){ // public void widgetSelected( org.eclipse.swt.events.SelectionEvent e ) { // saveReport(); // }; // }); // // Button clearButton = new Button(buttonComposite, SWT.PUSH); // clearButton.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false)); // clearButton.setText("Clear"); // clearButton.addSelectionListener(new SelectionAdapter(){ // public void widgetSelected( org.eclipse.swt.events.SelectionEvent e ) { // clearReport(); // }; // }); return parent; }
private List<Text> addTextFrom(final Page page, final Composite c) { if (lines != null) { for (Composite line : lines) { line.dispose(); } } List<Text> list = new ArrayList<Text>(); this.page = page; Composite lineComposite = new Composite(c, SWT.NONE); setLineLayout(lineComposite); if (lines != null) lines.add(lineComposite); for (Word word : JavaConversions.asJavaIterable(page.words())) { if (word.original().equals(Page.ParagraphMarker())) { lineComposite = new Composite(c, SWT.NONE); setLineLayout(lineComposite); lines.add(lineComposite); } else { Text text = new Text(lineComposite, SWT.NONE); setCssName(text); text.setText(TextHelper.fixForDisplay(word.history().top().form())); handleEmptyText(text); // option: word.isPossibleError() ? UNCHECKED : DEFAULT text.setForeground(parent.getDisplay().getSystemColor(DEFAULT)); text.setData(Word.class.toString(), word); text.setData(Page.class.toString(), page); addListeners(text); text.setEditable(!word.isLocked() && !page.done()); list.add(text); } } this.layout(); return list; }
private void createRegionComposite(Composite regionComposite, RegionType regionType) { if (showName) { Composite nameComp = new Composite(regionComposite, SWT.NONE); nameComp.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false)); nameComp.setLayout(new GridLayout(2, false)); final Label nameLabel = new Label(nameComp, SWT.NONE); nameLabel.setText("Region Name "); nameLabel.setLayoutData(new GridData(SWT.LEFT, SWT.FILL, false, false)); nameText = new Text(nameComp, SWT.BORDER | SWT.SINGLE); nameText.setToolTipText("Region name"); nameText.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false)); nameText.setEditable(false); } Group regionTableGroup = new Group(regionComposite, SWT.NONE); GridData gridData = new GridData(SWT.FILL, SWT.LEFT, true, true); regionTableGroup.setLayout(new GridLayout(1, false)); regionTableGroup.setLayoutData(gridData); regionTableGroup.setText(tableTitle); roiViewer = new AxisPixelROIEditTable(regionTableGroup, plottingSystem); roiViewer.setIsProfileTable(isProfile); roiViewer.createControl(); // Should be last if (showName) nameText.setText(getDefaultName(regionType.getIndex())); regionName = getDefaultName(regionType.getIndex()); }
protected void setTextInputUIState(TextInputWithSource text, boolean writeText) { TextSourceType sourceType = text.getSourceType(); String textString = text.getText(); btnDatei.setSelection(sourceType.equals(TextSourceType.FILE)); btnJcteditor.setSelection(sourceType.equals(TextSourceType.JCTEDITOR)); btnZwischenablageeigeneEingabe.setSelection(sourceType.equals(TextSourceType.USERINPUT)); if (writeText) { if (textInput != null) { textOnlyInput.writeContent(textString); textOnlyInput.synchronizeWithUserSide(); } else { txtInputText.setText(textString); } } showLoadFromEditorComponents(sourceType.equals(TextSourceType.JCTEDITOR)); if (sourceType.equals(TextSourceType.JCTEDITOR)) { // TODO: comboEditorInputSelector.select(editorRefs.indexOf(text.editorReference)); } if (sourceType.equals(TextSourceType.FILE)) { showLoadFromFileComponents(sourceType.equals(TextSourceType.FILE), text.file.getName()); // fileTextInput is somewhat the representation of the file // selection wizard UI, so this fits here fileTextInput = text.file; } else { showLoadFromFileComponents(sourceType.equals(TextSourceType.FILE), ""); // $NON-NLS-1$ } txtInputText.setEditable(sourceType.equals(TextSourceType.USERINPUT)); }
protected CellEditor[] getCellEditors() throws ApplicationException { if (cellEditors != null) return cellEditors; if ((gridStyle & IGridViewer.fullEditable) == 0) { String[] columnNames = getColumnNames(); cellEditors = new CellEditor[columnNames.length]; for (int i = 0; i < columnNames.length; i++) { TextCellEditor tce = new TextCellEditor(tableViewer.getTable()); Text text = (Text) tce.getControl(); text.setEditable(false); cellEditors[i] = tce; } } else { List attrib_list = CompositeMapUtil.getArrayAttrs(data); cellEditors = new CellEditor[attrib_list.size()]; int id = 0; for (Iterator it = attrib_list.iterator(); it.hasNext(); ) { Attribute attrib = (Attribute) it.next(); ICellEditor cellEditor = CellEditorFactory.getInstance().createCellEditor(this, attrib, null, null); if (cellEditor != null) { cellEditors[id++] = cellEditor.getCellEditor(); addEditor(attrib.getLocalName(), cellEditor); } else { cellEditors[id++] = new TextCellEditor(tableViewer.getTable()); } } } return cellEditors; }
@Override protected Control createContents(Composite parent) { Composite composite = new Composite(parent, SWT.NULL); composite.setLayout(new GridLayout(2, false)); Label lblCatalogUrl = new Label(composite, SWT.NONE); lblCatalogUrl.setText(Messages.DiscoveryPreferencePage_catalogUrl); Text catalogUrl = new Text(composite, SWT.BORDER); catalogUrl.setEditable(false); catalogUrl.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1)); catalogUrl.setText(MavenDiscovery.PATH); Button btnOpenCatalog = new Button(composite, SWT.NONE); btnOpenCatalog.addSelectionListener( new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { MavenDiscovery.launchWizard(workbench.getModalDialogShellProvider().getShell()); } }); btnOpenCatalog.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1)); btnOpenCatalog.setSize(92, 29); btnOpenCatalog.setText(Messages.DiscoveryPreferencePage_openCatalog); new Label(composite, SWT.NONE); return composite; }
/** * ************************************************************************* Create the dialog * area contents. * * @param parent The base composite of the dialog * @return The resulting contents * ************************************************************************ */ protected Control createDialogArea(Composite parent) { // Main composite of the dialog area ----------------------------------- Composite top = new Composite(parent, SWT.NONE); top.setLayoutData(new GridData(GridData.FILL_BOTH)); top.setLayout(new GridLayout(1, true)); IConfigurationManager cfg = (IConfigurationManager) ServiceManager.get(IConfigurationManager.class); Font codeFont = cfg.getFont(FontKey.MASTERC); Color bcolor = cfg.getGuiColor(GuiColorKey.CONSOLE_BG); Color wcolor = cfg.getGuiColor(GuiColorKey.CONSOLE_FG); // Create the console display m_display = new Text(top, SWT.MULTI | SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL); m_display.setFont(codeFont); m_display.setBackground(bcolor); m_display.setForeground(wcolor); GridData ddata = new GridData(GridData.FILL_BOTH); ddata.minimumHeight = 200; m_display.setLayoutData(ddata); m_display.setText(""); m_display.setEditable(false); // Create the input field m_prompt = new PromptField(top, ""); m_prompt.getContents().setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); m_prompt.getContents().addKeyListener(this); m_prompt.getContents().setFocus(); return parent; }
public void createPartControl(Composite parent) { text = new Text(parent, SWT.MULTI); text.setEditable(false); makeActions(); hookContextMenu(); }
UI(Composite parent) { super(parent, SWT.NONE); GridLayoutFactory.swtDefaults().numColumns(2).applyTo(this); new Label(this, SWT.NONE).setText("First Name:"); new Label(this, SWT.NONE).setText("Last Name"); GridDataFactory gdf = GridDataFactory.swtDefaults().align(SWT.FILL, SWT.FILL).grab(true, false); firstName = new Text(this, SWT.BORDER); gdf.applyTo(firstName); lastName = new Text(this, SWT.BORDER); gdf.applyTo(lastName); gdf = GridDataFactory.swtDefaults().span(2, 1).grab(true, false).align(SWT.FILL, SWT.BEGINNING); Label label = new Label(this, SWT.NONE); label.setText("Formatted Name:"); gdf.applyTo(label); formattedName = new Text(this, SWT.BORDER); formattedName.setEditable(false); gdf.applyTo(formattedName); }
private void createFilePreviewOptionsGroup(Composite parent) { Group theGroup = WidgetFactory.createGroup( parent, getString("filePreviewOptionsGroup"), SWT.NONE, 1, 5); // $NON-NLS-1$ theGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); Label numberLinesInFileLabel = new Label(theGroup, SWT.NONE); numberLinesInFileLabel.setText(getString("numberOfLinesLabel")); // $NON-NLS-1$ numberLinesInFileText = WidgetFactory.createTextField(theGroup, SWT.NONE); numberLinesInFileText.setEditable(false); numberLinesInFileText.setBackground( Display.getCurrent().getSystemColor(SWT.COLOR_WIDGET_LIGHT_SHADOW)); GridData gd = new GridData(); gd.minimumWidth = 50; Label spacer = new Label(theGroup, SWT.NONE); spacer.setText(" "); // $NON-NLS-1$ Label prefixLabel = new Label(theGroup, SWT.NONE); prefixLabel.setText(getString("numberOfPreviewLines")); // $NON-NLS-1$ prefixLabel.setLayoutData(new GridData()); // new GridData(GridData.FILL_HORIZONTAL)); this.numberPreviewLinesText = WidgetFactory.createTextField(theGroup, SWT.NONE); gd = new GridData(); gd.minimumWidth = 50; this.numberPreviewLinesText.setLayoutData(gd); this.numberPreviewLinesText.addModifyListener( new ModifyListener() { @Override public void modifyText(final ModifyEvent event) { if (!synchronizing) { if (!numberPreviewLinesText.getText().isEmpty()) { try { int nLines = Integer.parseInt(numberPreviewLinesText.getText()); if (nLines == 0) { setErrorMessage(getString("numberOfLinesCannotBeNullOrZero")); // $NON-NLS-1$ return; } if (nLines != dataFileInfo.getNumberOfCachedFileLines()) { dataFileInfo.setNumberOfCachedFileLines(nLines); handleInfoChanged(true); } setErrorMessage(null); } catch (NumberFormatException ex) { setErrorMessage( getString( "numberOfLinesMustBeInteger", numberPreviewLinesText.getText())); // $NON-NLS-1$ return; } } else { setErrorMessage(getString("numberOfLinesCannotBeNullOrZero")); // $NON-NLS-1$ return; } } } }); }
@Override protected void setEditable(boolean editable) { if (control.isDisposed() || control == null) { return; } if (isComputeField) { control.setEditable(false); } else { control.setEditable(editable); // Display display = control.getDisplay(); // control.setForeground(editable ? display // .getSystemColor(SWT.COLOR_BLACK) : display // .getSystemColor(SWT.COLOR_GRAY)); } this.isEditable = editable; }
@Override public void createPartControl(Composite parent) { Composite container = new Composite(parent, SWT.NONE); { textField = new Text(container, SWT.BORDER | SWT.READ_ONLY | SWT.V_SCROLL | SWT.MULTI); textField.addMouseListener( new MouseAdapter() { @Override public void mouseDoubleClick(MouseEvent e) { TextEditor editor = (TextEditor) Perspective.getView( PlatformUI.getWorkbench().getActiveWorkbenchWindow(), TextEditor.ID); String selectedText = ((Text) e.widget).getSelectionText(); String textOfTextEditor = editor.getTextField().getText().toLowerCase(); if (textOfTextEditor.contains(selectedText)) { // TODO change this selection with MyItemTree.getPosition int start = textOfTextEditor.indexOf(selectedText); int end = start + selectedText.length(); editor.getTextField().setSelection(start, end); } } }); textField.setEditable(true); textField.setBounds(10, 10, 370, 225); } }
protected Control createDialogArea(Composite parent) { Composite composite = (Composite) super.createDialogArea(parent); GridLayout gridLayout = new GridLayout(); gridLayout.numColumns = 2; composite.setLayout(gridLayout); Work work = (Work) getValue(); Label nameLabel = new Label(composite, SWT.NONE); nameLabel.setText("Name: "); Text nameText = new Text(composite, SWT.NONE); nameText.setEditable(false); GridData gridData = new GridData(); gridData.grabExcessHorizontalSpace = true; gridData.horizontalAlignment = GridData.FILL; nameText.setLayoutData(gridData); String name = work.getName(); nameText.setText(name == null ? "" : name); Set<ParameterDefinition> parameters = workDefinition.getParameters(); for (ParameterDefinition param : parameters) { Label label = new Label(composite, SWT.NONE); label.setText(param.getName() + ": "); Text text = new Text(composite, SWT.NONE); gridData = new GridData(); gridData.grabExcessHorizontalSpace = true; gridData.horizontalAlignment = GridData.FILL; text.setLayoutData(gridData); texts.put(param.getName(), text); Object value = work.getParameter(param.getName()); text.setText(value == null ? "" : value.toString()); } return composite; }
private void showHideTexts() { if (passwordText != null && !passwordText.isDisposed()) { boolean enablePasswordField = false; if (connection != null) { IRepositoryFactory factory = RepositoryFactoryProvider.getRepositoriyById(connection.getRepositoryId()); if (factory != null && factory.isAuthenticationNeeded()) { enablePasswordField = true; } } else if (getRepository() != null && RepositoryConstants.REPOSITORY_REMOTE_ID.equals(getRepository().getId())) { enablePasswordField = true; } if (enablePasswordField) { passwordText.setBackground(LoginDialogV2.WHITE_COLOR); } else { passwordText.setText(""); // $NON-NLS-1$ passwordText.setBackground(LoginDialogV2.GREY_COLOR); } passwordText.setEnabled(enablePasswordField); passwordText.setEditable(enablePasswordField); hideControl(passwordText, !enablePasswordField, false); hideControl(passwordLabel, !enablePasswordField, false); passwordText.getParent().layout(); } }
protected Control createContents(Composite parent) { ViewForm form = new ViewForm(parent, SWT.NONE); form.setSize(400, 290); final Composite shell = new Composite(form.getShell(), SWT.NONE); Label lbApp1 = new Label(shell, SWT.NONE); lbApp1.setText("Version:"); lbApp1.setBounds(10, 10, 50, 20); controls.add(lbApp1); Label lbApp2 = new Label(shell, SWT.NONE); lbApp2.setText("noti-J 1.0"); lbApp2.setBounds(UIUtils.getBoundsH(lbApp1, 10, 100)); controls.add(lbApp2); Label lbStatus1 = new Label(shell, SWT.NONE); lbStatus1.setText("State:"); lbStatus1.setBounds(UIUtils.getBoundsV(lbApp1, 10)); controls.add(lbStatus1); Label lbStatus2 = new Label(shell, SWT.NONE); lbStatus2.setText(connected ? "connected" : "disconnect"); lbStatus2.setForeground( Display.getDefault().getSystemColor(connected ? SWT.COLOR_BLUE : SWT.COLOR_RED)); lbStatus2.setBounds(UIUtils.getBoundsV(lbApp2, 10)); controls.add(lbStatus2); Label lbUser1 = new Label(shell, SWT.NONE); lbUser1.setText("Account:"); lbUser1.setBounds(UIUtils.getBoundsV(lbStatus1, 10)); controls.add(lbUser1); Label lbUser2 = new Label(shell, SWT.NONE); lbUser2.setText(userid + "(" + userName + ")"); lbUser2.setBounds(UIUtils.getBoundsV(lbStatus2, 10)); controls.add(lbUser2); Label lbLic1 = new Label(shell, SWT.NONE); lbLic1.setText("License:"); lbLic1.setBounds(UIUtils.getBoundsV(lbUser1, 10)); controls.add(lbLic1); Label lbLic2 = new Label(shell, SWT.NONE); lbLic2.setText("GPL 3.0"); lbLic2.setBounds(UIUtils.getBoundsV(lbUser2, 10)); controls.add(lbLic2); Label lbDev1 = new Label(shell, SWT.NONE); lbDev1.setText("Author:"); lbDev1.setBounds(UIUtils.getBoundsV(lbLic1, 10)); controls.add(lbDev1); Label lbDev2 = new Label(shell, SWT.NONE); lbDev2.setText("Jong-Bok,Park([email protected])"); lbDev2.setBounds(UIUtils.getBoundsV(lbLic2, 10, 300)); controls.add(lbDev2); Text txError = new Text(shell, SWT.NONE | SWT.WRAP); txError.setText(errorMsg == null ? "" : errorMsg); txError.setBounds(UIUtils.getBoundsV(lbDev1, 10, 300, 100)); txError.setEditable(false); controls.add(txError); controls.add(form); return form; }
private void createContents() { TabFolder tabFolder = new TabFolder(this, SWT.NONE); tabFolder.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); CommonSelectorComposite commonCompositeRef = new CommonSelectorComposite(tabFolder, SWT.NONE, false, true); commonCompositeRef.getTreeViewer().getTree().setLinesVisible(false); commonCompositeRef.getTreeViewer().getTree().setHeaderVisible(false); commonCompositeRef.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); commonCompositeRef.setDataSet(this.dataset); commonCompositeRef.getTreeViewer().expandAll(); TabItem tabItem1 = new TabItem(tabFolder, SWT.NONE); tabItem1.setText("Ref"); tabItem1.setControl(commonCompositeRef); if (hasLabel) { CommonSelectorComposite commonCompositeLabel = new CommonSelectorComposite(tabFolder, SWT.NONE, false, true); commonCompositeLabel.getTreeViewer().getTree().setLinesVisible(false); commonCompositeLabel.getTreeViewer().getTree().setHeaderVisible(false); commonCompositeLabel.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); commonCompositeLabel.setDataSet(this.dataset); commonCompositeLabel.getTreeViewer().expandAll(); TabItem tabItem2 = new TabItem(tabFolder, SWT.NONE); tabItem2.setText("Label"); tabItem2.setControl(commonCompositeLabel); } tabFolder.addSelectionListener( new SelectionListener() { public void widgetDefaultSelected(SelectionEvent event) { selectedRef = "Ref".equals(((TabItem) event.item).getText()); } public void widgetSelected(SelectionEvent event) { selectedRef = "Ref".equals(((TabItem) event.item).getText()); } }); Composite composite = new Composite(this, SWT.NONE); GridData gd_composite = new GridData(SWT.FILL, SWT.FILL, true, false); composite.setLayoutData(gd_composite); GridLayout gridLayout = new GridLayout(); gridLayout.numColumns = 2; gridLayout.marginWidth = 0; gridLayout.marginHeight = 0; composite.setLayout(gridLayout); Label label = new Label(composite, SWT.NONE); label.setText("属性值"); displayText = new Text(composite, SWT.BORDER); displayText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false)); displayText.setEditable(false); displayText.setBackground(displayText.getParent().getBackground()); displayText.setText(this.propertyItem.getValue()); }
/** * Action called as the release version button is pressed * * @param e the selection event that triggers this behavior */ private void customVersionButtonPressed() { devVersionButton.setSelection(false); releaseVersionButton.setSelection(false); majorReleaseVersionButton.setSelection(false); customVersionButton.setSelection(true); newVersionValue = customReleaseVersionValue; customVersionText.setEditable(true); }
@Override public void createControl(Composite parent) { mComposite = new Composite(parent, SWT.NONE); GridLayout layout = new GridLayout(2, false); layout.marginWidth = layout.marginHeight = 0; mComposite.setLayout(layout); GridDataFactory.fillDefaults().grab(true, true).applyTo(mComposite); Label l = new Label(mComposite, SWT.NONE); l.setText("Size: "); GridDataFactory.fillDefaults().align(SWT.RIGHT, SWT.CENTER).applyTo(l); mSizeLabel = new Label(mComposite, SWT.NONE); GridDataFactory.fillDefaults().grab(true, false).applyTo(mSizeLabel); l = new Label(mComposite, SWT.NONE); l.setText("Usage: "); GridDataFactory.fillDefaults().align(SWT.RIGHT, SWT.CENTER).applyTo(l); mUsageLabel = new Label(mComposite, SWT.NONE); GridDataFactory.fillDefaults().grab(true, false).applyTo(mUsageLabel); l = new Label(mComposite, SWT.NONE); l.setText("Type: "); GridDataFactory.fillDefaults().align(SWT.RIGHT, SWT.CENTER).applyTo(l); mTypeLabel = new Label(mComposite, SWT.NONE); GridDataFactory.fillDefaults().grab(true, false).applyTo(mTypeLabel); l = new Label(mComposite, SWT.NONE); l.setText("Format Data As: "); GridDataFactory.fillDefaults().align(SWT.RIGHT, SWT.CENTER).applyTo(l); DisplayFormat[] values = DisplayFormat.values(); List<String> formats = new ArrayList<String>(values.length); for (DisplayFormat format : values) { formats.add(format.name()); } mDisplayFormatCombo = new Combo(mComposite, SWT.DROP_DOWN | SWT.READ_ONLY); mDisplayFormatCombo.setItems(formats.toArray(new String[formats.size()])); mDisplayFormatCombo.select(0); mDisplayFormatCombo.addSelectionListener( new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { updateContents(); } }); GridDataFactory.fillDefaults().grab(true, false).applyTo(mDisplayFormatCombo); mTextControl = new Text( mComposite, SWT.BORDER | SWT.READ_ONLY | SWT.MULTI | SWT.WRAP | SWT.V_SCROLL | SWT.H_SCROLL); GridDataFactory.fillDefaults().span(2, 1).grab(true, true).applyTo(mTextControl); mTextControl.setEditable(false); }
/** * Create contents of the wizard. * * @param parent the parent */ public void createControl(Composite parent) { Composite container = new Composite(parent, SWT.NULL); setControl(container); container.setLayout(new GridLayout(3, false)); lblProjectName = new Label(container, SWT.NONE); lblProjectName.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1)); lblProjectName.setText("Project"); txtProjectName = new Text(container, SWT.BORDER); txtProjectName.setBackground(SWTResourceManager.getColor(SWT.COLOR_WHITE)); txtProjectName.setEnabled(false); txtProjectName.setEditable(false); txtProjectName.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1)); btnBrowse = new Button(container, SWT.NONE); btnBrowse.addSelectionListener( new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { ContainerSelectionDialog csd = new ContainerSelectionDialog( getShell(), ResourcesPlugin.getWorkspace().getRoot(), false, "Select a project"); int response = csd.open(); if (response == ContainerSelectionDialog.CANCEL) { return; } pathToProject = (IPath) csd.getResult()[0]; txtProjectName.setText(pathToProject.toOSString()); } }); btnBrowse.setText("Browse..."); lblFileName = new Label(container, SWT.NONE); lblFileName.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1)); lblFileName.setText("File Name"); txtFileName = new Text(container, SWT.BORDER); txtFileName.addModifyListener( new ModifyListener() { public void modifyText(ModifyEvent e) { validateFileName(); } }); txtFileName.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1)); new Label(container, SWT.NONE); if (pathToProject != null) { txtProjectName.setText(pathToProject.toOSString()); } }
/** Creates text area for displaying application environment info */ private void createTextEnvironment() { textEnvironment = new Text(shell, SWT.MULTI | SWT.WRAP | SWT.V_SCROLL | SWT.BORDER); textEnvironment.setFont(SharedStyle.FONT_FIXED); textEnvironment.setText(Version.getEnvironmentReport()); textEnvironment.setEditable(false); final FormData layout = SharedStyle.relativeTo(labelEnvironment, null, buttonClose, null); layout.width = 500; layout.height = 150; textEnvironment.setLayoutData(layout); }
public static Text getStatusAtivo(Composite compositeStatus) { if (txtStatus == null) { txtStatus = new Text(compositeStatus, SWT.BORDER); txtStatus.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1)); txtStatus.setEditable(false); txtStatus.setText("Barra de Status!"); // txtStatus.setMessage("Barra de Status"); } return txtStatus; }
private Text createSelectedTypeText(final Composite c) { final Text t = new Text(c, SWT.SINGLE | SWT.BORDER); t.setEnabled(false); t.setEditable(false); t.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); return t; }