Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTristan Faure2015-08-21 16:29:18 +0000
committerGerrit Code Review @ Eclipse.org2015-08-21 16:29:18 +0000
commit678c70289a2bc70a16754b11fbf769b03181979b (patch)
tree931a36abb8ef274d4c5854e091edf7fcadb2b06f
parent955b791831091ceee69850dc1e9a19dc4dddd0f8 (diff)
parentdf4e7efe8331543ee3db685e1afa5c602d3ccfbc (diff)
downloadorg.eclipse.gendoc-0.5-maintenance.tar.gz
org.eclipse.gendoc-0.5-maintenance.tar.xz
org.eclipse.gendoc-0.5-maintenance.zip
Merge "Bug 475266 - [Papyrus] Exception when right click on a "one filed" papyrus model" into 0.5-maintenance0.5-maintenance
-rw-r--r--plugins/org.eclipse.gendoc.wizard/plugin.xml4
-rw-r--r--plugins/org.eclipse.gendoc.wizard/src/org/eclipse/gendoc/wizard/GendocWizardPage.java7
-rw-r--r--plugins/org.eclipse.gendoc.wizard/src/org/eclipse/gendoc/wizard/Utils.java7
3 files changed, 14 insertions, 4 deletions
diff --git a/plugins/org.eclipse.gendoc.wizard/plugin.xml b/plugins/org.eclipse.gendoc.wizard/plugin.xml
index 6cb76e9..8409d41 100644
--- a/plugins/org.eclipse.gendoc.wizard/plugin.xml
+++ b/plugins/org.eclipse.gendoc.wizard/plugin.xml
@@ -27,6 +27,10 @@
<iterate
ifEmpty="false">
<or>
+ <test
+ forcePluginActivation="true"
+ property="org.eclipse.gendoc.wizard.isEnabled">
+ </test>
<adapt
type="org.eclipse.core.resources.IFile">
<test
diff --git a/plugins/org.eclipse.gendoc.wizard/src/org/eclipse/gendoc/wizard/GendocWizardPage.java b/plugins/org.eclipse.gendoc.wizard/src/org/eclipse/gendoc/wizard/GendocWizardPage.java
index 108460e..7f139f0 100644
--- a/plugins/org.eclipse.gendoc.wizard/src/org/eclipse/gendoc/wizard/GendocWizardPage.java
+++ b/plugins/org.eclipse.gendoc.wizard/src/org/eclipse/gendoc/wizard/GendocWizardPage.java
@@ -168,8 +168,13 @@ public class GendocWizardPage extends WizardPage {
IFile[] files = getGWizard().getInputFiles();
IGendocRunner selectedRunner = null;
if (getGWizard().getRunners().size() == 1) {
- fileForTemplate = files[0];
selectedRunner = getGWizard().getRunners().get(0);
+ for (IFile f : files) {
+ if (selectedRunner.getPattern().matcher(f.getName())
+ .matches()) {
+ fileForTemplate = f;
+ }
+ }
} else {
if (comboViewer_1 != null
&& comboViewer_1.getSelection() instanceof StructuredSelection) {
diff --git a/plugins/org.eclipse.gendoc.wizard/src/org/eclipse/gendoc/wizard/Utils.java b/plugins/org.eclipse.gendoc.wizard/src/org/eclipse/gendoc/wizard/Utils.java
index 84fb7a9..5a08fab 100644
--- a/plugins/org.eclipse.gendoc.wizard/src/org/eclipse/gendoc/wizard/Utils.java
+++ b/plugins/org.eclipse.gendoc.wizard/src/org/eclipse/gendoc/wizard/Utils.java
@@ -41,10 +41,11 @@ public class Utils
}
else
{
+ Collection<IFile> files = new LinkedList<IFile>();
IFile f = (IFile) Platform.getAdapterManager().getAdapter(o, IFile.class);
if (f != null)
{
- return new IFile[] {f} ;
+ files.add(f) ;
}
Collection<?> collec = (Collection<?>) Platform.getAdapterManager().getAdapter(o, Collection.class);
if (collec != null)
@@ -60,11 +61,11 @@ public class Utils
}
if (ok)
{
- return collec.toArray(new IFile[]{});
+ files.addAll((Collection<? extends IFile>) collec);
}
}
+ return files.toArray(new IFile[]{});
}
- return null ;
}
/**

Back to the top