+ Create Version to work with Ganymede
* Disable Live Validation * PyDev 1.1.2+ compatibility issue + Create Warning when trying to synchronize classes without package
This commit is contained in:
parent
19ec7a8c8d
commit
7611028aa2
@ -2,7 +2,7 @@ Manifest-Version: 1.0
|
||||
Bundle-ManifestVersion: 2
|
||||
Bundle-Name: PyUML
|
||||
Bundle-SymbolicName: pyUml;singleton:=true
|
||||
Bundle-Version: 1.0.1
|
||||
Bundle-Version: 1.2
|
||||
Bundle-Activator: pyUML.plugin.Activator
|
||||
Eclipse-LazyStart: true
|
||||
Bundle-ClassPath: lib/refactoring.jar,
|
||||
|
@ -7,8 +7,8 @@ import org.eclipse.ui.IPropertyListener;
|
||||
import org.eclipse.ui.IWorkbenchWindow;
|
||||
import org.eclipse.ui.PlatformUI;
|
||||
import org.eclipse.uml2.diagram.clazz.part.UMLDiagramEditor;
|
||||
import org.eclipse.uml2.diagram.clazz.part.ValidateAction;
|
||||
import org.eclipse.uml2.diagram.clazz.providers.UMLValidationDecoratorProvider;
|
||||
//import org.eclipse.uml2.diagram.clazz.part.ValidateAction;
|
||||
//import org.eclipse.uml2.diagram.clazz.providers.UMLValidationDecoratorProvider;
|
||||
|
||||
/**
|
||||
* This class is a listener that runs a live validation run,
|
||||
@ -63,13 +63,18 @@ public class LiveValidationListener implements IPropertyListener{
|
||||
|
||||
if (!(ed instanceof UMLDiagramEditor))
|
||||
return;
|
||||
UMLDiagramEditor umlEditor = (UMLDiagramEditor) ed;
|
||||
|
||||
IWorkbenchPartDescriptor desc = new WorkbenchPartDescriptor(umlEditor.getSite().getId(), umlEditor.getSite().getClass(), umlEditor.getSite().getPage());
|
||||
ValidateAction action = new ValidateAction(desc);
|
||||
UMLValidationDecoratorProvider.usedResource = umlEditor.getDiagram().eResource();
|
||||
|
||||
action.run();
|
||||
|
||||
/* TODO: UML2Tools Editor has to be changed with every Eclipse Version
|
||||
for Live Validation.
|
||||
So we are disabling Live Validation for now! */
|
||||
|
||||
// UMLDiagramEditor umlEditor = (UMLDiagramEditor) ed;
|
||||
//
|
||||
// IWorkbenchPartDescriptor desc = new WorkbenchPartDescriptor(umlEditor.getSite().getId(), umlEditor.getSite().getClass(), umlEditor.getSite().getPage());
|
||||
// ValidateAction action = new ValidateAction(desc);
|
||||
// UMLValidationDecoratorProvider.usedResource = umlEditor.getDiagram().eResource();
|
||||
//
|
||||
// action.run();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -464,6 +464,18 @@ public class PythonTreeClass extends PythonTreeNode {
|
||||
* deleted and newly created
|
||||
*/
|
||||
public boolean synchronizeModel(NamedElement modelElement){
|
||||
|
||||
/* only classes in packages are supported. If we find a top-level-class,
|
||||
* exit with warning! */
|
||||
if (super.getParent().isRoot()) {
|
||||
if (getRoot().isShowWarnings()) {
|
||||
MessageDialog.openWarning(null, "Error: Top level class detected!",
|
||||
"Please use in model and code *only* classes inside packages!\n" +
|
||||
"The class was: " + this.getInFile().getName());
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// run super method to save corresponding model element
|
||||
super.synchronizeModel(modelElement);
|
||||
Classifier modelClass = (Classifier) modelElement;
|
||||
|
@ -336,6 +336,16 @@ public class PythonTreePackage extends PythonTreeNode{
|
||||
// handle child classes in model
|
||||
else if (modelChild instanceof Class || modelChild instanceof Interface) {
|
||||
Classifier modelChildClass = (Classifier) modelChild;
|
||||
|
||||
/* only classes in packages are supported. If we find a top-level-class,
|
||||
* exit with warning! */
|
||||
if (isRoot()) {
|
||||
MessageDialog.openWarning(null, "Error: Top level class detected!",
|
||||
"Please use in model and code *only* classes inside packages!\n" +
|
||||
"The class was: " + modelChildClass.getName());
|
||||
continue globalLoop;
|
||||
}
|
||||
|
||||
this.getRoot().worked(this.getName() + "/" + modelChildClass.getName());
|
||||
this.getRoot().setSubTaskName(this.getName() + "/" + modelChildClass.getName());
|
||||
String xmi_id = modelXmiDict.get(modelChildClass);
|
||||
|
@ -44,7 +44,7 @@ public class BicycleRefactoring {
|
||||
AbstractShell pytonShell = AbstractShell.getServerShell(pythonNature, AbstractShell.OTHERS_SHELL);
|
||||
String output = "";
|
||||
try{
|
||||
pytonShell.changePythonPath(pythonNature.getPythonPathNature().getCompleteProjectPythonPath(null)); //default
|
||||
pytonShell.changePythonPath(pythonNature.getPythonPathNature().getCompleteProjectPythonPath(null, null)); //default
|
||||
pytonShell.write(refactorCommand);
|
||||
output = URLDecoder.decode(pytonShell.read((IProgressMonitor)null), "UTF-8");
|
||||
} catch (Exception e) {
|
||||
|
Loading…
Reference in New Issue
Block a user