Mercurial > hg > thermostat-tools-eclipse
changeset 116:b48371bbae86
Rename things for consistency
author | Omair Majid <omajid@redhat.com> |
---|---|
date | Tue, 04 Mar 2014 18:08:11 -0500 |
parents | d79c9d0a308d |
children | 4d787bcff36c |
files | com.redhat.thermostat.tools.eclipse.plugin/src/com/redhat/thermostat/tools/eclipse/plugin/editor/NewBundleDialog.java |
diffstat | 1 files changed, 59 insertions(+), 59 deletions(-) [+] |
line wrap: on
line diff
--- a/com.redhat.thermostat.tools.eclipse.plugin/src/com/redhat/thermostat/tools/eclipse/plugin/editor/NewBundleDialog.java Tue Mar 04 15:49:05 2014 -0500 +++ b/com.redhat.thermostat.tools.eclipse.plugin/src/com/redhat/thermostat/tools/eclipse/plugin/editor/NewBundleDialog.java Tue Mar 04 18:08:11 2014 -0500 @@ -34,17 +34,17 @@ private ThermostatBundleInformation thermostatInfo = new ThermostatBundleInformation(); - private Button thermostatBundlesSelectionButton; - private Combo thermostatVersion; - private Combo thermostatBundle; + private Button thermostatBundlesSelector; + private Combo thermostatBundleVersion; + private Combo thermostatBundleName; - private Button manualSelectionButton; - private Text customNameText; - private Text customVersionText; + private Button manualBundleSelector; + private Text manualBundleName; + private Text manualBundleVersion; - private Button fromJarButton; - private Text fileLocationText; - private Button btnFromFile; + private Button manualJarSelector; + private Text manualJarLocation; + private Button manualJarFindFile; public NewBundleDialog(Shell parentShell) { super(parentShell); @@ -71,33 +71,33 @@ containerLayout.marginLeft = 5; container.setLayout(containerLayout); - thermostatBundlesSelectionButton = new Button(container, SWT.RADIO); - thermostatBundlesSelectionButton.setSelection(true); - thermostatBundlesSelectionButton.addSelectionListener(new SelectionAdapter() { + thermostatBundlesSelector = new Button(container, SWT.RADIO); + thermostatBundlesSelector.setSelection(true); + thermostatBundlesSelector.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { disableInputWidgets(); - thermostatVersion.setEnabled(true); - thermostatBundle.setEnabled(true); + thermostatBundleVersion.setEnabled(true); + thermostatBundleName.setEnabled(true); } }); - thermostatBundlesSelectionButton.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 3, 1)); - thermostatBundlesSelectionButton.setText("Thermostat Bundle"); + thermostatBundlesSelector.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 3, 1)); + thermostatBundlesSelector.setText("Thermostat Bundle"); Label thermostatVersionLabel = new Label(container, SWT.None); thermostatVersionLabel.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false)); thermostatVersionLabel.setText("Version"); - thermostatVersion = new Combo(container, SWT.None); + thermostatBundleVersion = new Combo(container, SWT.None); GridData thermostatVersionLayoutData = new GridData(SWT.FILL, SWT.BEGINNING, true, false, 2, 1); - thermostatVersion.setLayoutData(thermostatVersionLayoutData); - thermostatVersion.setItems(toArray(thermostatInfo.getVersions())); - thermostatVersion.addSelectionListener(new SelectionAdapter() { + thermostatBundleVersion.setLayoutData(thermostatVersionLayoutData); + thermostatBundleVersion.setItems(toArray(thermostatInfo.getVersions())); + thermostatBundleVersion.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { - String selectedVersion = thermostatVersion.getItem(thermostatVersion.getSelectionIndex()); - thermostatBundle.setItems(toArray(thermostatInfo.getBundleNames(selectedVersion))); + String selectedVersion = thermostatBundleVersion.getItem(thermostatBundleVersion.getSelectionIndex()); + thermostatBundleName.setItems(toArray(thermostatInfo.getBundleNames(selectedVersion))); } }); @@ -105,88 +105,88 @@ thermostatBundleLabel.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false)); thermostatBundleLabel.setText("Bundle"); - thermostatBundle = new Combo(container, SWT.NONE); + thermostatBundleName = new Combo(container, SWT.NONE); GridData thermostatBundleLayoutData = new GridData(SWT.FILL, SWT.BEGINNING, true, false, 2, 1); - thermostatBundle.setLayoutData(thermostatBundleLayoutData); + thermostatBundleName.setLayoutData(thermostatBundleLayoutData); - manualSelectionButton = new Button(container, SWT.RADIO); - manualSelectionButton.addSelectionListener(new SelectionAdapter() { + manualBundleSelector = new Button(container, SWT.RADIO); + manualBundleSelector.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { disableInputWidgets(); - customNameText.setEnabled(true); - customVersionText.setEnabled(true); + manualBundleName.setEnabled(true); + manualBundleVersion.setEnabled(true); } }); - manualSelectionButton.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 3, 1)); - manualSelectionButton.setText(Messages.NewBundleDialog_manualSectionTitle); + manualBundleSelector.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 3, 1)); + manualBundleSelector.setText(Messages.NewBundleDialog_manualSectionTitle); Label nameLabel = new Label(container, SWT.None); nameLabel.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false)); nameLabel.setText(Messages.NewBundleDialog_symbolicNameLabel); - customNameText = new Text(container, SWT.None); + manualBundleName = new Text(container, SWT.None); GridData nameTextLayoutData = new GridData(SWT.FILL, SWT.BEGINNING, true, false); nameTextLayoutData.horizontalSpan = 2; - customNameText.setLayoutData(nameTextLayoutData); + manualBundleName.setLayoutData(nameTextLayoutData); Label versionLabel = new Label(container, SWT.None); versionLabel.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false)); versionLabel.setText(Messages.NewBundleDialog_versionLabel); - customVersionText = new Text(container, SWT.None); + manualBundleVersion = new Text(container, SWT.None); GridData versionTextLayoutData = new GridData(SWT.FILL, SWT.BEGINNING, true, false); versionTextLayoutData.horizontalSpan = 2; - customVersionText.setLayoutData(versionTextLayoutData); + manualBundleVersion.setLayoutData(versionTextLayoutData); - fromJarButton = new Button(container, SWT.RADIO); - fromJarButton.addSelectionListener(new SelectionAdapter() { + manualJarSelector = new Button(container, SWT.RADIO); + manualJarSelector.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { disableInputWidgets(); - fileLocationText.setEnabled(true); - btnFromFile.setEnabled(true); + manualJarLocation.setEnabled(true); + manualJarFindFile.setEnabled(true); } }); - fromJarButton.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 3, 1)); - fromJarButton.setText(Messages.NewBundleDialog_fromJarSectionTitle); + manualJarSelector.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 3, 1)); + manualJarSelector.setText(Messages.NewBundleDialog_fromJarSectionTitle); Label locationLabel = new Label(container, SWT.NONE); locationLabel.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false)); locationLabel.setText(Messages.NewBundleDialog_pathLabel); - fileLocationText = new Text(container, SWT.BORDER); - fileLocationText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false)); + manualJarLocation = new Text(container, SWT.BORDER); + manualJarLocation.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false)); - btnFromFile = new Button(container, SWT.NONE); - btnFromFile.setText(Messages.NewBundleDialog_findOnDisk); - btnFromFile.addSelectionListener(new SelectionAdapter() { + manualJarFindFile = new Button(container, SWT.NONE); + manualJarFindFile.setText(Messages.NewBundleDialog_findOnDisk); + manualJarFindFile.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { FileDialog dialog = new FileDialog(getShell(), SWT.OPEN); dialog.setFilterExtensions(new String[] { "*.jar" }); //$NON-NLS-1$ String result = dialog.open(); if (result != null) { - fileLocationText.setText(result); + manualJarLocation.setText(result); } } }); // invoke manually on startup to enable/disable other widgets - thermostatBundlesSelectionButton.setSelection(true); + thermostatBundlesSelector.setSelection(true); return area; } private void disableInputWidgets() { - thermostatVersion.setEnabled(false); - thermostatBundle.setEnabled(false); + thermostatBundleVersion.setEnabled(false); + thermostatBundleName.setEnabled(false); - customNameText.setEnabled(false); - customVersionText.setEnabled(false); + manualBundleName.setEnabled(false); + manualBundleVersion.setEnabled(false); - fileLocationText.setEnabled(false); - btnFromFile.setEnabled(false); + manualJarLocation.setEnabled(false); + manualJarFindFile.setEnabled(false); } private String[] toArray(List<String> inputList) { @@ -201,14 +201,14 @@ } private void saveInput() { - if (thermostatBundlesSelectionButton.getSelection()) { - bundleInfo = new BundleInformation(thermostatBundle.getText(), thermostatVersion.getText()); - } else if (manualSelectionButton.getSelection()) { - bundleInfo = new BundleInformation(customNameText.getText(), customVersionText.getText()); - } else if (fromJarButton.getSelection()) { + if (thermostatBundlesSelector.getSelection()) { + bundleInfo = new BundleInformation(thermostatBundleName.getText(), thermostatBundleVersion.getText()); + } else if (manualBundleSelector.getSelection()) { + bundleInfo = new BundleInformation(manualBundleName.getText(), manualBundleVersion.getText()); + } else if (manualJarSelector.getSelection()) { try { BundleInformationExtractor extractor = new BundleInformationExtractor(); - BundleInformation extractedInfo = extractor.extract(fileLocationText.getText()); + BundleInformation extractedInfo = extractor.extract(manualJarLocation.getText()); bundleInfo.setName(extractedInfo.getName()); bundleInfo.setVersion(extractedInfo.getVersion()); } catch (final IOException e) {