protected void setZoomLabel() { zoomLabel.setText( Integer.toString( Math.round( magnification * 100 ) ) + "%" ); }
/** * 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 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 ) { MessageBox mb = new MessageBox( shell, SWT.YES | SWT.ICON_ERROR ); mb.setMessage( BaseMessages.getString( PKG, "TransGraph.Dialog.InvalidZoomMeasurement.Message", zoomLabel .getText() ) ); mb.setText( BaseMessages.getString( PKG, "TransGraph.Dialog.InvalidZoomMeasurement.Title" ) ); mb.open(); } redraw(); }
/** * Copy information from the meta-data input to the dialog fields. */ public void getData() { wInput.setText( Const.NVL( input.getInputFileField(), "" ) ); wOutput.setText( Const.NVL( input.getOutputFileField(), "" ) ); for ( String name : input.getParameterFieldMap().keySet() ) { String field = input.getParameterFieldMap().get( name ); TableItem item = new TableItem( wFields.table, SWT.NONE ); item.setText( 1, name ); item.setText( 2, field ); } wFields.removeEmptyRows(); wFields.setRowNums(); wFields.optWidth( true ); wProcessor.select( input.getOutputProcessorType().ordinal() ); wStepname.selectAll(); wStepname.setFocus(); wParentFolder.setSelection( input.getCreateParentfolder() ); }
public void activate() { try { getVfsFileChooserDialog().setRootFile( null ); getVfsFileChooserDialog().setInitialFile( null ); getVfsFileChooserDialog().openFileCombo.setText( GoogleDriveFileProvider.SCHEME + "://" ); getVfsFileChooserDialog().vfsBrowser.fileSystemTree.removeAll(); super.activate(); FileObject newRoot = resolveFile( getVfsFileChooserDialog().openFileCombo.getText() ); getVfsFileChooserDialog().vfsBrowser.resetVfsRoot( newRoot ); } catch ( FileSystemException e ) { System.out.println( e ); } }
private void getFields() { Cursor busy = new Cursor( shell.getDisplay(), SWT.CURSOR_WAIT ); shell.setCursor( busy ); try { String sourceStepName = wSourceStep.getText(); if ( !Utils.isEmpty( sourceStepName ) ) { String fieldName = wSourceField.getText(); RowMetaInterface r = transMeta.getStepFields( sourceStepName ); if ( r != null ) { wSourceField.setItems( r.getFieldNames() ); } wSourceField.setText( fieldName ); } shell.setCursor( null ); busy.dispose(); } catch ( KettleException ke ) { shell.setCursor( null ); busy.dispose(); new ErrorDialog( shell, BaseMessages.getString( PKG, "ValidatorDialog.FailedToGetFields.DialogTitle" ), BaseMessages .getString( PKG, "ValidatorDialog.FailedToGetFields.DialogMessage" ), ke ); } } }
wDataType.setText( ValueMetaFactory.getValueMetaName( field.getDataType() ) ); wConversionMask.setText( Const.NVL( field.getConversionMask(), "" ) ); wDecimalSymbol.setText( Const.NVL( field.getDecimalSymbol(), "" ) ); wSourceStep.setText( Const.NVL( field.getSourcingStepName(), "" ) ); wSourceField.setText( Const.NVL( field.getSourcingField(), "" ) );
wOnlyNew.setSelection( jobEntry.isOnlyGettingNewFiles() ); wActive.setSelection( jobEntry.isActiveConnection() ); wControlEncoding.setText( jobEntry.getControlEncoding() ); wMove.setSelection( jobEntry.isMoveFiles() ); wMoveToDirectory.setText( Const.NVL( jobEntry.getMoveToDirectory(), "" ) );
wOnlyNew.setSelection( jobEntry.isOnlyPuttingNewFiles() ); wActive.setSelection( jobEntry.isActiveConnection() ); wControlEncoding.setText( jobEntry.getControlEncoding() );
wEncoding.setText( input.getEncoding() );
wName.setText( Const.nullToEmpty( jobEntry.getName() ) ); wProtocol.setText( Const.NVL( jobEntry.getProtocol(), "FTP" ) ); wPort.setText( Const.NVL( jobEntry.getPort(), "" ) ); wServerName.setText( Const.NVL( jobEntry.getServerName(), "" ) );
wEncoding.setText( input.getEncoding() );
@Override public void runSupport() { if (widget != null && !widget.isDisposed()) { widget.setText(val == null ? "" : val); text = val; } } });
protected void handleDrop(String urlText, DropTargetEvent event) { repoCombo.setText(urlText); event.detail = DND.DROP_LINK; addRepository(false); } });
protected Combo createCombo(Composite composite, int style, String message, GridData gd) { Combo combo= new Combo(composite, style); SWTUtil.setDefaultVisibleItemCount(combo); if (message != null) combo.setText(message); combo.setLayoutData(gd); return combo; }
protected void initializeCombo(IDialogSettings settings, String key, Combo combo) { for (int i = 0; i < 6; i++) { String curr = settings.get(key + String.valueOf(i)); if (curr != null && combo.indexOf(curr) == -1) { combo.add(curr); } } if (combo.getItemCount() > 0) combo.setText(combo.getItem(0)); }