private void ok() { stepname = txStepName.getText(); // return value logDebug("*** New CacheName is: " + cacheName + " xml URL is: " + xmlURL); input.setCacheName(txCacheName.getText()); input.setXmlURL(txEhcachePath.getText()); dispose(); }
public EhCachePluginRemoveDialog( Shell parent, Object object, TransMeta transMeta, String stepname) throws KettleValueException { super(parent, (BaseStepMeta) object, transMeta, stepname); // TODO Auto-generated constructor stub input = (EhCachePluginRemoveMeta) object; // value = input.getValue(); cacheName = input.getCacheName(); xmlURL = input.getXmlURL(); }
@Override public String open() { // TODO Auto-generated method stub Shell parent = getParent(); Display display = parent.getDisplay(); shell = new Shell(parent, SWT.DIALOG_TRIM | SWT.RESIZE | SWT.MIN | SWT.MAX); props.setLook(shell); setShellImage(shell, input); new ModifyListener() { public void modifyText(ModifyEvent e) { input.setChanged(); } }; changed = input.hasChanged(); txEhcachePath = new Text(shell, SWT.BORDER); txEhcachePath.setBounds(132, 38, 144, 19); Label lblNewLabel = new Label(shell, SWT.NONE); lblNewLabel.setBounds(10, 41, 116, 14); lblNewLabel.setText(Messages.getString("EhCachePluginRemoveDialog.Ehcache.Label")); txCacheName = new Text(shell, SWT.BORDER); txCacheName.setBounds(132, 63, 144, 19); Label lblCacheName = new Label(shell, SWT.NONE); lblCacheName.setText(Messages.getString("EhCachePluginRemoveDialog.CacheName.Label")); lblCacheName.setBounds(10, 66, 116, 14); Button btnNewButton = new Button(shell, SWT.NONE); btnNewButton.addSelectionListener( new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { ok(); } }); btnNewButton.setBounds(159, 88, 94, 28); btnNewButton.setText("Save"); Button btnReset = new Button(shell, SWT.NONE); btnReset.addSelectionListener( new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { cancel(); } }); btnReset.setBounds(32, 86, 94, 28); btnReset.setText("Reset"); Link link = new Link(shell, SWT.NONE); link.setBounds(132, 122, 55, 15); link.setText( "<a href=\"https://github.com/sgrotz/PentahoEhCachePlugin/raw/master/PentahoEhcachePlugin_Instructions.pdf\">Help!</a>"); txStepName = new Text(shell, SWT.BORDER); txStepName.setBounds(132, 10, 144, 19); Label lblStepname = new Label(shell, SWT.NONE); lblStepname.setText(Messages.getString("EhCachePluginRemoveDialog.StepName.Label")); lblStepname.setBounds(10, 13, 116, 14); // Set the shell size, based upon previous time... setSize(); getData(); input.setChanged(changed); shell.open(); while (!shell.isDisposed()) { if (!display.readAndDispatch()) display.sleep(); } return stepname; }
private void cancel() { stepname = null; input.setChanged(changed); dispose(); }