Author: koen.aers(a)jboss.com
Date: 2010-10-20 14:19:15 -0400 (Wed, 20 Oct 2010)
New Revision: 25952
Modified:
trunk/jbpm/plugins/org.jbpm.gd.jpdl/src/org/jbpm/gd/common/editor/Editor.java
trunk/jbpm/plugins/org.jbpm.gd.jpdl/src/org/jbpm/gd/jpdl/wizard/NewProcessDefinitionWizard.java
trunk/jbpm/plugins/org.jbpm.gd.jpdl/src/org/jbpm/gd/jpdl/wizard/NewProcessDefinitionWizardPage.java
Log:
JBIDE-7369
Modified: trunk/jbpm/plugins/org.jbpm.gd.jpdl/src/org/jbpm/gd/common/editor/Editor.java
===================================================================
---
trunk/jbpm/plugins/org.jbpm.gd.jpdl/src/org/jbpm/gd/common/editor/Editor.java 2010-10-20
17:55:41 UTC (rev 25951)
+++
trunk/jbpm/plugins/org.jbpm.gd.jpdl/src/org/jbpm/gd/common/editor/Editor.java 2010-10-20
18:19:15 UTC (rev 25952)
@@ -9,6 +9,7 @@
import org.eclipse.core.resources.ResourceAttributes;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.Path;
import org.eclipse.gef.DefaultEditDomain;
import org.eclipse.gef.EditDomain;
import org.eclipse.gef.commands.CommandStack;
@@ -336,9 +337,9 @@
private boolean checkReadOnly() {
IFile inputFile = ((FileEditorInput)getEditorInput()).getFile();
- IFolder inputFolder = (IFolder)inputFile.getParent();
- IFile notationInfoFile =
inputFolder.getFile(getContentProvider().getNotationInfoFileName(inputFile.getName()));
- IFile diagramImageFile =
inputFolder.getFile(getContentProvider().getDiagramImageFileName(inputFile.getName()));
+ IContainer inputFolder = (IContainer)inputFile.getParent();
+ IFile notationInfoFile = inputFolder.getFile(new
Path(getContentProvider().getNotationInfoFileName(inputFile.getName())));
+ IFile diagramImageFile = inputFolder.getFile(new
Path(getContentProvider().getDiagramImageFileName(inputFile.getName())));
String readOnlyFiles = "";
ArrayList readOnlyFilesList = new ArrayList();
if (inputFile.isReadOnly()) {
Modified:
trunk/jbpm/plugins/org.jbpm.gd.jpdl/src/org/jbpm/gd/jpdl/wizard/NewProcessDefinitionWizard.java
===================================================================
---
trunk/jbpm/plugins/org.jbpm.gd.jpdl/src/org/jbpm/gd/jpdl/wizard/NewProcessDefinitionWizard.java 2010-10-20
17:55:41 UTC (rev 25951)
+++
trunk/jbpm/plugins/org.jbpm.gd.jpdl/src/org/jbpm/gd/jpdl/wizard/NewProcessDefinitionWizard.java 2010-10-20
18:19:15 UTC (rev 25952)
@@ -73,10 +73,9 @@
public boolean performFinish() {
try {
- IFolder folder = page.getProcessFolder();
- IFile processDefinitionFile = folder.getFile(page.getProcessName() +
".jpdl.xml");
+ IFile processDefinitionFile = page.getProcessDefinitionFile();
processDefinitionFile.create(createInitialProcessDefinition(), true, null);
- IFile gpdFile = folder.getFile("." + page.getProcessName() +
".gpd.xml");
+ IFile gpdFile = page.getGpdFile();
gpdFile.create(createInitialGpdInfo(), true, null);
IDE.openEditor(getActivePage(), processDefinitionFile);
openPropertiesView();
@@ -135,7 +134,7 @@
private String getJbpmSchemaNameSpace() throws JavaModelException {
try {
- IProject project = page.getProcessFolder().getProject();
+ IProject project = page.getProcessDefinitionFile().getProject();
String jbpmName = project.getPersistentProperty(new QualifiedName("",
"jbpmName"));
if (jbpmName == null) return "";
JbpmInstallation jbpmInstallation =
Jbpm3PreferencesManager.INSTANCE.getJbpmInstallation(jbpmName);
Modified:
trunk/jbpm/plugins/org.jbpm.gd.jpdl/src/org/jbpm/gd/jpdl/wizard/NewProcessDefinitionWizardPage.java
===================================================================
---
trunk/jbpm/plugins/org.jbpm.gd.jpdl/src/org/jbpm/gd/jpdl/wizard/NewProcessDefinitionWizardPage.java 2010-10-20
17:55:41 UTC (rev 25951)
+++
trunk/jbpm/plugins/org.jbpm.gd.jpdl/src/org/jbpm/gd/jpdl/wizard/NewProcessDefinitionWizardPage.java 2010-10-20
18:19:15 UTC (rev 25952)
@@ -23,7 +23,6 @@
import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IFolder;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IWorkspaceRoot;
@@ -233,16 +232,27 @@
}
private boolean processExists() {
- IFolder folder = getProcessFolder();
- IFile processDefinitionFile = folder.getFile(getProcessName() +
".jpdl.xml");
- IFile gpdFile = folder.getFile("." + getProcessName() +
".gpd.xml");
- return processDefinitionFile.exists() || gpdFile.exists();
+ return getProcessDefinitionFile().exists() || getGpdFile().exists();
}
- public IFolder getProcessFolder() {
- return workspaceRoot.getFolder(new Path(containerText.getText()));
+ private IPath getProcessDefinitionFilePath() {
+ String path = containerText.getText() + "/" + getProcessName() +
".jpdl.xml";
+ return new Path(path);
}
+ private IPath getGpdFilePath() {
+ String path = containerText.getText() + "/." + getProcessName() +
".gpd.xml";
+ return new Path(path);
+ }
+
+ IFile getProcessDefinitionFile() {
+ return workspaceRoot.getFile(getProcessDefinitionFilePath());
+ }
+
+ IFile getGpdFile() {
+ return workspaceRoot.getFile(getGpdFilePath());
+ }
+
public String getProcessName() {
return processNameText.getText();
}
Show replies by date