diff options
author | tle | 2010-01-12 16:51:06 +0000 |
---|---|---|
committer | tle | 2010-01-12 16:51:06 +0000 |
commit | 853bebeb7cbd752ace09bb32de1565ef96d0bf68 (patch) | |
tree | bd577af51eb9a77acd35e6b9dad10956124a513b | |
parent | 0bfed147344ec78d1d3dcab83033d975066d879f (diff) | |
download | webtools.dali-853bebeb7cbd752ace09bb32de1565ef96d0bf68.tar.gz webtools.dali-853bebeb7cbd752ace09bb32de1565ef96d0bf68.tar.xz webtools.dali-853bebeb7cbd752ace09bb32de1565ef96d0bf68.zip |
Made changes for subclassing
2 files changed, 24 insertions, 16 deletions
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/widgets/FileChooserPane.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/widgets/FileChooserPane.java index 2a4ef145c5..ae1ae935f7 100644 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/widgets/FileChooserPane.java +++ b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/widgets/FileChooserPane.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2008 Oracle. All rights reserved. + * Copyright (c) 2008, 2010 Oracle. All rights reserved. * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v1.0, which accompanies this distribution * and is available at http://www.eclipse.org/legal/epl-v10.html. @@ -102,7 +102,7 @@ public abstract class FileChooserPane<T extends Model> extends ChooserPane<T> @Override protected Control addMainControl(Composite container) { - return addText(container, this.textHolder); + return this.addText(container, this.textHolder); } private PostExecution<ElementTreeSelectionDialog> buildSelectionDialogPostExecution() { @@ -163,10 +163,14 @@ public abstract class FileChooserPane<T extends Model> extends ChooserPane<T> */ protected abstract IResource getDialogInput(); + protected WritablePropertyValueModel<String> getTextHolder() { + return this.textHolder; + } + @Override protected void initialize() { super.initialize(); - this.textHolder = buildTextHolder(); + this.textHolder = this.buildTextHolder(); } /** @@ -176,19 +180,19 @@ public abstract class FileChooserPane<T extends Model> extends ChooserPane<T> protected void promptFile() { ElementTreeSelectionDialog dialog = new ElementTreeSelectionDialog( - getShell(), + this.getShell(), new WorkbenchLabelProvider(), new WorkbenchContentProvider() ); dialog.setHelpAvailable(false); - dialog.setValidator(buildValidator()); - dialog.setTitle(getDialogTitle()); - dialog.setMessage(getDialogMessage()); - dialog.addFilter(buildFilter()); - dialog.setInput(getDialogInput()); + dialog.setValidator(this.buildValidator()); + dialog.setTitle(this.getDialogTitle()); + dialog.setMessage(this.getDialogMessage()); + dialog.addFilter(this.buildFilter()); + dialog.setInput(this.getDialogInput()); dialog.setComparator(new ResourceComparator(ResourceComparator.NAME)); - SWTUtil.show(dialog, buildSelectionDialogPostExecution()); + SWTUtil.show(dialog, this.buildSelectionDialogPostExecution()); } } diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/widgets/FolderChooserPane.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/widgets/FolderChooserPane.java index c1359f6c12..001b70c95c 100644 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/widgets/FolderChooserPane.java +++ b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/widgets/FolderChooserPane.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2008, 2009 Oracle. All rights reserved. + * Copyright (c) 2008, 20010 Oracle. All rights reserved. * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v1.0, which accompanies this distribution * and is available at http://www.eclipse.org/legal/epl-v10.html. @@ -71,7 +71,7 @@ public abstract class FolderChooserPane<T extends Model> extends ChooserPane<T> @Override protected Control addMainControl(Composite container) { - return addText(container, this.textHolder); + return this.addText(container, this.textHolder); } /** @@ -111,10 +111,14 @@ public abstract class FolderChooserPane<T extends Model> extends ChooserPane<T> return null; } + protected WritablePropertyValueModel<String> getTextHolder() { + return this.textHolder; + } + @Override protected void initialize() { super.initialize(); - this.textHolder = buildTextHolder(); + this.textHolder = this.buildTextHolder(); } /** @@ -124,9 +128,9 @@ public abstract class FolderChooserPane<T extends Model> extends ChooserPane<T> protected void promptFolder() { DirectoryDialog dialog = new DirectoryDialog(getShell()); - dialog.setMessage(getDialogMessage()); - dialog.setText(getDialogTitle()); - dialog.setFilterPath(filterPath()); + dialog.setMessage(this.getDialogMessage()); + dialog.setText(this.getDialogTitle()); + dialog.setFilterPath(this.filterPath()); String directory = dialog.open(); if (directory != null) { |