/** * This method initializes hyperLinkShell. * * @wbp.parser.entryPoint */ protected void createHyperLinkShell() { GridData gridData9 = new GridData(); gridData9.grabExcessHorizontalSpace = true; gridData9.verticalAlignment = GridData.FILL; gridData9.horizontalSpan = 2; gridData9.horizontalAlignment = GridData.FILL; GridData gridData8 = new GridData(); gridData8.horizontalAlignment = GridData.FILL; gridData8.grabExcessHorizontalSpace = true; gridData8.horizontalSpan = 2; gridData8.verticalAlignment = GridData.FILL; GridLayout gridLayout2 = new GridLayout(); gridLayout2.numColumns = 14; gridLayout2.makeColumnsEqualWidth = true; // this line has to be commented in order to open with VISUAL EDITOR hyperLinkShell = new Shell(PlatformUI.getWorkbench().getDisplay().getActiveShell()); // hyperLinkShell = new Shell(); hyperLinkShell.setText(Messages.AbstractHyperLinkManagerShell_HyperLink); hyperLinkShell.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WHITE)); createCTabFolder(); hyperLinkShell.setLayout(gridLayout2); hyperLinkShell.setSize(new Point(687, 308)); OkButton = new Button(hyperLinkShell, SWT.NONE); OkButton.setText(Messages.AbstractHyperLinkManagerShell_OK); OkButton.setLayoutData(gridData9); cancelButton = new Button(hyperLinkShell, SWT.NONE); cancelButton.setText(Messages.AbstractHyperLinkManagerShell_Cancel); cancelButton.setLayoutData(gridData8); }
/** This method initializes parametersGroup */ private void createParametersGroup(Composite parent) { GridData gridData7 = new GridData(); gridData7.grabExcessHorizontalSpace = true; gridData7.verticalAlignment = GridData.FILL; gridData7.grabExcessVerticalSpace = true; gridData7.horizontalAlignment = GridData.FILL; GridData gridData6 = new GridData(); gridData6.horizontalAlignment = GridData.FILL; gridData6.grabExcessHorizontalSpace = true; gridData6.grabExcessVerticalSpace = true; gridData6.verticalAlignment = GridData.FILL; // GridData gridData8 = new GridData(); // gridData8.horizontalAlignment = GridData.FILL; // gridData8.grabExcessHorizontalSpace = true; // gridData8.grabExcessVerticalSpace = true; // gridData8.verticalAlignment = GridData.FILL; GridData gridData5 = new GridData(); gridData5.horizontalAlignment = GridData.FILL; gridData5.grabExcessHorizontalSpace = true; parametersGroup = new Group(parent, SWT.NONE); parametersGroup.setLayout(new GridLayout()); parametersGroup.setLayoutData(gridData5); parametersGroup.setText(Messages.AlgorithmIntroductionPage_1); defaultRadioButton = new Button(parametersGroup, SWT.RADIO); defaultRadioButton.setText(Messages.AlgorithmIntroductionPage_2); defaultRadioButton.setLayoutData(gridData6); // if (paramGenExists) { // generateRadioButton = new Button(parametersGroup, SWT.RADIO); // generateRadioButton.setText("Generate parameters"); // generateRadioButton.setLayoutData(gridData8); // } customRadioButton = new Button(parametersGroup, SWT.RADIO); customRadioButton.setText(Messages.AlgorithmIntroductionPage_3); customRadioButton.setLayoutData(gridData7); }
@Override public void createPartControl(Composite parent) { { GridLayout parentLayout = new GridLayout(); parentLayout.makeColumnsEqualWidth = true; parent.setLayout(parentLayout); parent.setSize(557, 321); { composite1 = new Composite(parent, SWT.NONE); GridLayout composite1Layout = new GridLayout(); composite1Layout.makeColumnsEqualWidth = true; GridData composite1LData = new GridData(); composite1LData.grabExcessHorizontalSpace = true; composite1LData.horizontalAlignment = GridData.FILL; composite1LData.verticalAlignment = GridData.FILL; composite1.setLayoutData(composite1LData); composite1.setLayout(composite1Layout); { statusLbl = new Label(composite1, SWT.NONE); GridData statusLblLData = new GridData(); statusLblLData.grabExcessHorizontalSpace = true; statusLblLData.horizontalAlignment = GridData.FILL; statusLbl.setLayoutData(statusLblLData); statusLbl.setText("sdfsdfsdf"); } } { group1 = new Group(parent, SWT.NONE); GridLayout group1Layout = new GridLayout(); group1Layout.makeColumnsEqualWidth = true; group1.setLayout(group1Layout); GridData group1LData = new GridData(); group1LData.verticalAlignment = GridData.FILL; group1LData.horizontalAlignment = GridData.FILL; group1LData.grabExcessHorizontalSpace = true; group1LData.grabExcessVerticalSpace = true; group1.setLayoutData(group1LData); group1.setText("Notes"); { notesTxt = new Text(group1, SWT.MULTI | SWT.WRAP | SWT.BORDER); GridData text1LData = new GridData(); text1LData.grabExcessHorizontalSpace = true; text1LData.horizontalAlignment = GridData.FILL; text1LData.verticalAlignment = GridData.FILL; text1LData.grabExcessVerticalSpace = true; notesTxt.setLayoutData(text1LData); } } { archiveBtn = new Button(parent, SWT.PUSH | SWT.CENTER); GridData button1LData = new GridData(); button1LData.horizontalAlignment = GridData.FILL; button1LData.grabExcessHorizontalSpace = true; archiveBtn.setLayoutData(button1LData); archiveBtn.setText("Archive"); } } new KController(this); }
/** This method initializes lookforShell. */ protected void createLookforShell() { GridData gridData2 = new GridData(); gridData2.horizontalAlignment = GridData.FILL; gridData2.verticalAlignment = GridData.CENTER; GridData gridData1 = new GridData(); gridData1.grabExcessHorizontalSpace = false; gridData1.horizontalAlignment = GridData.FILL; gridData1.verticalAlignment = GridData.CENTER; gridData1.grabExcessVerticalSpace = false; GridLayout gridLayout1 = new GridLayout(); gridLayout1.numColumns = 5; gridLayout1.makeColumnsEqualWidth = true; // this line has to be commented in order to open with VISUAL EDITOR lookforShell = new Shell(PlatformUI.getWorkbench().getDisplay().getActiveShell()); // lookforShell = new Shell(); lookforShell.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WHITE)); createCTabFolder(); lookforShell.setLayout(gridLayout1); lookforShell.setSize(new Point(501, 313)); new Label(lookforShell, SWT.NONE); new Label(lookforShell, SWT.NONE); new Label(lookforShell, SWT.NONE); OKbutton = new Button(lookforShell, SWT.NONE); OKbutton.setText(Messages.AbstractLookForEditorShell_OK); OKbutton.setLayoutData(gridData1); OKbutton.setEnabled(false); cancelbutton = new Button(lookforShell, SWT.NONE); cancelbutton.setText(Messages.AbstractLookForEditorShell_Cancel); cancelbutton.setLayoutData(gridData2); }
/** This method initializes transpositionGroup */ private void createTranspositionGroup(Composite parent) { GridData transpositionKeyTextGridData = new GridData(); transpositionKeyTextGridData.horizontalAlignment = GridData.FILL; transpositionKeyTextGridData.grabExcessHorizontalSpace = true; transpositionKeyTextGridData.verticalAlignment = GridData.CENTER; GridData transpositionDescriptionLabelGridData = new GridData(); transpositionDescriptionLabelGridData.grabExcessHorizontalSpace = false; transpositionDescriptionLabelGridData.horizontalAlignment = GridData.BEGINNING; transpositionDescriptionLabelGridData.verticalAlignment = GridData.CENTER; transpositionDescriptionLabelGridData.grabExcessVerticalSpace = true; GridLayout transpositionGroupGridLayout = new GridLayout(); transpositionGroupGridLayout.numColumns = 2; GridData transpositionGroupGridData = new GridData(); transpositionGroupGridData.grabExcessHorizontalSpace = true; transpositionGroupGridData.horizontalAlignment = GridData.FILL; transpositionGroupGridData.verticalAlignment = GridData.FILL; transpositionGroupGridData.grabExcessVerticalSpace = true; transpositionGroup = new Group(parent, SWT.NONE); transpositionGroup.setLayoutData(transpositionGroupGridData); transpositionGroup.setLayout(transpositionGroupGridLayout); transpositionGroup.setText(Messages.AdfgvxWizardPage_step2); transpositionDescriptionLabel = new Label(transpositionGroup, SWT.NONE); transpositionDescriptionLabel.setText(Messages.AdfgvxWizardPage_enterTranspKey); transpositionDescriptionLabel.setLayoutData(transpositionDescriptionLabelGridData); transpositionKeyText = new Text(transpositionGroup, SWT.BORDER); transpositionKeyText.setLayoutData(transpositionKeyTextGridData); transpositionKeyText.setToolTipText(Messages.AdfgvxWizardPage_transpositionHint); }
/** * Creates composite for project name. * * @param container */ private void createProjNameComposite(Composite container) { Composite containerProjName = new Composite(container, SWT.NONE); GridLayout gridLayout = new GridLayout(); gridLayout.numColumns = 2; GridData gridData = new GridData(); gridData.horizontalAlignment = SWT.FILL; gridData.grabExcessHorizontalSpace = true; containerProjName.setLayout(gridLayout); containerProjName.setLayoutData(gridData); Label lblProjName = new Label(containerProjName, SWT.LEFT); lblProjName.setText(Messages.wizPageProjName); textProjName = new Text(containerProjName, SWT.SINGLE | SWT.BORDER); gridData = new GridData(); gridData.widthHint = 330; gridData.horizontalAlignment = SWT.FILL; gridData.grabExcessHorizontalSpace = true; textProjName.setLayoutData(gridData); textProjName.addModifyListener( new ModifyListener() { @Override public void modifyText(ModifyEvent event) { handleModifyText(event); } }); }
@Override protected void createButtonsForButtonBar(Composite parent) { configureButtonCompositeLayout(parent); GridData layoutData = new GridData(390, 130); layoutData.horizontalAlignment = SWT.CENTER; layoutData.verticalAlignment = SWT.TOP; layoutData.grabExcessHorizontalSpace = true; parent.setLayoutData(layoutData); layoutData = new GridData(); layoutData.widthHint = 70; layoutData.horizontalAlignment = SWT.RIGHT; layoutData.grabExcessHorizontalSpace = true; Button cancelButton = createButton(parent, IDialogConstants.CANCEL_ID, "&Cancel", false); cancelButton.setLayoutData(layoutData); layoutData = new GridData(); layoutData.widthHint = 70; layoutData.horizontalAlignment = SWT.LEFT; layoutData.grabExcessHorizontalSpace = true; okButton = createButton(parent, IDialogConstants.OK_ID, "&Login", true); okButton.setLayoutData(layoutData); setupDataBinding(); }
/** This method initializes keyWordGroup. */ private void createKeyWordGroup() { GridData keyWordTextGridData = new GridData(); keyWordTextGridData.grabExcessHorizontalSpace = true; keyWordTextGridData.verticalAlignment = GridData.CENTER; keyWordTextGridData.horizontalAlignment = GridData.FILL; GridData keyWordDescriptionLabelGridData = new GridData(); keyWordDescriptionLabelGridData.horizontalAlignment = GridData.FILL; keyWordDescriptionLabelGridData.grabExcessHorizontalSpace = false; keyWordDescriptionLabelGridData.grabExcessVerticalSpace = true; keyWordDescriptionLabelGridData.verticalAlignment = GridData.CENTER; GridLayout keyWordGroupGridLayout = new GridLayout(); keyWordGroupGridLayout.numColumns = 2; GridData keyWordGroupGridData = new GridData(); keyWordGroupGridData.horizontalAlignment = GridData.FILL; keyWordGroupGridData.grabExcessHorizontalSpace = true; keyWordGroupGridData.grabExcessVerticalSpace = true; keyWordGroupGridData.verticalAlignment = GridData.FILL; keyWordGroup = new Composite(substititionGroup, SWT.NONE); keyWordGroup.setLayoutData(keyWordGroupGridData); keyWordGroup.setLayout(keyWordGroupGridLayout); // keyWordGroup.setText(Messages.AdfgvxWizardPage_keyword); keyWordDescriptionLabel = new Label(keyWordGroup, SWT.NONE); keyWordDescriptionLabel.setText(Messages.AdfgvxWizardPage_enterkeyword); keyWordDescriptionLabel.setLayoutData(keyWordDescriptionLabelGridData); keyWordText = new Text(keyWordGroup, SWT.BORDER); keyWordText.setLayoutData(keyWordTextGridData); keyWordText.setToolTipText(Messages.AdfgvxWizardPage_substitutionHint); }
/** * 创建文件类型列表 * * @param title * @param composite * @return ; */ private ComboViewer createConvertControl(String title, Composite composite) { Label positiveConvertLabel = new Label(composite, SWT.NONE); GridData positiveConvertLabelData = new GridData(); positiveConvertLabelData.horizontalSpan = 2; positiveConvertLabelData.horizontalAlignment = SWT.CENTER; positiveConvertLabelData.grabExcessHorizontalSpace = true; positiveConvertLabel.setLayoutData(positiveConvertLabelData); positiveConvertLabel.setText(title); Label suportFormat = new Label(composite, SWT.NONE); suportFormat.setText("Suport Format"); ComboViewer supportList = new ComboViewer(composite, SWT.READ_ONLY); GridData gridData = new GridData(); gridData.horizontalAlignment = SWT.FILL; gridData.grabExcessHorizontalSpace = true; supportList.getCombo().setLayoutData(gridData); supportList.addSelectionChangedListener( new ISelectionChangedListener() { public void selectionChanged(SelectionChangedEvent event) { ISelection selection = event.getSelection(); if (selection.isEmpty()) { okButton.setEnabled(false); } else { okButton.setEnabled(true); } } }); return supportList; }
private void createRightButtonsPane(final Composite contents) { final Composite buttonsComposite = new Composite(contents, SWT.NONE); final GridData buttonsCompositeGridData = new GridData(); buttonsCompositeGridData.verticalAlignment = SWT.FILL; buttonsCompositeGridData.horizontalAlignment = SWT.FILL; buttonsComposite.setLayoutData(buttonsCompositeGridData); buttonsComposite.setLayout(new GridLayout()); // spacer spacer(buttonsComposite); this.upButton = new Button(buttonsComposite, SWT.PUSH); this.upButton.setText(Messages.LoadCustomizationsDialog_Up); final GridData upButtonGridData = new GridData(); upButtonGridData.verticalAlignment = SWT.FILL; upButtonGridData.horizontalAlignment = SWT.FILL; this.upButton.setLayoutData(upButtonGridData); this.downButton = new Button(buttonsComposite, SWT.PUSH); this.downButton.setText(Messages.LoadCustomizationsDialog_Down); final GridData downButtonGridData = new GridData(); downButtonGridData.verticalAlignment = SWT.FILL; downButtonGridData.horizontalAlignment = SWT.FILL; this.downButton.setLayoutData(downButtonGridData); }
private void addXslGroup(Composite parent) { Group group = new Group(parent, SWT.NONE); group.setText(Messages.CoProc2LaunchConfigurationMainTab_StylesheetGroupName); GridLayout layout = new GridLayout(); layout.numColumns = 3; group.setLayout(layout); GridData gd = new GridData(); gd.grabExcessHorizontalSpace = true; gd.horizontalAlignment = SWT.FILL; group.setLayoutData(gd); Label label = new Label(group, SWT.NONE); label.setText(Messages.CoProc2LaunchConfigurationMainTab_FileField + ':'); xslFileText = new Text(group, SWT.BORDER); gd = new GridData(); gd.horizontalAlignment = SWT.FILL; gd.grabExcessHorizontalSpace = true; xslFileText.setLayoutData(gd); xslFileText.addModifyListener(modifyListener); browseXslButton = new Button(group, SWT.PUSH); browseXslButton.setText(Messages.CoProc2LaunchConfigurationMainTab_BrowseButton); browseXslButton.addSelectionListener( new SelectionAdapter() { public void widgetSelected(SelectionEvent evt) { String[] extensions = new String[] {"*.xsl", "*.xslt"}; // $NON-NLS-1$ //$NON-NLS-2$ String fileName = browseForSourceFile(extensions); if (fileName != null) { xslFileText.setText(fileName); } } }); }
public FilterAdvancedComposite( final FilterChangedListener filterChangedListener, final Composite parent, final int style) { // fields super(parent, style); // widgets this.tabFolder = new CTabFolder(this, SWT.TOP | SWT.BORDER | SWT.CLOSE); this.addOrConditionButton = creteAddOrConditionButton(); addOrCondition(); // layout final GridLayout layout = new GridLayout(1, true); layout.marginLeft = 6; layout.marginRight = 6; layout.marginTop = 6; layout.marginBottom = 6; layout.verticalSpacing = 12; this.setLayout(layout); final GridData tabFolderLayoutData = new GridData(); tabFolderLayoutData.horizontalAlignment = GridData.FILL; tabFolderLayoutData.grabExcessHorizontalSpace = true; tabFolderLayoutData.verticalAlignment = GridData.FILL; tabFolderLayoutData.grabExcessVerticalSpace = true; this.tabFolder.setLayoutData(tabFolderLayoutData); this.tabFolder.setBackgroundMode(SWT.INHERIT_FORCE); final GridData addOrConditionButtonLayoutdata = new GridData(); addOrConditionButtonLayoutdata.horizontalAlignment = GridData.END; this.addOrConditionButton.setLayoutData(addOrConditionButtonLayoutdata); }
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 initGUI() { radioGroup = new Listener() { @Override public void handleEvent(Event event) { Button b = (Button) event.widget; if (b.getSelection() == false) { b.setSelection(true); } else { if (event.widget == btnColumnar) { btnRowwise.setSelection(!btnColumnar.getSelection()); } else { btnColumnar.setSelection(!btnRowwise.getSelection()); } input.synchronizeWithUserSide(); } } }; try { GridLayout thisLayout = new GridLayout(); thisLayout.marginWidth = 0; thisLayout.marginHeight = 0; thisLayout.numColumns = 2; thisLayout.horizontalSpacing = 0; thisLayout.makeColumnsEqualWidth = true; this.setLayout(thisLayout); { btnColumnar = new Button(this, SWT.TOGGLE | SWT.FLAT | SWT.CENTER); GridData btnColumnarLData = new GridData(); btnColumnarLData.grabExcessHorizontalSpace = true; btnColumnarLData.horizontalAlignment = GridData.FILL; btnColumnarLData.verticalAlignment = GridData.FILL; btnColumnarLData.heightHint = HEIGHT_NORMAL; if (flat) btnColumnarLData.heightHint = HEIGHT_FLAT; btnColumnar.setLayoutData(btnColumnarLData); btnColumnar.setText(Messages.ReadDirectionChooser_0); btnColumnar.addListener(SWT.Selection, radioGroup); } { btnRowwise = new Button(this, SWT.TOGGLE | SWT.FLAT | SWT.CENTER); GridData btnRowwiseLData = new GridData(); btnRowwiseLData.grabExcessHorizontalSpace = true; btnRowwiseLData.horizontalAlignment = GridData.FILL; btnRowwiseLData.verticalAlignment = GridData.FILL; btnRowwiseLData.heightHint = HEIGHT_NORMAL; if (flat) btnRowwiseLData.heightHint = HEIGHT_FLAT; btnRowwise.setLayoutData(btnRowwiseLData); btnRowwise.setText(Messages.ReadDirectionChooser_1); btnRowwise.addListener(SWT.Selection, radioGroup); } this.layout(); } catch (Exception e) { LogUtil.logError(e); } initInput(); }
private void createDestinationGroup(Composite parent) { GridData gd; Font font = parent.getFont(); // destination specification group Composite destinationSelectionGroup = new Composite(parent, SWT.NONE); destinationSelectionGroup.setLayout(new GridLayout(2, false)); destinationSelectionGroup.setLayoutData( new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_FILL)); destinationSelectionGroup.setFont(font); Label destinationLabel = new Label(destinationSelectionGroup, SWT.NONE); destinationLabel.setText(Messages.TeamProjectIndexExportWizardPage_destinationLabel); destinationLabel.setFont(font); destinationLabel.setLayoutData(gd = new GridData()); gd.horizontalSpan = 2; // destination name entry field fDestinationField = new Text(destinationSelectionGroup, SWT.BORDER); fDestinationField.addListener(SWT.Modify, this); fDestinationField.addListener(SWT.Selection, this); fDestinationField.setFont(font); fDestinationField.setLayoutData(gd = new GridData()); gd.grabExcessHorizontalSpace = true; gd.horizontalAlignment = GridData.FILL; gd.widthHint = SIZING_TEXT_FIELD_WIDTH; Button button = createButton( destinationSelectionGroup, IDialogConstants.CLIENT_ID, Messages.TeamProjectIndexExportWizardPage_variableButton, false); SelectionAdapter listener = new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { onInsertVariable(); } }; button.addSelectionListener(listener); // resource snapshot destination group Composite resourceSnapshotDestinationGroup = new Composite(parent, SWT.NONE); resourceSnapshotDestinationGroup.setLayout(new GridLayout(1, false)); resourceSnapshotDestinationGroup.setLayoutData( new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_FILL)); resourceSnapshotDestinationGroup.setFont(font); fResourceSnapshotButton = new Button(resourceSnapshotDestinationGroup, SWT.CHECK); fResourceSnapshotButton.setText( Messages.TeamProjectIndexExportWizardPage_resourceSnapshotButton); fResourceSnapshotButton.setFont(font); fResourceSnapshotButton.setLayoutData(gd = new GridData()); gd.grabExcessHorizontalSpace = true; gd.horizontalAlignment = GridData.FILL; }
private void createLeftPane(final Composite contents) { final Composite choiceComposite = new Composite(contents, SWT.NONE); final GridData data = new GridData(SWT.FILL, SWT.FILL, true, true); data.horizontalAlignment = SWT.END; choiceComposite.setLayoutData(data); final GridLayout layout = new GridLayout(); data.horizontalAlignment = SWT.FILL; layout.marginHeight = 0; layout.marginWidth = 0; layout.numColumns = 1; choiceComposite.setLayout(layout); final Label choiceLabel = new Label(choiceComposite, SWT.NONE); choiceLabel.setText(Messages.LoadCustomizationsDialog_AvailiableCustom); final GridData choiceLabelGridData = new GridData(); choiceLabelGridData.verticalAlignment = SWT.FILL; choiceLabelGridData.horizontalAlignment = SWT.FILL; choiceLabel.setLayoutData(choiceLabelGridData); final Text patternText = createFilterText(choiceComposite); final Tree availableCustomizationsTree = new Tree(choiceComposite, SWT.MULTI | SWT.BORDER); final GridData availableCustomizationsGridData = new GridData(); availableCustomizationsGridData.widthHint = LoadCustomizationsDialog.TREE_WIDTH; availableCustomizationsGridData.heightHint = LoadCustomizationsDialog.TREE_HEIGHT; availableCustomizationsGridData.horizontalAlignment = SWT.FILL; availableCustomizationsGridData.verticalAlignment = SWT.FILL; availableCustomizationsGridData.grabExcessHorizontalSpace = true; availableCustomizationsGridData.grabExcessVerticalSpace = true; availableCustomizationsTree.setLayoutData(availableCustomizationsGridData); this.availableCustomizationsTreeViewer = new TreeViewer(availableCustomizationsTree); this.availableCustomizationsTreeViewer.setContentProvider(this.contentProvider); this.availableCustomizationsTreeViewer.setLabelProvider(this.labelProvider); final PatternFilter filter = new PatternFilter(); this.availableCustomizationsTreeViewer.addFilter(filter); this.availableCustomizationsTreeViewer.setInput(this.availableCustoms); // TODO Remove before to commit // final TreeItem treeItem = new TreeItem(availableCustomizationsTree, SWT.NONE); // treeItem.setText(Messages.LoadCustomizationsDialog_Loading); // TODO (end) Remove before to commit patternText.addModifyListener( new ModifyListener() { public void modifyText(final ModifyEvent event) { filter.setPattern(patternText.getText()); LoadCustomizationsDialog.this.availableCustomizationsTreeViewer.refresh(); } }); }
private void buildAddRemoveButtons(Composite parent, final TableViewer tableViewer) { Composite buttonComposite = new Composite(parent, SWT.NULL); GridLayout buttonLayout = new GridLayout(1, false); buttonComposite.setLayout(buttonLayout); GridData gridData = new GridData(); gridData.horizontalAlignment = GridData.FILL; gridData.verticalAlignment = GridData.BEGINNING; buttonComposite.setLayoutData(gridData); // Add buttons Button addButton = new Button(buttonComposite, SWT.PUSH); addButton.setText(JptDbwsEclipseLinkUiMessages.JDBC_DRIVER_WIZARD_PAGE__ADD_BUTTON); gridData = new GridData(); gridData.horizontalAlignment = GridData.FILL; gridData.grabExcessHorizontalSpace = true; addButton.setLayoutData(gridData); addButton.addSelectionListener( new SelectionListener() { public void widgetDefaultSelected(SelectionEvent e) {} public void widgetSelected(SelectionEvent e) { ArrayList<String> jarFiles = promptJarFiles(); for (String jarFile : jarFiles) { addJarFile(jarFile); } tableViewer.refresh(); } }); // Remove buttons Button removeButton = new Button(buttonComposite, SWT.PUSH); removeButton.setText(JptDbwsEclipseLinkUiMessages.JDBC_DRIVER_WIZARD_PAGE__REMOVE_BUTTON); gridData = new GridData(); gridData.horizontalAlignment = GridData.FILL; gridData.grabExcessHorizontalSpace = true; removeButton.setLayoutData(gridData); removeButton.addSelectionListener( new SelectionListener() { public void widgetDefaultSelected(SelectionEvent e) {} public void widgetSelected(SelectionEvent e) { StructuredSelection selection = (StructuredSelection) tableViewer.getSelection(); if (selection.isEmpty()) { return; } String jarFile = (String) selection.getFirstElement(); removeJarFile(jarFile); tableViewer.refresh(); } }); addButton.setFocus(); }
private void initialize() { String filename = StringUtils.defaultString(level.getName()); GridData gridDataLabel = new GridData(); gridDataLabel.widthHint = 100; gridDataLabel.verticalAlignment = GridData.CENTER; gridDataLabel.horizontalAlignment = GridData.END; GridData gridDataText = new GridData(); gridDataText.heightHint = -1; gridDataText.widthHint = 150; GridLayout gridLayoutMy = new GridLayout(); gridLayoutMy.numColumns = 2; gridLayoutMy.marginWidth = 25; gridLayoutMy.verticalSpacing = 5; gridLayoutMy.horizontalSpacing = 20; gridLayoutMy.marginHeight = 25; gridLayoutMy.makeColumnsEqualWidth = false; GridData gridDataMy = new GridData(); gridDataMy.grabExcessHorizontalSpace = true; gridDataMy.verticalAlignment = GridData.CENTER; gridDataMy.horizontalSpan = 1; gridDataMy.horizontalAlignment = GridData.FILL; this.setLayoutData(gridDataMy); this.setLayout(gridLayoutMy); Label labelTitle = new Label(this, SWT.RIGHT); labelTitle.setText( "* ".concat(LabelHolder.get("dialog.pojo.level.fields.title"))); // $NON-NLS-1$ labelTitle.setLayoutData(gridDataLabel); textTitle = new Text(this, SWT.BORDER); textTitle.setTextLimit(256); textTitle.setLayoutData(gridDataText); textTitle.setText(StringUtils.defaultString(level.getTitle())); Label labelName = new Label(this, SWT.RIGHT); labelName.setText( "* ".concat(LabelHolder.get("dialog.pojo.level.fields.name"))); // $NON-NLS-1$ labelName.setLayoutData(gridDataLabel); textName = new Text(this, SWT.BORDER); textName.setTextLimit(256); textName.setLayoutData(gridDataText); textName.setText(filename); textName.addVerifyListener(new FileNameVerifier()); textName.addModifyListener(new ModifyListenerClearErrorMessages(dialogCreator)); Collection<String> forbiddenNames = new ArrayList<String>(); Collection<Level> sisters = level.getParent().getSublevels(); if (CollectionUtils.isNotEmpty(sisters)) for (Level otherLevel : sisters) forbiddenNames.add(otherLevel.getName()); if (StringUtils.isNotBlank(filename)) forbiddenNames.remove(filename); if (level.getId() == APoormansObject .UNSET_VALUE) // suggestion of the file name should work just with new objects textTitle.addModifyListener( new FilenameSuggestorListener(dialogCreator, textName, forbiddenNames)); }
public OrCondition( final FilterAdvancedComposite filterAdvancedComposite, final CTabFolder tabFolder) { // fields this.filterAdvancedComposite = filterAdvancedComposite; this.tabItem = new CTabItem(tabFolder, SWT.NULL); this.tabItem.setText(Messages.a_condition); this.tabContent = new Composite(tabFolder, SWT.NONE); this.tabItem.setControl(this.tabContent); // widgets this.addAssertionComposite = new AddAssertionComposite(this, this.tabContent); this.assertionScrolledComposite = new ScrolledComposite(this.tabContent, SWT.V_SCROLL | SWT.NONE); this.assertionComposite = new Composite(this.assertionScrolledComposite, SWT.NONE); this.assertionScrolledComposite.setContent(this.assertionComposite); // layout final GridLayout layout = new GridLayout(); layout.marginLeft = 6; layout.marginRight = 6; layout.marginTop = 6; layout.marginBottom = 6; layout.verticalSpacing = 12; this.tabContent.setLayout(layout); final GridData addAssertionCompositeLayoutData = new GridData(); addAssertionCompositeLayoutData.grabExcessHorizontalSpace = true; addAssertionCompositeLayoutData.horizontalAlignment = GridData.FILL; this.addAssertionComposite.setLayoutData(addAssertionCompositeLayoutData); final GridData assertionCompositeLayoutData = new GridData(); assertionCompositeLayoutData.grabExcessHorizontalSpace = true; assertionCompositeLayoutData.horizontalAlignment = GridData.FILL; assertionCompositeLayoutData.grabExcessVerticalSpace = true; assertionCompositeLayoutData.verticalAlignment = GridData.FILL; this.assertionScrolledComposite.setLayoutData(assertionCompositeLayoutData); this.assertionScrolledComposite.setExpandHorizontal(true); final RowLayout innerlayout = new RowLayout(SWT.VERTICAL); innerlayout.wrap = false; this.assertionComposite.setLayout(innerlayout); this.assertionComposite.addListener( SWT.Resize, new Listener() { public void handleEvent(final org.eclipse.swt.widgets.Event event) { final Point s = OrCondition.this.assertionComposite.computeSize(SWT.DEFAULT, SWT.DEFAULT); OrCondition.this.assertionComposite.setSize(s.x, s.y); refreshGUI(); } }); }
private void addXmlGroup(Composite parent) { Group group = new Group(parent, SWT.NONE); group.setText(Messages.CoProc2LaunchConfigurationMainTab_InputXmlGroupName); GridLayout layout = new GridLayout(); layout.numColumns = 3; group.setLayout(layout); GridData gd = new GridData(); gd.grabExcessHorizontalSpace = true; gd.horizontalAlignment = SWT.FILL; group.setLayoutData(gd); setXmlInputNull = new Button(group, SWT.CHECK); setXmlInputNull.setText(Messages.CoProc2LaunchConfigurationMainTab_SetInputToNullCheckbox); setXmlInputNull.setToolTipText( Messages.CoProc2LaunchConfigurationMainTab_SetInputToNullTooltip); gd = new GridData(); gd.horizontalSpan = 3; setXmlInputNull.setLayoutData(gd); setXmlInputNull.addSelectionListener( new SelectionAdapter() { public void widgetSelected(SelectionEvent evt) { xmlFileText.setEnabled(!setXmlInputNull.getSelection()); browseXmlButton.setEnabled(!setXmlInputNull.getSelection()); setDirty(true); updateLaunchConfigurationDialog(); } }); Label label = new Label(group, SWT.NONE); label.setText(Messages.CoProc2LaunchConfigurationMainTab_FileField + ':'); xmlFileText = new Text(group, SWT.BORDER); gd = new GridData(); gd.grabExcessHorizontalSpace = true; gd.horizontalAlignment = SWT.FILL; xmlFileText.setLayoutData(gd); xmlFileText.addModifyListener(modifyListener); browseXmlButton = new Button(group, SWT.PUSH); browseXmlButton.setText(Messages.CoProc2LaunchConfigurationMainTab_BrowseButton); browseXmlButton.addSelectionListener( new SelectionAdapter() { public void widgetSelected(SelectionEvent evt) { String[] extensions = new String[] {"*.xml"}; // $NON-NLS-1$ String fileName = browseForSourceFile(extensions); if (fileName != null) { xmlFileText.setText(fileName); } } }); }
private void createDefinitionParametersButton(Composite comp, final TableViewer parView) { Composite composite = new Composite(comp, SWT.NONE); GridData gd = new GridData(); gd.horizontalSpan = 2; gd.horizontalAlignment = SWT.CENTER; composite.setLayout(new GridLayout(2, false)); composite.setLayoutData(gd); final Button addButton = new Button(composite, SWT.NONE); addButton.setImage(ImageLib.getImage(ImageLib.ADD_ACTION)); addButton.setToolTipText( DefaultMessagesImpl.getString("PatternMasterDetailsPage.add")); // $NON-NLS-1$ GridData labelGd = new GridData(GridData.HORIZONTAL_ALIGN_CENTER); labelGd.horizontalAlignment = SWT.RIGHT; labelGd.widthHint = 65; addButton.setLayoutData(labelGd); addButton.addListener( SWT.MouseDown, new Listener() { public void handleEvent(Event event) { JavaUDIIndicatorParameter newItem = DomainHelper.createJavaUDIIndicatorParameter( "key", "value"); // $NON-NLS-1$ //$NON-NLS-2$ content.add(newItem); viewer.refresh(); checkFieldsValue(); } }); final Button romveButton = new Button(composite, SWT.NONE); romveButton.setImage(ImageLib.getImage(ImageLib.DELETE_ACTION)); romveButton.setToolTipText( DefaultMessagesImpl.getString("PatternMasterDetailsPage.del")); // $NON-NLS-1$ GridData reGd = new GridData(); reGd.horizontalAlignment = SWT.LEFT; reGd.widthHint = 65; romveButton.setLayoutData(reGd); romveButton.addListener( SWT.MouseDown, new Listener() { public void handleEvent(Event event) { IStructuredSelection selection = (IStructuredSelection) parView.getSelection(); Object o = selection.getFirstElement(); if (o instanceof JavaUDIIndicatorParameter) { content.remove(o); viewer.refresh(content); checkFieldsValue(); } } }); }
private void addUrlGroup(Composite parent) { Group group = new Group(parent, SWT.NONE); group.setText(Messages.CoProc2LaunchConfigurationMainTab_ConnectionGroupName); GridLayout layout = new GridLayout(); layout.numColumns = 4; group.setLayout(layout); GridData gd = new GridData(); gd.horizontalAlignment = SWT.FILL; group.setLayoutData(gd); Label label = new Label(group, SWT.NONE); label.setText(Messages.CoProc2LaunchConfigurationMainTab_HostField + ':'); coprocHostText = new Text(group, SWT.BORDER); gd = new GridData(); gd.horizontalSpan = 3; gd.horizontalAlignment = SWT.FILL; gd.grabExcessHorizontalSpace = true; coprocHostText.setLayoutData(gd); coprocHostText.addModifyListener(modifyListener); label = new Label(group, SWT.NONE); label.setText(Messages.CoProc2LaunchConfigurationMainTab_PortField + ':'); coprocPortText = new Text(group, SWT.BORDER); gd = new GridData(); gd.horizontalAlignment = SWT.FILL; gd.widthHint = 40; coprocPortText.setLayoutData(gd); coprocPortText.addModifyListener(modifyListener); testUrl = new Button(group, SWT.PUSH); testUrl.setText(Messages.CoProc2LaunchConfigurationMainTab_TestConnectionButton); testUrl.addSelectionListener( new SelectionAdapter() { public void widgetSelected(SelectionEvent evt) { statusLabel.setText(Messages.CoProc2LaunchConfigurationMainTab_TestingConnectionStatus); AsyncConnectionTest test = new AsyncConnectionTest( coprocHostText.getText(), coprocPortText.getText(), statusLabel); new Thread(test).start(); } }); statusLabel = new Label(group, SWT.NONE); gd = new GridData(); gd.grabExcessHorizontalSpace = true; gd.horizontalAlignment = SWT.FILL; statusLabel.setLayoutData(gd); statusLabel.setText(Messages.CoProc2LaunchConfigurationMainTab_ConnectionNotTested); }
protected Control createContents(Composite parent) { Composite container = new Composite(parent, SWT.NONE); GridLayout gridLayout = new GridLayout(2, false); container.setLayout(gridLayout); GridData gridData = new GridData(); gridData.widthHint = 200; container.setLayoutData(gridData); Label lblName = new Label(container, SWT.LEFT); gridData = new GridData(); gridData.horizontalIndent = 10; lblName.setLayoutData(gridData); lblName.setText(Messages.adRolName); txtName = new Text(container, SWT.SINGLE | SWT.BORDER); gridData = new GridData(); gridData.horizontalAlignment = GridData.END; gridData.grabExcessHorizontalSpace = true; gridData.widthHint = 75; txtName.setLayoutData(gridData); createEndptTypeComponent(container); createPublicPortComponent(container); Label lblPrivatePort = new Label(container, SWT.LEFT); gridData = new GridData(); gridData.horizontalIndent = 10; lblPrivatePort.setLayoutData(gridData); lblPrivatePort.setText(Messages.adRolPrivatePort); txtPrivatePort = new Text(container, SWT.SINGLE | SWT.BORDER); gridData = new GridData(); gridData.horizontalAlignment = GridData.END; gridData.grabExcessHorizontalSpace = true; gridData.widthHint = 75; txtPrivatePort.setLayoutData(gridData); if (isEditEndpt) { txtName.setText(waEndpt.getName()); txtPrivatePort.setText(waEndpt.getPrivatePort()); txtPublicPort.setText(waEndpt.getPort()); comboType.setText(waEndpt.getEndPointType().toString()); if (comboType.getText().equalsIgnoreCase(WindowsAzureEndpointType.Internal.toString())) { txtPublicPort.setEnabled(false); lblPublicPort.setEnabled(false); txtPublicPort.setText(""); } } return super.createContents(parent); }
public static void main(String[] args) { Display display = new Display(); Shell shell = new Shell(display); shell.setLayout(new GridLayout(2, true)); final Browser browser; try { browser = new Browser(shell, SWT.NONE); } catch (SWTError e) { System.out.println("Could not instantiate Browser: " + e.getMessage()); display.dispose(); return; } GridData data = new GridData(GridData.FILL_BOTH); data.horizontalSpan = 2; browser.setLayoutData(data); Button headersButton = new Button(shell, SWT.PUSH); headersButton.setText("Send custom headers"); data = new GridData(); data.horizontalAlignment = GridData.FILL; headersButton.setLayoutData(data); headersButton.addListener( SWT.Selection, event -> browser.setUrl( "http://www.ericgiguere.com/tools/http-header-viewer.html", null, new String[] {"User-agent: SWT Browser", "Custom-header: this is just a demo"})); Button postDataButton = new Button(shell, SWT.PUSH); postDataButton.setText("Send post data"); data = new GridData(); data.horizontalAlignment = GridData.FILL; postDataButton.setLayoutData(data); postDataButton.addListener( SWT.Selection, event -> browser.setUrl( "https://bugs.eclipse.org/bugs/buglist.cgi", "emailassigned_to1=1&bug_severity=enhancement&bug_status=NEW&email1=platform-swt-inbox&emailtype1=substring", null)); shell.setBounds(10, 10, 600, 600); shell.open(); while (!shell.isDisposed()) { if (!display.readAndDispatch()) display.sleep(); } display.dispose(); }
private void createButtonBarComposite(Composite parent) { Composite buttonBarComposite = new Composite(parent, SWT.NONE); GridData gridData = new GridData(); gridData.grabExcessHorizontalSpace = true; gridData.horizontalAlignment = GridData.CENTER; buttonBarComposite.setLayoutData(gridData); RowLayout rowLayout = new RowLayout(); rowLayout.pack = false; buttonBarComposite.setLayout(rowLayout); Button okButton = new Button(buttonBarComposite, SWT.PUSH); okButton.setText("OK"); okButton.addSelectionListener( new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { okPressed(); } }); this.shell.setDefaultButton(okButton); Button cancelButton = new Button(buttonBarComposite, SWT.PUSH); cancelButton.setText("Cancel"); cancelButton.addSelectionListener( new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { cancelPressed(); } }); }
private void createUriPanel(final Composite parent) { if (configuredRemotes != null) { uriButton = new Button(parent, SWT.RADIO); uriButton.setText(UIText.RepositorySelectionPage_uriChoice + ":"); // $NON-NLS-1$ uriButton.addSelectionListener( new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { // occurs either on selection or unselection event updateRemoteAndURIPanels(); checkPage(); } }); } uriPanel = new Composite(parent, SWT.NULL); uriPanel.setLayout(new GridLayout()); final GridData gd = new GridData(); gd.grabExcessHorizontalSpace = true; gd.horizontalAlignment = SWT.FILL; uriPanel.setLayoutData(gd); createLocationGroup(uriPanel); createConnectionGroup(uriPanel); authGroup = createAuthenticationGroup(uriPanel); }
/** * Fills this field editor's basic controls into the given parent. * * <p>The string field implementation of this <code>FieldEditor</code> framework method * contributes the text field. Subclasses may override but must call <code>super.doFillIntoGrid * </code>. */ protected void doFillIntoGrid(Composite parent, int numColumns) { getLabelControl(parent); textField = getTextControl(parent); GridData gd = new GridData(); gd.horizontalSpan = numColumns - 1; if (widthInChars != UNLIMITED) { GC gc = new GC(textField); try { Point extent = gc.textExtent("X"); // $NON-NLS-1$ gd.widthHint = widthInChars * extent.x; } finally { gc.dispose(); } } else { // System.out.println("fill"); gd.horizontalAlignment = GridData.FILL_BOTH; gd.verticalSpan = 4; gd.horizontalSpan = 1; gd.grabExcessVerticalSpace = true; gd.widthHint = 400; gd.heightHint = 60; // gd.grabExcessHorizontalSpace = true; } textField.setLayoutData(gd); }
protected Text createFilterText(Composite parent) { fFilterText = new Text(parent, SWT.NONE); Dialog.applyDialogFont(fFilterText); GridData data = new GridData(GridData.FILL_HORIZONTAL); data.horizontalAlignment = GridData.FILL; data.verticalAlignment = GridData.CENTER; fFilterText.setLayoutData(data); fFilterText.addKeyListener( new KeyListener() { public void keyPressed(KeyEvent e) { if (e.keyCode == 0x0D) // return gotoSelectedElement(); if (e.keyCode == SWT.ARROW_DOWN) getfTreeViewer().getTree().setFocus(); if (e.keyCode == SWT.ARROW_UP) getfTreeViewer().getTree().setFocus(); if (e.character == 0x1B) // ESC dispose(); } public void keyReleased(KeyEvent e) { // do nothing } }); return fFilterText; }
private void createLabel(Composite c, String text) { Label l = new Label(c, SWT.NONE); l.setText(text); GridData gd = new GridData(); gd.horizontalAlignment = SWT.RIGHT; l.setLayoutData(gd); }
private void addSeparator(Composite parent) { Label separator = new Label(parent, SWT.SEPARATOR | SWT.HORIZONTAL); GridData gridData = new GridData(); gridData.horizontalAlignment = GridData.FILL; gridData.grabExcessHorizontalSpace = true; separator.setLayoutData(gridData); }