/** * The remote control procedure - control this plugin by importing the IFreqAnalysisInterface, and * access the view's execute procedure. * * @param simpleView whether the simple or the extended view is shown (true - simple, false - * extended) * @param keyLength sets the key length * @param keyPos sets the offset * @param overlayIndex sets the selection index of the reference overlay text combo box. * simpleView=false only! * @param resetShift resets the dragging of the graph * @param executeCalc whether a calculation has now to be executed * @param whichTab selects, which tab has to be shown. simpleView=false only! * @param activateOverlay activates the overlay. simpleView=false only! */ public final void execute( final boolean simpleView, final int keyLength, final int keyPos, final int overlayIndex, final boolean resetShift, final boolean executeCalc, final boolean whichTab, final boolean activateOverlay) { if (simpleView) { button1.setSelection(true); button2.setSelection(false); fakebtn.setSelection(false); switchComposites(null); } else { button1.setSelection(false); button2.setSelection(true); fakebtn.setSelection(false); switchComposites(null); } if (simpleView) { C1.execute(keyLength, keyPos, resetShift, executeCalc); } else { C2.execute( keyLength, keyPos, overlayIndex, resetShift, executeCalc, whichTab, activateOverlay); } }
private void initGUI() { try { GridLayout thisLayout = new GridLayout(); thisLayout.makeColumnsEqualWidth = true; this.setLayout(thisLayout); this.setSize(525, 237); group1 = new Group(this, SWT.NONE); GridLayout group1Layout = new GridLayout(); group1Layout.makeColumnsEqualWidth = true; group1Layout.numColumns = 2; group1.setLayout(group1Layout); GridData group1LData = new GridData(); group1LData.grabExcessHorizontalSpace = true; group1LData.horizontalAlignment = GridData.FILL; // group1LData.heightHint = 9; group1.setLayoutData(group1LData); group1.setText(Messages.FreqAnalysisUI_usagedescisionlabel); button1 = new Button(group1, SWT.RADIO | SWT.LEFT); GridData button1LData = new GridData(); button1LData.grabExcessHorizontalSpace = true; button1LData.horizontalAlignment = GridData.FILL; button1.setLayoutData(button1LData); button1.setText(Messages.FreqAnalysisUI_descision1label); button1.addSelectionListener( new SelectionAdapter() { public void widgetSelected(SelectionEvent evt) { switchComposites(evt); } }); button1.setSelection(false); button2 = new Button(group1, SWT.RADIO | SWT.LEFT); GridData button2LData = new GridData(); button2LData.grabExcessHorizontalSpace = true; button2LData.horizontalAlignment = GridData.FILL; button2.setLayoutData(button2LData); button2.setText(Messages.FreqAnalysisUI_descision2label); button2.addSelectionListener( new SelectionAdapter() { public void widgetSelected(SelectionEvent evt) { switchComposites(evt); } }); button2.setSelection(false); fakebtn = new Button(group1, SWT.RADIO | SWT.LEFT); fakebtn.setText("button3"); // $NON-NLS-1$ GridData fakebtnLData = new GridData(); fakebtnLData.exclude = true; fakebtn.setLayoutData(fakebtnLData); fakebtn.setSelection(true); C1 = new SimpleAnalysisUI(this, SWT.NONE); GridLayout C1Layout = new GridLayout(); C1Layout.makeColumnsEqualWidth = true; GridData C1LData = new GridData(); C1LData.grabExcessHorizontalSpace = true; C1LData.grabExcessVerticalSpace = true; C1LData.horizontalAlignment = GridData.FILL; C1LData.verticalAlignment = GridData.FILL; C1LData.exclude = true; C1.setLayoutData(C1LData); C1.setLayout(C1Layout); C1.setVisible(false); C2 = new FullAnalysisUI(this, SWT.NONE); GridLayout C2Layout = new GridLayout(); C2Layout.makeColumnsEqualWidth = true; GridData C2LData = new GridData(); C2LData.grabExcessHorizontalSpace = true; C2LData.grabExcessVerticalSpace = true; C2LData.verticalAlignment = GridData.FILL; C2LData.horizontalAlignment = GridData.FILL; C2LData.exclude = true; C2.setLayoutData(C2LData); C2.setLayout(C2Layout); C2.setVisible(false); this.layout(); } catch (Exception e) { LogUtil.logError(FreqAnalysisPlugin.PLUGIN_ID, e); } }