eclipse plugin: Work with interfaces rather than with...
...concrete classes ( Path -> IPath)
This commit is contained in:
parent
6b04a0c65a
commit
2c073a6df0
5 changed files with 10 additions and 5 deletions
|
@ -4,6 +4,7 @@
|
|||
package org.wesnoth.wizards;
|
||||
|
||||
import org.eclipse.core.resources.ResourcesPlugin;
|
||||
import org.eclipse.core.runtime.IPath;
|
||||
import org.eclipse.core.runtime.Path;
|
||||
import org.eclipse.jface.wizard.WizardPage;
|
||||
import org.eclipse.swt.widgets.Composite;
|
||||
|
@ -35,7 +36,7 @@ public class WizardPageTemplate extends WizardPage
|
|||
* Uses the standard container selection dialog to choose the new value for
|
||||
* the project field.
|
||||
*/
|
||||
public Path handleBrowseContainer()
|
||||
public IPath handleBrowseContainer()
|
||||
{
|
||||
ContainerSelectionDialog dialog = new ContainerSelectionDialog(getShell(),
|
||||
ResourcesPlugin.getWorkspace().getRoot(), false, Messages.NewWizardPageTemplate_1);
|
||||
|
|
|
@ -11,6 +11,7 @@ package org.wesnoth.wizards.era;
|
|||
import org.eclipse.core.resources.IContainer;
|
||||
import org.eclipse.core.resources.IResource;
|
||||
import org.eclipse.core.resources.ResourcesPlugin;
|
||||
import org.eclipse.core.runtime.IPath;
|
||||
import org.eclipse.core.runtime.Path;
|
||||
import org.eclipse.swt.SWT;
|
||||
import org.eclipse.swt.events.ModifyEvent;
|
||||
|
@ -82,7 +83,7 @@ public class EraPage0 extends WizardPageTemplate
|
|||
@Override
|
||||
public void widgetSelected(SelectionEvent e)
|
||||
{
|
||||
Path path = handleBrowseContainer();
|
||||
IPath path = handleBrowseContainer();
|
||||
if (path != null)
|
||||
txtDirectory_.setText(path.toString());
|
||||
}
|
||||
|
|
|
@ -11,6 +11,7 @@ package org.wesnoth.wizards.faction;
|
|||
import org.eclipse.core.resources.IContainer;
|
||||
import org.eclipse.core.resources.IResource;
|
||||
import org.eclipse.core.resources.ResourcesPlugin;
|
||||
import org.eclipse.core.runtime.IPath;
|
||||
import org.eclipse.core.runtime.Path;
|
||||
import org.eclipse.swt.SWT;
|
||||
import org.eclipse.swt.events.ModifyEvent;
|
||||
|
@ -87,7 +88,7 @@ public class FactionPage0 extends WizardPageTemplate
|
|||
@Override
|
||||
public void widgetSelected(SelectionEvent e)
|
||||
{
|
||||
Path path = handleBrowseContainer();
|
||||
IPath path = handleBrowseContainer();
|
||||
if (path != null)
|
||||
txtDirectory_.setText(path.toString());
|
||||
}
|
||||
|
|
|
@ -11,6 +11,7 @@ package org.wesnoth.wizards.generator;
|
|||
import org.eclipse.core.resources.IContainer;
|
||||
import org.eclipse.core.resources.IResource;
|
||||
import org.eclipse.core.resources.ResourcesPlugin;
|
||||
import org.eclipse.core.runtime.IPath;
|
||||
import org.eclipse.core.runtime.Path;
|
||||
import org.eclipse.swt.SWT;
|
||||
import org.eclipse.swt.events.ModifyEvent;
|
||||
|
@ -88,7 +89,7 @@ public class WizardLauncherPage0 extends WizardPageTemplate
|
|||
@Override
|
||||
public void widgetSelected(SelectionEvent e)
|
||||
{
|
||||
Path path = handleBrowseContainer();
|
||||
IPath path = handleBrowseContainer();
|
||||
if (path != null)
|
||||
txtDirectory_.setText(path.toString());
|
||||
}
|
||||
|
|
|
@ -13,6 +13,7 @@ import java.io.File;
|
|||
import org.eclipse.core.resources.IContainer;
|
||||
import org.eclipse.core.resources.IResource;
|
||||
import org.eclipse.core.resources.ResourcesPlugin;
|
||||
import org.eclipse.core.runtime.IPath;
|
||||
import org.eclipse.core.runtime.Path;
|
||||
import org.eclipse.swt.SWT;
|
||||
import org.eclipse.swt.events.ModifyEvent;
|
||||
|
@ -116,7 +117,7 @@ public class ScenarioPage0 extends WizardPageTemplate
|
|||
@Override
|
||||
public void widgetSelected(SelectionEvent e)
|
||||
{
|
||||
Path path = handleBrowseContainer();
|
||||
IPath path = handleBrowseContainer();
|
||||
if (path != null)
|
||||
txtProject_.setText(path.toString());
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue