Author: snjeza
Date: 2012-01-07 15:46:19 -0500 (Sat, 07 Jan 2012)
New Revision: 37708
Modified:
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/wizard/NewProjectExamplesWizard.java
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/wizard/NewProjectExamplesWizardPage.java
Log:
JBIDE-10603
https://issues.jboss.org/browse/JBIDE-10603
Modified:
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/wizard/NewProjectExamplesWizard.java
===================================================================
---
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/wizard/NewProjectExamplesWizard.java 2012-01-07
01:44:41 UTC (rev 37707)
+++
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/wizard/NewProjectExamplesWizard.java 2012-01-07
20:46:19 UTC (rev 37708)
@@ -45,7 +45,6 @@
@Override
public boolean performFinish() {
- page.finishPage();
final List<Project> selectedProjects = new ArrayList<Project>();
if (page.getSelection() == null || page.getSelection().size() <= 0) {
return false;
Modified:
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/wizard/NewProjectExamplesWizardPage.java
===================================================================
---
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/wizard/NewProjectExamplesWizardPage.java 2012-01-07
01:44:41 UTC (rev 37707)
+++
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/wizard/NewProjectExamplesWizardPage.java 2012-01-07
20:46:19 UTC (rev 37708)
@@ -91,8 +91,7 @@
private Composite noteComposite;
private List<Category> categories;
private Text descriptionText;
- private Button isWorkspace;
- private Text outputDirectoryText;
+
public NewProjectExamplesWizardPage() {
super("org.jboss.tools.project.examples"); //$NON-NLS-1$
@@ -107,8 +106,6 @@
GridData gd = new GridData(SWT.FILL, SWT.FILL, false, false);
composite.setLayoutData(gd);
- //createOutputDirectoryGroup(composite);
-
Composite siteComposite = new Composite(composite,SWT.NONE);
GridLayout gridLayout = new GridLayout(2,false);
gridLayout.marginHeight = 0;
@@ -325,68 +322,7 @@
siteCombo.setText(ProjectExamplesActivator.ALL_SITES);
}
- private void createOutputDirectoryGroup(Composite composite) {
- GridData gd;
- Group outputDirectoryGroup = new Group(composite, SWT.NONE);
- GridLayout layout = new GridLayout(2, false);
- outputDirectoryGroup.setLayout(layout);
- outputDirectoryGroup.setText(Messages.ProjectExamplesPreferencePage_Output_directory);
- gd = new GridData(SWT.FILL, SWT.FILL, true, false);
- outputDirectoryGroup.setLayoutData(gd);
-
- isWorkspace = new Button(outputDirectoryGroup, SWT.CHECK);
- gd = new GridData(SWT.FILL, SWT.FILL, true, false);
- gd.horizontalSpan = 2;
- isWorkspace.setLayoutData(gd);
- isWorkspace.setText(Messages.ProjectExamplesPreferencePage_Use_default_workspace_location);
- isWorkspace.setSelection(ProjectExamplesActivator.getDefault().getPreferenceStore().getBoolean(ProjectExamplesActivator.PROJECT_EXAMPLES_DEFAULT));
-
- outputDirectoryText = new Text(outputDirectoryGroup, SWT.SINGLE|SWT.BORDER);
- gd = new GridData(SWT.FILL, SWT.FILL, true, false);
- gd.verticalAlignment = SWT.CENTER;
- outputDirectoryText.setLayoutData(gd);
- final IPreferenceStore store =
ProjectExamplesActivator.getDefault().getPreferenceStore();
- String outputDirectoryValue =
store.getString(ProjectExamplesActivator.PROJECT_EXAMPLES_OUTPUT_DIRECTORY);
- outputDirectoryText.setText(outputDirectoryValue == null ? "" :
outputDirectoryValue); //$NON-NLS-1$
- final Button outputDirectoryBrowse = new Button(outputDirectoryGroup, SWT.PUSH);
- outputDirectoryBrowse.setText(Messages.Browse);
- outputDirectoryBrowse.addSelectionListener(new SelectionAdapter(){
-
- @Override
- public void widgetSelected(SelectionEvent e) {
- DirectoryDialog dialog = new DirectoryDialog(getShell(), SWT.SINGLE);
- String value = outputDirectoryText.getText();
- if (value.trim().length() == 0) {
- value = Platform.getLocation().toOSString();
- }
- dialog.setFilterPath(value);
-
- String result = dialog.open();
- if (result == null || result.trim().length() == 0) {
- return;
- }
- outputDirectoryText.setText(result);
-
- }
-
- });
- enableControls(outputDirectoryBrowse);
-
- isWorkspace.addSelectionListener(new SelectionAdapter() {
-
- @Override
- public void widgetSelected(SelectionEvent e) {
- enableControls(outputDirectoryBrowse);
- }
-
- });
- }
- protected void enableControls(Button outputDirectoryBrowse) {
- outputDirectoryText.setEnabled(!isWorkspace.getSelection());
- outputDirectoryBrowse.setEnabled(!isWorkspace.getSelection());
- }
-
private void configureSizeAndLocation() {
Shell shell = getContainer().getShell();
Point size = new Point(DEFAULT_WIDTH, getHeight());
@@ -658,11 +594,4 @@
details.setEnabled(true);
}
- public void finishPage() {
- final IPreferenceStore store =
ProjectExamplesActivator.getDefault().getPreferenceStore();
- store.setValue(ProjectExamplesActivator.PROJECT_EXAMPLES_DEFAULT,
isWorkspace.getSelection());
- if (outputDirectoryText.getText().trim().length() > 0) {
- store.setValue(ProjectExamplesActivator.PROJECT_EXAMPLES_OUTPUT_DIRECTORY,
outputDirectoryText.getText());
- }
- }
}