public String open() { final Display display = getParent().getDisplay(); shell = new Shell(getParent(), SWT.DIALOG_TRIM | SWT.RESIZE | SWT.MAX | SWT.MIN); props.setLook(shell); setShellImage(shell, meta); FormLayout formLayout = new FormLayout(); formLayout.marginWidth = Const.FORM_MARGIN; formLayout.marginHeight = Const.FORM_MARGIN; shell.setLayout(formLayout); int middle = props.getMiddlePct(); int margin = Const.MARGIN; FormData fd; labelStepName = new Label(shell, SWT.RIGHT); fd = new FormData(); fd.left = new FormAttachment(0, 0); fd.right = new FormAttachment(middle, -margin); fd.top = new FormAttachment(0, margin); labelStepName.setLayoutData(fd); textStepName = new Text(shell, SWT.BORDER); fd = new FormData(); fd.left = new FormAttachment(middle, 0); fd.right = new FormAttachment(100, 0); fd.top = new FormAttachment(0, margin); textStepName.setLayoutData(fd); addConnectionLine = addConnectionLine(shell, textStepName, Const.MIDDLE_PCT, margin); labelCube = new Label(shell, SWT.RIGHT); fd = new FormData(); fd.left = new FormAttachment(0, 0); fd.right = new FormAttachment(middle, -margin); fd.top = new FormAttachment(addConnectionLine, margin); labelCube.setLayoutData(fd); comboCube = new Combo(shell, SWT.READ_ONLY); fd = new FormData(); fd.left = new FormAttachment(middle, 0); fd.right = new FormAttachment(100, 0); fd.top = new FormAttachment(addConnectionLine, margin); comboCube.setLayoutData(fd); labelMeasureType = new Label(shell, SWT.RIGHT); fd = new FormData(); fd.left = new FormAttachment(0, 0); fd.right = new FormAttachment(middle, -margin); fd.top = new FormAttachment(comboCube, margin); labelMeasureType.setLayoutData(fd); 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(comboCube, margin); comboMeasureType.setLayoutData(fd); labelUpdateMode = new Label(shell, SWT.RIGHT); fd = new FormData(); fd.left = new FormAttachment(0, 0); fd.right = new FormAttachment(middle, -margin); fd.top = new FormAttachment(comboMeasureType, margin); labelUpdateMode.setLayoutData(fd); comboUpdateMode = 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(comboMeasureType, margin); comboUpdateMode.setLayoutData(fd); labelSplashMode = new Label(shell, SWT.RIGHT); fd = new FormData(); fd.left = new FormAttachment(0, 0); fd.right = new FormAttachment(middle, -margin); fd.top = new FormAttachment(comboUpdateMode, margin); labelSplashMode.setLayoutData(fd); comboSplashMode = 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(comboUpdateMode, margin); comboSplashMode.setLayoutData(fd); labelCommitSize = new Label(shell, SWT.RIGHT); fd = new FormData(); fd.left = new FormAttachment(0, 0); fd.right = new FormAttachment(middle, -margin); fd.top = new FormAttachment(comboSplashMode, margin); labelCommitSize.setLayoutData(fd); textCommitSize = new Text(shell, SWT.BORDER); fd = new FormData(); fd.left = new FormAttachment(middle, 0); fd.right = new FormAttachment(100, 0); fd.top = new FormAttachment(comboSplashMode, margin); textCommitSize.setLayoutData(fd); labelClearCube = new Label(shell, SWT.RIGHT); fd = new FormData(); fd.left = new FormAttachment(0, 0); fd.right = new FormAttachment(middle, -margin); fd.top = new FormAttachment(textCommitSize, margin); labelClearCube.setLayoutData(fd); buttonClearCube = new Button(shell, SWT.CHECK); fd = new FormData(); fd.left = new FormAttachment(middle, 0); fd.right = new FormAttachment(100, 0); fd.top = new FormAttachment(textCommitSize, margin); buttonClearCube.setLayoutData(fd); labelEnableDimensionCache = new Label(shell, SWT.RIGHT); fd = new FormData(); fd.left = new FormAttachment(0, 0); fd.right = new FormAttachment(middle, -margin); fd.top = new FormAttachment(buttonClearCube, margin); labelEnableDimensionCache.setLayoutData(fd); buttonEnableDimensionCache = new Button(shell, SWT.CHECK); fd = new FormData(); fd.left = new FormAttachment(middle, 0); fd.right = new FormAttachment(100, 0); fd.top = new FormAttachment(buttonClearCube, margin); buttonEnableDimensionCache.setLayoutData(fd); labelPreloadDimensionCache = new Label(shell, SWT.RIGHT); fd = new FormData(); fd.left = new FormAttachment(0, 0); fd.right = new FormAttachment(middle, -margin); fd.top = new FormAttachment(buttonEnableDimensionCache, margin); labelPreloadDimensionCache.setLayoutData(fd); buttonPreloadDimensionCache = new Button(shell, SWT.CHECK); fd = new FormData(); fd.left = new FormAttachment(middle, 0); fd.right = new FormAttachment(100, 0); fd.top = new FormAttachment(buttonEnableDimensionCache, margin); buttonPreloadDimensionCache.setLayoutData(fd); ModifyListener lsMod = new ModifyListener() { public void modifyText(ModifyEvent e) { meta.setChanged(); } }; colinf = new ColumnInfo[] { new ColumnInfo(getLocalizedColumn(0), ColumnInfo.COLUMN_TYPE_TEXT, false, true), new ColumnInfo( getLocalizedColumn(1), ColumnInfo.COLUMN_TYPE_CCOMBO, new String[] {}, true), }; tableViewFields = new TableView(null, shell, SWT.NONE | SWT.BORDER, colinf, 10, true, lsMod, props); tableViewFields.setSize(477, 105); tableViewFields.setBounds(5, 250, 477, 105); tableViewFields.setReadonly(true); tableViewFields.setSortable(false); tableViewFields.table.removeAll(); fd = new FormData(); fd.left = new FormAttachment(0, margin); fd.top = new FormAttachment(buttonPreloadDimensionCache, 3 * margin); fd.right = new FormAttachment(100, -150); fd.bottom = new FormAttachment(100, -50); tableViewFields.setLayoutData(fd); buttonGetFields = new Button(shell, SWT.NONE); fd = new FormData(); fd.left = new FormAttachment(tableViewFields, margin); fd.top = new FormAttachment(buttonPreloadDimensionCache, 3 * margin); fd.right = new FormAttachment(100, 0); buttonGetFields.setLayoutData(fd); buttonClearFields = new Button(shell, SWT.NONE); fd = new FormData(); fd.left = new FormAttachment(tableViewFields, margin); fd.top = new FormAttachment(buttonGetFields, margin); fd.right = new FormAttachment(100, 0); buttonClearFields.setLayoutData(fd); buttonOk = new Button(shell, SWT.CENTER); buttonCancel = new Button(shell, SWT.CENTER); buttonOk.setText(BaseMessages.getString("System.Button.OK")); buttonCancel.setText(BaseMessages.getString("System.Button.Cancel")); setButtonPositions(new Button[] {buttonOk, buttonCancel}, margin, null); buttonGetFields.addSelectionListener( new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { doGetFields(); } }); buttonClearFields.addSelectionListener( new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { doClearFields(); } }); buttonCancel.addSelectionListener( new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { cancel(); } }); buttonOk.addSelectionListener( new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { ok(); } }); addConnectionLine.addSelectionListener( new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { doSelectConnection(false); } }); comboCube.addSelectionListener( new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { doSelectCube(); } }); buttonEnableDimensionCache.addSelectionListener( new SelectionAdapter() { public void widgetSelected(SelectionEvent arg0) { buttonPreloadDimensionCache.setEnabled(buttonEnableDimensionCache.getSelection()); } }); this.fillLocalizedData(); this.fillStoredData(); this.doSelectConnection(false); props.setLook(tableViewFields); props.setLook(textStepName); props.setLook(comboCube); props.setLook(labelStepName); props.setLook(labelCube); props.setLook(labelMeasureType); props.setLook(comboMeasureType); props.setLook(labelUpdateMode); props.setLook(comboUpdateMode); props.setLook(labelSplashMode); props.setLook(comboSplashMode); props.setLook(buttonClearFields); props.setLook(buttonGetFields); props.setLook(buttonOk); props.setLook(buttonCancel); props.setLook(addConnectionLine); props.setLook(buttonClearCube); props.setLook(labelClearCube); props.setLook(textCommitSize); props.setLook(labelCommitSize); props.setLook(labelPreloadDimensionCache); props.setLook(buttonPreloadDimensionCache); props.setLook(labelEnableDimensionCache); props.setLook(buttonEnableDimensionCache); shell.addShellListener( new ShellAdapter() { public void shellClosed(ShellEvent e) { cancel(); } }); meta.setChanged(changed); setSize(); shell.open(); PaloCellInputDialog.showPaloLibWarningDialog(shell); while (!shell.isDisposed()) { if (!display.readAndDispatch()) { display.sleep(); } } return stepname; }
public SAPFunction open() { Shell parent = getParent(); Display display = parent.getDisplay(); shell = new Shell(parent, SWT.DIALOG_TRIM | SWT.RESIZE | SWT.MAX); props.setLook(shell); shell.setImage(GUIResource.getInstance().getImageSpoon()); int middle = Const.MIDDLE_PCT; int margin = Const.MARGIN; FormLayout formLayout = new FormLayout(); formLayout.marginWidth = Const.FORM_MARGIN; formLayout.marginHeight = Const.FORM_MARGIN; shell.setLayout(formLayout); shell.setText(BaseMessages.getString(PKG, "SapFunctionBrowser.Title")); // Function // wlFunction = new Label(shell, SWT.RIGHT); wlFunction.setText(BaseMessages.getString(PKG, "SapInputDialog.Function.Label")); props.setLook(wlFunction); FormData fdlFunction = new FormData(); fdlFunction.left = new FormAttachment(0, 0); fdlFunction.right = new FormAttachment(middle, -margin); fdlFunction.top = new FormAttachment(0, 0); wlFunction.setLayoutData(fdlFunction); wbFunction = new Button(shell, SWT.PUSH); props.setLook(wbFunction); wbFunction.setText(BaseMessages.getString(PKG, "SapInputDialog.FindFunctionButton.Label")); FormData fdbFunction = new FormData(); fdbFunction.right = new FormAttachment(100, 0); fdbFunction.top = new FormAttachment(0, 0); wbFunction.setLayoutData(fdbFunction); wbFunction.addSelectionListener( new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { searchString = wFunction.getText(); getData(); } }); wFunction = new Text(shell, SWT.SINGLE | SWT.LEFT | SWT.BORDER); props.setLook(wFunction); FormData fdFunction = new FormData(); fdFunction.left = new FormAttachment(middle, 0); fdFunction.right = new FormAttachment(wbFunction, -margin); fdFunction.top = new FormAttachment(0, margin); wFunction.setLayoutData(fdFunction); Control lastControl = wFunction; // The buttons at the bottom of the dialog // wOK = new Button(shell, SWT.PUSH); wOK.setText(BaseMessages.getString(PKG, "System.Button.OK")); wOK.addListener( SWT.Selection, new Listener() { public void handleEvent(Event e) { ok(); } }); wCancel = new Button(shell, SWT.PUSH); wCancel.setText(BaseMessages.getString(PKG, "System.Button.Cancel")); wCancel.addListener( SWT.Selection, new Listener() { public void handleEvent(Event e) { cancel(); } }); // Position the buttons... // BaseStepDialog.positionBottomButtons( shell, new Button[] { wOK, wCancel, }, Const.MARGIN, null); // The search results... // ColumnInfo[] columns = new ColumnInfo[] { new ColumnInfo( BaseMessages.getString(PKG, "SapFunctionBrowser.ResultView.Name.Column"), ColumnInfo.COLUMN_TYPE_TEXT, false, true), new ColumnInfo( BaseMessages.getString(PKG, "SapFunctionBrowser.ResultView.Groupname.Column"), ColumnInfo.COLUMN_TYPE_TEXT, false, true), new ColumnInfo( BaseMessages.getString(PKG, "SapFunctionBrowser.ResultView.Application.Column"), ColumnInfo.COLUMN_TYPE_TEXT, false, true), new ColumnInfo( BaseMessages.getString(PKG, "SapFunctionBrowser.ResultView.Description.Column"), ColumnInfo.COLUMN_TYPE_TEXT, false, true), }; wResult = new TableView( space, shell, SWT.BORDER | SWT.FULL_SELECTION | SWT.MULTI, columns, 0, null, props); wResult.setSortable(true); FormData fdResults = new FormData(); fdResults.left = new FormAttachment(0, 0); fdResults.top = new FormAttachment(lastControl, margin); fdResults.right = new FormAttachment(100, 0); fdResults.bottom = new FormAttachment(wOK, -3 * margin); wResult.setLayoutData(fdResults); // Detect X or ALT-F4 or something that kills this window... shell.addShellListener( new ShellAdapter() { public void shellClosed(ShellEvent e) { cancel(); } }); getData(); // Set the shell size, based upon previous time... BaseStepDialog.setSize(shell); shell.open(); while (!shell.isDisposed()) { if (!display.readAndDispatch()) { display.sleep(); } } return function; }
public String open() { final Display display = getParent().getDisplay(); shell = new Shell(getParent(), SWT.DIALOG_TRIM | SWT.RESIZE | SWT.MAX | SWT.MIN); props.setLook(shell); setShellImage(shell, meta); FormLayout formLayout = new FormLayout(); formLayout.marginWidth = Const.FORM_MARGIN; formLayout.marginHeight = Const.FORM_MARGIN; shell.setLayout(formLayout); int middle = props.getMiddlePct(); int margin = Const.MARGIN; FormData fd; labelStepName = new Label(shell, SWT.RIGHT); fd = new FormData(); fd.left = new FormAttachment(0, 0); fd.right = new FormAttachment(middle, -margin); fd.top = new FormAttachment(0, margin); labelStepName.setLayoutData(fd); textStepName = new Text(shell, SWT.BORDER); fd = new FormData(); fd.left = new FormAttachment(middle, 0); fd.right = new FormAttachment(100, 0); fd.top = new FormAttachment(0, margin); textStepName.setLayoutData(fd); addConnectionLine = addConnectionLine(shell, textStepName, Const.MIDDLE_PCT, margin); labelDimension = new Label(shell, SWT.RIGHT); fd = new FormData(); fd.left = new FormAttachment(0, 0); fd.right = new FormAttachment(middle, -margin); fd.top = new FormAttachment(addConnectionLine, margin); labelDimension.setLayoutData(fd); comboDimension = new Combo(shell, SWT.READ_ONLY); fd = new FormData(); fd.left = new FormAttachment(middle, 0); fd.right = new FormAttachment(100, 0); fd.top = new FormAttachment(addConnectionLine, margin); comboDimension.setLayoutData(fd); labelBaseElementsOnly = new Label(shell, SWT.RIGHT); fd = new FormData(); fd.left = new FormAttachment(0, 0); fd.right = new FormAttachment(middle, -margin); fd.top = new FormAttachment(comboDimension, margin); labelBaseElementsOnly.setLayoutData(fd); buttonBaseElementsOnly = new Button(shell, SWT.CHECK); fd = new FormData(); fd.left = new FormAttachment(middle, 0); fd.right = new FormAttachment(100, 0); fd.top = new FormAttachment(comboDimension, margin); buttonBaseElementsOnly.setLayoutData(fd); ModifyListener lsMod = new ModifyListener() { public void modifyText(ModifyEvent e) { meta.setChanged(); } }; ColumnInfo[] colinf = new ColumnInfo[] { new ColumnInfo(getLocalizedColumn(0), ColumnInfo.COLUMN_TYPE_TEXT, false, true), new ColumnInfo(getLocalizedColumn(1), ColumnInfo.COLUMN_TYPE_TEXT, false, true), new ColumnInfo(getLocalizedColumn(2), ColumnInfo.COLUMN_TYPE_TEXT, false, false), new ColumnInfo( getLocalizedColumn(3), ColumnInfo.COLUMN_TYPE_CCOMBO, new String[] {"String", "Number"}, true) }; tableViewFields = new TableView(null, shell, SWT.FILL | SWT.BORDER, colinf, 10, true, lsMod, props); tableViewFields.setSize(477, 280); tableViewFields.setBounds(5, 125, 477, 280); tableViewFields.setReadonly(true); tableViewFields.setSortable(false); fd = new FormData(); fd.left = new FormAttachment(0, margin); fd.top = new FormAttachment(buttonBaseElementsOnly, 3 * margin); fd.right = new FormAttachment(100, -150); fd.bottom = new FormAttachment(100, -50); tableViewFields.setLayoutData(fd); buttonGetLevels = new Button(shell, SWT.NONE); fd = new FormData(); fd.left = new FormAttachment(tableViewFields, margin); fd.top = new FormAttachment(buttonBaseElementsOnly, 3 * margin); fd.right = new FormAttachment(100, 0); buttonGetLevels.setLayoutData(fd); buttonClearLevels = new Button(shell, SWT.NONE); fd = new FormData(); fd.left = new FormAttachment(tableViewFields, margin); fd.top = new FormAttachment(buttonGetLevels, margin); fd.right = new FormAttachment(100, 0); buttonClearLevels.setLayoutData(fd); buttonOk = new Button(shell, SWT.CENTER); buttonCancel = new Button(shell, SWT.CENTER); buttonPreview = new Button(shell, SWT.CENTER); buttonOk.setText(BaseMessages.getString("System.Button.OK")); buttonPreview.setText(BaseMessages.getString("System.Button.Preview")); buttonCancel.setText(BaseMessages.getString("System.Button.Cancel")); setButtonPositions(new Button[] {buttonOk, buttonPreview, buttonCancel}, margin, null); buttonCancel.addSelectionListener( new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { cancel(); } }); buttonPreview.addSelectionListener( new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { preview(); } }); buttonOk.addSelectionListener( new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { ok(); } }); buttonClearLevels.addSelectionListener( new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { doClearLevels(); } }); buttonGetLevels.addSelectionListener( new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { doGetLevels(); } }); comboDimension.addSelectionListener( new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { doSelectDimension(); } }); addConnectionLine.addSelectionListener( new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { doSelectConnection(false); } }); this.fillLocalizationData(); this.fillStoredData(); this.doSelectConnection(false); props.setLook(tableViewFields); props.setLook(comboDimension); props.setLook(textStepName); props.setLook(buttonClearLevels); props.setLook(buttonGetLevels); props.setLook(labelStepName); props.setLook(labelDimension); props.setLook(buttonOk); props.setLook(buttonCancel); props.setLook(buttonPreview); props.setLook(addConnectionLine); props.setLook(labelBaseElementsOnly); props.setLook(buttonBaseElementsOnly); shell.addShellListener( new ShellAdapter() { public void shellClosed(ShellEvent e) { cancel(); } }); meta.setChanged(changed); setSize(); shell.open(); PaloCellInputDialog.showPaloLibWarningDialog(shell); while (!shell.isDisposed()) { if (!display.readAndDispatch()) display.sleep(); } return stepname; }