Composite composite = new Composite(shell, SWT.NONE); composite.setLayout(new GridLayout(1, false)); composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1)); Button btnRadioButton = new Button(grpValueType, SWT.RADIO); btnRadioButton.setSelection(true); btnRadioButton.setText(RedisClient.i18nFile.getText(I18nFile.TEXT)); final Combo textType = new Combo(grpValueType, SWT.DROP_DOWN | SWT.READ_ONLY); textType.setItems(new String[] { RedisClient.i18nFile.getText(I18nFile.PLAINTEXT), RedisClient.i18nFile.getText(I18nFile.JSON), RedisClient.i18nFile.getText(I18nFile.XML) }); textType.select(0); final Combo imageType = new Combo(grpValueType, SWT.DROP_DOWN | SWT.READ_ONLY); imageType.setEnabled(false); imageType.setItems(new String[] { RedisClient.i18nFile.getText(I18nFile.BASE64IMAGE) }); grpValue.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1)); grpValue.setText(RedisClient.i18nFile.getText(I18nFile.DATA)); textType.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { imageType.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) {
private void ok() { stepname = wStepname.getText(); // return value input.getParameterFieldMap().clear(); for ( int i = 0; i < wFields.nrNonEmpty(); i++ ) { TableItem item = wFields.getNonEmpty( i ); String name = item.getText( 1 ); String field = item.getText( 2 ); if ( !Utils.isEmpty( name ) && !Utils.isEmpty( field ) ) { input.getParameterFieldMap().put( name, field ); } } input.setInputFileField( wInput.getText() ); input.setOutputFileField( wOutput.getText() ); input.setOutputProcessorType( ProcessorType.values()[wProcessor.getSelectionIndex()] ); input.setCreateParentfolder( wParentFolder.getSelection() ); dispose(); }
private void fillStoredData() { if ( stepname != null ) { textStepName.setText( stepname ); comboDimension.add( meta.getDimension() ); comboDimension.select( 0 ); comboElementType.add( meta.getElementType() ); comboElementType.select( 0 ); comboElementType.setItems( new String[]{ "Numeric", "String" } ); comboElementType.select( 0 ); if ( meta.getElementType() != null ) { int indexType = comboElementType.indexOf( meta.getElementType() ); if ( indexType >= 0 ) { comboElementType.select( indexType ); buttonCreateDimension.setSelection( meta.getCreateNewDimension() ); buttonClearDimension.setSelection( meta.getClearDimension() ); buttonClearConsolidations.setSelection( meta.getClearConsolidations() ); buttonEnableElementCache.setSelection( meta.getEnableElementCache() ); buttonPreloadElementCache.setSelection( meta.getPreloadElementCache() );
private void getSteps() { Cursor busy = new Cursor( shell.getDisplay(), SWT.CURSOR_WAIT ); shell.setCursor( busy ); String fieldStep = wSourceStep.getText(); wSourceStep.removeAll(); wSourceStep.setItems( transMeta.getPrevStepNames( stepMeta ) ); wSourceStep.setText( fieldStep ); shell.setCursor( null ); busy.dispose(); }
/** * Allows for magnifying to any percentage entered by the user... */ private void readMagnification() { String possibleText = zoomLabel.getText(); possibleText = possibleText.replace( "%", "" ); float possibleFloatMagnification; try { possibleFloatMagnification = Float.parseFloat( possibleText ) / 100; magnification = possibleFloatMagnification; if ( zoomLabel.getText().indexOf( '%' ) < 0 ) { zoomLabel.setText( zoomLabel.getText().concat( "%" ) ); } } catch ( Exception e ) { modalMessageDialog( getString( "TransGraph.Dialog.InvalidZoomMeasurement.Title" ), getString( "TransGraph.Dialog.InvalidZoomMeasurement.Message", zoomLabel.getText() ), SWT.YES | SWT.ICON_ERROR ); } redraw(); }
private void tranformText(final Combo textType, final Text text) { int index = textType.getSelectionIndex(); if (index == 0) { text.setText(value); } else if (index == 1) { Gson gson = new GsonBuilder().setPrettyPrinting().create(); JsonElement je = jp.parse(value); String prettyJsonString = gson.toJson(je); text.setText(prettyJsonString); } catch (JsonSyntaxException e) { textType.select(currentTextType); throw new RuntimeException(RedisClient.i18nFile.getText(I18nFile.JSONEXCEPTION)); text.setText(out.getBuffer().toString()); } catch (DocumentException e) { textType.select(currentTextType); throw new RuntimeException(RedisClient.i18nFile.getText(I18nFile.XMLEXCEPTION)); } catch (IOException e) {
wlName = new Label( shell, SWT.RIGHT ); wlName.setText( BaseMessages.getString( PKG, "JobFTPPUT.Name.Label" ) ); props.setLook( wlName ); fdlName = new FormData(); wGeneralTab.setText( BaseMessages.getString( PKG, "JobFTPPUT.Tab.General.Label" ) ); wGeneralComp = new Composite( wTabFolder, SWT.NONE ); props.setLook( wGeneralComp ); generalLayout.marginWidth = 3; generalLayout.marginHeight = 3; wGeneralComp.setLayout( generalLayout ); wControlEncoding = new Combo( wAdvancedSettings, SWT.SINGLE | SWT.LEFT | SWT.BORDER ); wControlEncoding.setToolTipText( BaseMessages.getString( PKG, "JobFTPPUT.ControlEncoding.Tooltip" ) ); wControlEncoding.setItems( encodings ); props.setLook( wControlEncoding ); fdControlEncoding = new FormData(); fdControlEncoding.top = new FormAttachment( wActive, margin ); fdControlEncoding.right = new FormAttachment( 100, 0 ); wControlEncoding.setLayoutData( fdControlEncoding ); fdGeneralComp.right = new FormAttachment( 100, 0 ); fdGeneralComp.bottom = new FormAttachment( 100, 0 ); wGeneralComp.setLayoutData( fdGeneralComp );
wlStepname = new Label( shell, SWT.RIGHT ); wlStepname.setText( BaseMessages.getString( PKG, "PentahoReportingOutputDialog.Stepname.Label" ) ); props.setLook( wlStepname ); fdlStepname = new FormData(); wInput = new Combo( shell, SWT.SINGLE | SWT.LEFT | SWT.BORDER ); props.setLook( wInput ); wInput.addModifyListener( lsMod ); FormData fdInput = new FormData(); fdInput.left = new FormAttachment( middle, 0 ); fdInput.top = new FormAttachment( wStepname, margin + 5 ); fdInput.right = new FormAttachment( 100, 0 ); wInput.setLayoutData( fdInput ); wInput.setItems( fieldNames ); wOutput = new Combo( shell, SWT.SINGLE | SWT.LEFT | SWT.BORDER ); props.setLook( wOutput ); wOutput.addModifyListener( lsMod ); FormData fdOutput = new FormData(); fdOutput.left = new FormAttachment( middle, 0 ); fdOutput.top = new FormAttachment( wInput, margin + 5 ); fdOutput.right = new FormAttachment( 100, 0 ); wOutput.setLayoutData( fdOutput ); wOutput.setItems( fieldNames ); wInput.addSelectionListener( lsDef ); wOutput.addSelectionListener( lsDef );
changed = input.hasChanged(); GridData helpCompData = new GridData(); helpCompData.grabExcessHorizontalSpace = true; helpCompData.grabExcessVerticalSpace = false; wEncoding = new Combo( comp, SWT.SINGLE | SWT.LEFT | SWT.BORDER ); wEncoding.setToolTipText( BaseMessages.getString( PKG, "OraBulkLoaderDialog.Encoding.Tooltip" ) ); wEncoding.setItems( encodings ); props.setLook( wEncoding ); fdEncoding = new FormData(); fdEncoding.top = new FormAttachment( wDiscardFile, margin ); fdEncoding.right = new FormAttachment( 100, 0 ); wEncoding.setLayoutData( fdEncoding ); wEncoding.addModifyListener( lsMod ); wCharacterSetName = new Combo( comp, SWT.SINGLE | SWT.LEFT | SWT.BORDER ); wCharacterSetName .setToolTipText( BaseMessages.getString( PKG, "OraBulkLoaderDialog.CharacterSetName.Tooltip" ) ); wCharacterSetName.setItems( characterSetNames ); props.setLook( wCharacterSetName ); fdCharacterSetName = new FormData(); fdCharacterSetName.top = new FormAttachment( wEncoding, margin ); fdCharacterSetName.right = new FormAttachment( 100, 0 ); wCharacterSetName.setLayoutData( fdCharacterSetName ); wCharacterSetName.addModifyListener( lsMod );
labelCube = new Label( shell, SWT.RIGHT ); fd = new FormData(); fd.left = new FormAttachment( 0, 0 ); comboCube = new Combo( shell, SWT.READ_ONLY | SWT.FILL ); fd = new FormData(); fd.left = new FormAttachment( middle, 0 ); fd.right = new FormAttachment( 100, 0 ); fd.top = new FormAttachment( addConnectionLine, margin ); comboCube.setLayoutData( fd ); textMeasureName = new Text( shell, SWT.BORDER | SWT.FILL ); fd = new FormData(); fd.left = new FormAttachment( middle, 0 ); comboMeasureType = new Combo( shell, SWT.READ_ONLY | SWT.FILL ); fd = new FormData(); fd.left = new FormAttachment( middle, 0 ); fd.right = new FormAttachment( 100, 0 ); fd.top = new FormAttachment( textMeasureName, margin ); comboMeasureType.setLayoutData( fd ); tableViewFields.setLayoutData( fd ); comboCube.addSelectionListener( new SelectionAdapter() { public void widgetSelected( SelectionEvent e ) { doSelectCube();
wFieldSeparator = new Combo( wMonetDBmclientParamGroup, SWT.SINGLE | SWT.CENTER | SWT.BORDER ); wFieldSeparator.setItems( fieldSeparators ); props.setLook( wFieldSeparator ); wFieldSeparator.addModifyListener( lsMod ); wFieldEnclosure = new Combo( wMonetDBmclientParamGroup, SWT.SINGLE | SWT.CENTER | SWT.BORDER ); wFieldEnclosure.setItems( fieldEnclosures ); wFieldEnclosure.addModifyListener( lsMod ); wNULLrepresentation = new Combo( wMonetDBmclientParamGroup, SWT.SINGLE | SWT.CENTER | SWT.BORDER ); wNULLrepresentation.setItems( nullRepresentations ); wNULLrepresentation.addModifyListener( lsMod ); wEncoding = new Combo( wMonetDBmclientParamGroup, SWT.SINGLE | SWT.LEFT | SWT.BORDER ); wEncoding.setToolTipText( BaseMessages.getString( PKG, "MonetDBBulkLoaderDialog.Encoding.Tooltip" ) ); wEncoding.setItems( encodings ); props.setLook( wEncoding ); wEncoding.addModifyListener( lsMod ); fdFieldSeparator.left = new FormAttachment( middle, margin ); fdFieldSeparator.width = fieldWidth; wFieldSeparator.setLayoutData( fdFieldSeparator ); fdFieldEnclosure.left = new FormAttachment( middle, margin ); fdFieldEnclosure.width = fieldWidth; wFieldEnclosure.setLayoutData( fdFieldEnclosure ); fdNULLrepresentation.left = new FormAttachment( middle, margin ); fdNULLrepresentation.width = fieldWidth;
wDataType = new Combo( wgType, SWT.SINGLE | SWT.LEFT | SWT.BORDER ); wDataType.setItems( ValueMetaFactory.getValueMetaNames() ); props.setLook( wDataType ); FormData fdDataType = new FormData(); fdDataType.right = new FormAttachment( 100, 0 ); fdDataType.top = new FormAttachment( wDataTypeVerified, margin ); wDataType.setLayoutData( fdDataType ); wSourceStep = new Combo( wgData, SWT.SINGLE | SWT.LEFT | SWT.BORDER ); props.setLook( wSourceStep ); FormData fdSourceStep = new FormData(); fdSourceStep.right = new FormAttachment( 100, 0 ); fdSourceStep.top = new FormAttachment( wSourceValues, margin ); wSourceStep.setLayoutData( fdSourceStep ); wSourceStep.addFocusListener( new FocusAdapter() { public void focusGained( org.eclipse.swt.events.FocusEvent e ) { getSteps(); wSourceStep.addSelectionListener( new SelectionAdapter() { public void widgetSelected( SelectionEvent arg0 ) { getSteps(); wSourceField = new Combo( wgData, SWT.SINGLE | SWT.LEFT | SWT.BORDER ); props.setLook( wSourceField ); FormData fdSourceField = new FormData(); fdSourceField.right = new FormAttachment( 100, 0 );
sLookComp.setLayout( new FillLayout() ); wLookComp = new Composite( sLookComp, SWT.NONE ); props.setLook( wLookComp ); lookLayout.marginWidth = 3; lookLayout.marginHeight = 3; wLookComp.setLayout( lookLayout ); fdlFFont.right = new FormAttachment( middle, -margin ); fdlFFont.top = new FormAttachment( 0, nr * h + margin + 10 ); wlFFont.setLayoutData( fdlFFont ); fddFFont.bottom = new FormAttachment( 0, ( nr + 1 ) * h + margin ); wDefaultLocale = new Combo( wLookComp, SWT.SINGLE | SWT.READ_ONLY | SWT.LEFT | SWT.BORDER ); wDefaultLocale.setItems( GlobalMessages.localeDescr ); props.setLook( wDefaultLocale ); FormData fdDefaultLocale = new FormData(); fdDefaultLocale.right = new FormAttachment( 100, -margin ); fdDefaultLocale.top = new FormAttachment( wBranding, margin ); wDefaultLocale.setLayoutData( fdDefaultLocale ); LanguageChoice.getInstance().getDefaultLocale().toString(), GlobalMessages.localeCodes ); if ( idxDefault >= 0 ) { wDefaultLocale.select( idxDefault );
tabItem.setText( BaseMessages.getString( PKG, "GPLoadDialog.GPConfiguratonTab.Title" ) ); wGPConfigTabComp = new Composite( tabFolder, SWT.NONE ); props.setLook( wGPConfigTabComp ); int middle = props.getMiddlePct(); formlayout.marginWidth = 3; formlayout.marginHeight = 3; wGPConfigTabComp.setLayout( formlayout ); fdlGploadPath.right = new FormAttachment( middle, -margin ); fdlGploadPath.top = new FormAttachment( 0, margin ); wlGploadPath.setLayoutData( fdlGploadPath ); wEncoding = new Combo( wGPConfigTabComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER ); wEncoding.setToolTipText( BaseMessages.getString( PKG, "GPLoadDialog.Encoding.Tooltip" ) ); wEncoding.setItems( GPLoadMeta.SUPPORTED_ENCODINGS ); props.setLook( wEncoding ); FormData fdEncoding = new FormData(); fdEncoding.top = new FormAttachment( wNullAs, margin ); fdEncoding.right = new FormAttachment( 75, 0 ); wEncoding.setLayoutData( fdEncoding ); wEncoding.addModifyListener( lsMod ); wGPConfigTabComp.layout(); tabItem.setControl( wGPConfigTabComp );
private void createPatternSection(Composite parent) { Composite result = new Composite(parent, SWT.NONE); result.setLayout(new GridLayout(2, false)); result.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); Label label = new Label(result, SWT.NONE); GridData data = new GridData(); data.horizontalSpan = 2; label.setLayoutData(data); label.setText(PDEUIMessages.SearchPage_searchString); patternCombo = new Combo(result, SWT.SINGLE | SWT.BORDER); patternCombo.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); caseSensitive = new Button(result, SWT.CHECK); caseSensitive.setText(PDEUIMessages.SearchPage_caseSensitive); }
/** * {@inheritDoc} */ @Override public void createControl(Composite parent) { super.createControl(parent); Label insertBeforeLabel = new Label(main, SWT.LEFT); insertBeforeLabel.setText("Insert Before:"); insertBeforeLabel.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false)); Composite insertBeforeComposite = new Composite(main, SWT.NONE); insertBeforeComposite.setLayout(new GridLayout(2, false)); insertBeforeComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false)); insertBeforeComboBox = new Combo(insertBeforeComposite, SWT.BORDER | SWT.DROP_DOWN | SWT.READ_ONLY); insertBeforeComboBox.setItems(existingItems); insertBeforeComboBox.select(existingItems.length - 1); insertBeforeComboBox.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false)); Label insertBeforeInfo = new Label(insertBeforeComposite, SWT.LEFT); insertBeforeInfo.setImage(InspectIT.getDefault().getImage(InspectITImages.IMG_INFORMATION)); insertBeforeInfo.setToolTipText(insertBeforeToolTip); }
protected Combo addComboBox(Composite parent, String label, Key key, String[] values, String[] valueLabels, int indent) { GridData gd= new GridData(GridData.FILL, GridData.CENTER, true, false, 2, 1); gd.horizontalIndent= indent; Label labelControl= new Label(parent, SWT.LEFT); labelControl.setFont(JFaceResources.getDialogFont()); labelControl.setText(label); labelControl.setLayoutData(gd); Combo comboBox= newComboControl(parent, key, values, valueLabels); comboBox.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL)); fLabels.put(comboBox, labelControl); return comboBox; }
protected void addSourceOption(Composite container) { Composite composite = new Composite(container, SWT.NONE); GridLayout layout = new GridLayout(2, false); layout.marginHeight = layout.marginWidth = 0; composite.setLayout(layout); composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); fIncludeSourceButton = new Button(composite, SWT.CHECK); fIncludeSourceButton.setText(PDEUIMessages.ExportWizard_includeSource); GridData gd = new GridData(); gd.horizontalSpan = 1; fIncludeSourceButton.setLayoutData(gd); fIncludeSourceCombo = new Combo(composite, SWT.READ_ONLY | SWT.BORDER); fIncludeSourceCombo.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING)); }
private void createSuperTypeCombo(Composite parent) { final Label label= new Label(parent, SWT.NONE); label.setText(RefactoringMessages.PullUpInputPage1_Select_destination); label.setLayoutData(new GridData()); fSuperTypesCombo= new Combo(parent, SWT.READ_ONLY); SWTUtil.setDefaultVisibleItemCount(fSuperTypesCombo); if (fCandidateTypes.length > 0) { for (int i= 0; i < fCandidateTypes.length; i++) { final String comboLabel= fCandidateTypes[i].getFullyQualifiedName('.'); fSuperTypesCombo.add(comboLabel); } fSuperTypesCombo.select(fCandidateTypes.length - 1); fSuperTypesCombo.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); } }
@Override public void widgetSelected(SelectionEvent e) { if (!currentText) { imageType.setEnabled(false); textType.setEnabled(true); if (label != null && !label.isDisposed()) { label.setVisible(false); label.dispose(); } text = new Text(grpValue, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL | SWT.MULTI); text.setEditable(false); text.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1)); text.setText(value); tranformText(textType, text); currentText = true; } } });