Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorashatalin2006-06-05 16:33:13 +0000
committerashatalin2006-06-05 16:33:13 +0000
commit9fe7d2e8627e3c45619d176be9d3942c02cc6fff (patch)
treed91403bcdad01dbaf2fcc6c3da98ea24df8817ed /plugins
parenteca024ffe1abc9cd7e6bb9acff979969cd2c28c7 (diff)
downloadorg.eclipse.gmf-tooling-9fe7d2e8627e3c45619d176be9d3942c02cc6fff.tar.gz
org.eclipse.gmf-tooling-9fe7d2e8627e3c45619d176be9d3942c02cc6fff.tar.xz
org.eclipse.gmf-tooling-9fe7d2e8627e3c45619d176be9d3942c02cc6fff.zip
- ElementChooserDialog title generated
- diagram file extension marked as non-nls
Diffstat (limited to 'plugins')
-rw-r--r--plugins/org.eclipse.gmf.codegen/src-templates/org/eclipse/gmf/codegen/templates/editor/ElementChooserGenerator.java2
-rw-r--r--plugins/org.eclipse.gmf.codegen/src-templates/org/eclipse/gmf/codegen/templates/editor/NewDiagramFileWizardGenerator.java2
-rw-r--r--plugins/org.eclipse.gmf.codegen/templates/editor/ElementChooser.javajet1
-rw-r--r--plugins/org.eclipse.gmf.codegen/templates/editor/NewDiagramFileWizard.javajet2
-rw-r--r--plugins/org.eclipse.gmf.graphdef.editor/src/org/eclipse/gmf/graphdef/editor/part/GMFGraphElementChooserDialog.java1
-rw-r--r--plugins/org.eclipse.gmf.graphdef.editor/src/org/eclipse/gmf/graphdef/editor/part/GMFGraphNewDiagramFileWizard.java2
6 files changed, 6 insertions, 4 deletions
diff --git a/plugins/org.eclipse.gmf.codegen/src-templates/org/eclipse/gmf/codegen/templates/editor/ElementChooserGenerator.java b/plugins/org.eclipse.gmf.codegen/src-templates/org/eclipse/gmf/codegen/templates/editor/ElementChooserGenerator.java
index 8e44e78f3..3ff903956 100644
--- a/plugins/org.eclipse.gmf.codegen/src-templates/org/eclipse/gmf/codegen/templates/editor/ElementChooserGenerator.java
+++ b/plugins/org.eclipse.gmf.codegen/src-templates/org/eclipse/gmf/codegen/templates/editor/ElementChooserGenerator.java
@@ -22,7 +22,7 @@ public class ElementChooserGenerator
protected final String TEXT_4 = NL + NL + "import java.util.Collections;" + NL + "" + NL + "import org.eclipse.core.resources.IContainer;" + NL + "import org.eclipse.core.resources.IFile;" + NL + "import org.eclipse.core.resources.ResourcesPlugin;" + NL + "import org.eclipse.core.runtime.IPath;" + NL + "import org.eclipse.core.runtime.Path;" + NL + "import org.eclipse.emf.common.util.URI;" + NL + "import org.eclipse.emf.common.util.WrappedException;" + NL + "import org.eclipse.emf.ecore.EObject;" + NL + "import org.eclipse.emf.ecore.resource.Resource;" + NL + "import org.eclipse.emf.ecore.resource.ResourceSet;" + NL + "import org.eclipse.emf.edit.domain.EditingDomain;" + NL + "import org.eclipse.emf.edit.ui.provider.AdapterFactoryContentProvider;" + NL + "import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider;" + NL + "import org.eclipse.gmf.runtime.diagram.core.services.ViewService;" + NL + "import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;" + NL + "import org.eclipse.gmf.runtime.emf.core.GMFEditingDomainFactory;" + NL + "import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;" + NL + "import org.eclipse.gmf.runtime.notation.Node;" + NL + "import org.eclipse.gmf.runtime.notation.View;" + NL + "import org.eclipse.jface.dialogs.Dialog;" + NL + "import org.eclipse.jface.dialogs.IDialogConstants;" + NL + "import org.eclipse.jface.viewers.ILabelProvider;" + NL + "import org.eclipse.jface.viewers.ILabelProviderListener;" + NL + "import org.eclipse.jface.viewers.ISelectionChangedListener;" + NL + "import org.eclipse.jface.viewers.IStructuredSelection;" + NL + "import org.eclipse.jface.viewers.ITreeContentProvider;" + NL + "import org.eclipse.jface.viewers.SelectionChangedEvent;" + NL + "import org.eclipse.jface.viewers.TreeViewer;" + NL + "import org.eclipse.jface.viewers.Viewer;" + NL + "import org.eclipse.jface.viewers.ViewerFilter;" + NL + "import org.eclipse.swt.SWT;" + NL + "import org.eclipse.swt.graphics.Image;" + NL + "import org.eclipse.swt.layout.GridData;" + NL + "import org.eclipse.swt.widgets.Composite;" + NL + "import org.eclipse.swt.widgets.Control;" + NL + "import org.eclipse.swt.widgets.Shell;" + NL + "import org.eclipse.ui.model.WorkbenchContentProvider;" + NL + "import org.eclipse.ui.model.WorkbenchLabelProvider;";
protected final String TEXT_5 = NL + NL + "/**" + NL + " * @generated" + NL + " */" + NL + "public class ";
protected final String TEXT_6 = " extends Dialog {" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate TreeViewer myTreeViewer;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate EObject mySelectedModelElement;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate View myView;" + NL + "\t" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate EditingDomain myEditingDomain = GMFEditingDomainFactory.INSTANCE.createEditingDomain();" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic ";
- protected final String TEXT_7 = "(Shell parentShell, View view) {" + NL + "\t\tsuper(parentShell);" + NL + "\t\tsetShellStyle(getShellStyle() | SWT.RESIZE);" + NL + "\t\tmyView = view;" + NL + "\t}" + NL + "\t" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected Control createDialogArea(Composite parent) {" + NL + "\t\tComposite composite = (Composite) super.createDialogArea(parent);" + NL + "\t\tcreateModelBrowser(composite);" + NL + "\t\treturn composite;" + NL + "\t}" + NL + "\t" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected Control createButtonBar(Composite parent) {" + NL + "\t\tControl buttonBar = super.createButtonBar(parent);" + NL + "\t\tsetOkButtonEnabled(false);" + NL + "\t\treturn buttonBar;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate void createModelBrowser(Composite composite) {" + NL + "\t\tmyTreeViewer = new TreeViewer(composite, SWT.SINGLE | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);" + NL + "\t\tGridData layoutData = new GridData(GridData.FILL_BOTH);" + NL + "\t\tlayoutData.heightHint = 300;" + NL + "\t\tlayoutData.widthHint = 300;" + NL + "\t\tmyTreeViewer.getTree().setLayoutData(layoutData);" + NL + "\t\tmyTreeViewer.setContentProvider(new ModelElementsTreeContentProvider());" + NL + "\t\tmyTreeViewer.setLabelProvider(new ModelElementsTreeLabelProvider());" + NL + "\t\tmyTreeViewer.setInput(ResourcesPlugin.getWorkspace().getRoot());" + NL + "\t\tmyTreeViewer.addFilter(new ModelFilesFilter());" + NL + "\t\tmyTreeViewer.addSelectionChangedListener(new OkButtonEnabler());" + NL + "\t}" + NL + "\t" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate void setOkButtonEnabled(boolean enabled) {" + NL + "\t\tgetButton(IDialogConstants.OK_ID).setEnabled(enabled);" + NL + "\t}" + NL + "\t" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate boolean isValidModelFile(IFile file) {" + NL + "\t\tString fileExtension = file.getFullPath().getFileExtension();" + NL + "\t\treturn ";
+ protected final String TEXT_7 = "(Shell parentShell, View view) {" + NL + "\t\tsuper(parentShell);" + NL + "\t\tsetShellStyle(getShellStyle() | SWT.RESIZE);" + NL + "\t\tmyView = view;" + NL + "\t}" + NL + "\t" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected Control createDialogArea(Composite parent) {" + NL + "\t\tComposite composite = (Composite) super.createDialogArea(parent);" + NL + "\t\tgetShell().setText(\"Select model element\");" + NL + "\t\tcreateModelBrowser(composite);" + NL + "\t\treturn composite;" + NL + "\t}" + NL + "\t" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected Control createButtonBar(Composite parent) {" + NL + "\t\tControl buttonBar = super.createButtonBar(parent);" + NL + "\t\tsetOkButtonEnabled(false);" + NL + "\t\treturn buttonBar;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate void createModelBrowser(Composite composite) {" + NL + "\t\tmyTreeViewer = new TreeViewer(composite, SWT.SINGLE | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);" + NL + "\t\tGridData layoutData = new GridData(GridData.FILL_BOTH);" + NL + "\t\tlayoutData.heightHint = 300;" + NL + "\t\tlayoutData.widthHint = 300;" + NL + "\t\tmyTreeViewer.getTree().setLayoutData(layoutData);" + NL + "\t\tmyTreeViewer.setContentProvider(new ModelElementsTreeContentProvider());" + NL + "\t\tmyTreeViewer.setLabelProvider(new ModelElementsTreeLabelProvider());" + NL + "\t\tmyTreeViewer.setInput(ResourcesPlugin.getWorkspace().getRoot());" + NL + "\t\tmyTreeViewer.addFilter(new ModelFilesFilter());" + NL + "\t\tmyTreeViewer.addSelectionChangedListener(new OkButtonEnabler());" + NL + "\t}" + NL + "\t" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate void setOkButtonEnabled(boolean enabled) {" + NL + "\t\tgetButton(IDialogConstants.OK_ID).setEnabled(enabled);" + NL + "\t}" + NL + "\t" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate boolean isValidModelFile(IFile file) {" + NL + "\t\tString fileExtension = file.getFullPath().getFileExtension();" + NL + "\t\treturn ";
protected final String TEXT_8 = NL + "\t\t\t\"";
protected final String TEXT_9 = "\".equals(fileExtension) ";
protected final String TEXT_10 = NL + "\t}" + NL + "\t" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic URI getSelectedModelElementURI() {" + NL + "\t\tResource resource = mySelectedModelElement.eResource();" + NL + "\t\treturn resource.getURI().appendFragment(resource.getURIFragment(mySelectedModelElement));" + NL + "\t}" + NL + "\t" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate class ModelElementsTreeContentProvider implements ITreeContentProvider {" + NL + "\t\t" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate ITreeContentProvider myWorkbenchContentProvider = new WorkbenchContentProvider();" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate AdapterFactoryContentProvider myAdapterFctoryContentProvier = new AdapterFactoryContentProvider(";
diff --git a/plugins/org.eclipse.gmf.codegen/src-templates/org/eclipse/gmf/codegen/templates/editor/NewDiagramFileWizardGenerator.java b/plugins/org.eclipse.gmf.codegen/src-templates/org/eclipse/gmf/codegen/templates/editor/NewDiagramFileWizardGenerator.java
index 14a656d86..334760d4c 100644
--- a/plugins/org.eclipse.gmf.codegen/src-templates/org/eclipse/gmf/codegen/templates/editor/NewDiagramFileWizardGenerator.java
+++ b/plugins/org.eclipse.gmf.codegen/src-templates/org/eclipse/gmf/codegen/templates/editor/NewDiagramFileWizardGenerator.java
@@ -28,7 +28,7 @@ public class NewDiagramFileWizardGenerator {
protected final String TEXT_9 = " constructor\"; //$NON-NLS-1$" + NL + "\t assert diagramRoot != null : \"Null diagramRoot in ";
protected final String TEXT_10 = " constructor\"; //$NON-NLS-1$" + NL + "\t assert editingDomain != null : \"Null editingDomain in ";
protected final String TEXT_11 = " constructor\"; //$NON-NLS-1$" + NL + "\t " + NL + "\t \tmySelectedModelFile = selectedModelFile;" + NL + "\t \tmyWorkbenchPage = workbenchPage;" + NL + "\t \tmySelection = selection;" + NL + "\t \tmyDiagramRoot = diagramRoot;" + NL + "\t \tmyEditingDomain = editingDomain;" + NL + "\t}" + NL + "\t \t\t" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void addPages() {" + NL + "\t\tmyFileCreationPage = new WizardNewFileCreationPage(\"Initialize new Ecore diagram file\", mySelection) {" + NL + "" + NL + "\t\t\tpublic void createControl(Composite parent) {" + NL + "\t\t\t\tsuper.createControl(parent);" + NL + "\t\t\t\t" + NL + "\t\t\t\tIContainer parentContainer = mySelectedModelFile.getParent();" + NL + "\t\t\t\tString originalFileName = mySelectedModelFile.getProjectRelativePath().removeFileExtension().lastSegment();" + NL + "\t\t\t\tString fileExtension = \".";
- protected final String TEXT_12 = "\";" + NL + "\t\t\t\tString fileName = originalFileName + fileExtension;" + NL + "\t\t\t\tfor (int i = 1; parentContainer.getFile(new Path(fileName)).exists(); i++) {" + NL + "\t\t\t\t\tfileName = originalFileName + i + fileExtension;" + NL + "\t\t\t\t}" + NL + "\t\t\t\tsetFileName(fileName);" + NL + "\t\t\t}" + NL + "\t\t" + NL + "\t\t};" + NL + "\t\tmyFileCreationPage.setTitle(\"Diagram file\");" + NL + "\t\tmyFileCreationPage.setDescription(\"Create new diagram based on \" + ";
+ protected final String TEXT_12 = "\"; //$NON-NLS-1$" + NL + "\t\t\t\tString fileName = originalFileName + fileExtension;" + NL + "\t\t\t\tfor (int i = 1; parentContainer.getFile(new Path(fileName)).exists(); i++) {" + NL + "\t\t\t\t\tfileName = originalFileName + i + fileExtension;" + NL + "\t\t\t\t}" + NL + "\t\t\t\tsetFileName(fileName);" + NL + "\t\t\t}" + NL + "\t\t" + NL + "\t\t};" + NL + "\t\tmyFileCreationPage.setTitle(\"Diagram file\");" + NL + "\t\tmyFileCreationPage.setDescription(\"Create new diagram based on \" + ";
protected final String TEXT_13 = ".MODEL_ID + \" model content\");" + NL + "\t\taddPage(myFileCreationPage);" + NL + "\t\taddPage(new RootElementSelectorPage());" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic boolean performFinish() {" + NL + "\t\tIFile diagramFile = myFileCreationPage.createNewFile();" + NL + "\t\ttry {" + NL + "\t\t\tdiagramFile.setCharset(\"UTF-8\", new NullProgressMonitor()); //$NON-NLS-1$" + NL + "\t\t} catch (";
protected final String TEXT_14 = " e) {" + NL + "\t\t\t";
protected final String TEXT_15 = ".getInstance().logError(\"Unable to set charset for diagram file\", e); //$NON-NLS-1$" + NL + "\t\t}" + NL + "\t\t" + NL + "\t\tResourceSet resourceSet = myEditingDomain.getResourceSet();" + NL + "\t\tfinal Resource diagramResource = resourceSet.createResource(URI.createPlatformResourceURI(diagramFile.getFullPath().toString()));" + NL + "" + NL + "\t\tList affectedFiles = new LinkedList();" + NL + "\t\taffectedFiles.add(mySelectedModelFile);" + NL + "\t\taffectedFiles.add(diagramFile);" + NL + "\t\t\t" + NL + "\t\tAbstractTransactionalCommand command = new AbstractTransactionalCommand(myEditingDomain, \"Initializing diagram contents\", affectedFiles) { //$NON-NLS-1$" + NL + "\t\t\tprotected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {" + NL + "\t\t\t\tint diagramVID = ";
diff --git a/plugins/org.eclipse.gmf.codegen/templates/editor/ElementChooser.javajet b/plugins/org.eclipse.gmf.codegen/templates/editor/ElementChooser.javajet
index 6828eb428..0129ddebe 100644
--- a/plugins/org.eclipse.gmf.codegen/templates/editor/ElementChooser.javajet
+++ b/plugins/org.eclipse.gmf.codegen/templates/editor/ElementChooser.javajet
@@ -88,6 +88,7 @@ public class <%=genDiagram.getElementChooserClassName()%> extends Dialog {
*/
protected Control createDialogArea(Composite parent) {
Composite composite = (Composite) super.createDialogArea(parent);
+ getShell().setText("Select model element");
createModelBrowser(composite);
return composite;
}
diff --git a/plugins/org.eclipse.gmf.codegen/templates/editor/NewDiagramFileWizard.javajet b/plugins/org.eclipse.gmf.codegen/templates/editor/NewDiagramFileWizard.javajet
index 78076bb0b..7f420d66b 100644
--- a/plugins/org.eclipse.gmf.codegen/templates/editor/NewDiagramFileWizard.javajet
+++ b/plugins/org.eclipse.gmf.codegen/templates/editor/NewDiagramFileWizard.javajet
@@ -106,7 +106,7 @@ public class <%=genDiagram.getNewDiagramFileWizardClassName()%> extends Wizard {
IContainer parentContainer = mySelectedModelFile.getParent();
String originalFileName = mySelectedModelFile.getProjectRelativePath().removeFileExtension().lastSegment();
- String fileExtension = ".<%=editorGen.getDiagramFileExtension()%>";
+ String fileExtension = ".<%=editorGen.getDiagramFileExtension()%>"; //$NON-NLS-1$
String fileName = originalFileName + fileExtension;
for (int i = 1; parentContainer.getFile(new Path(fileName)).exists(); i++) {
fileName = originalFileName + i + fileExtension;
diff --git a/plugins/org.eclipse.gmf.graphdef.editor/src/org/eclipse/gmf/graphdef/editor/part/GMFGraphElementChooserDialog.java b/plugins/org.eclipse.gmf.graphdef.editor/src/org/eclipse/gmf/graphdef/editor/part/GMFGraphElementChooserDialog.java
index d2ffbea91..8ff13c302 100644
--- a/plugins/org.eclipse.gmf.graphdef.editor/src/org/eclipse/gmf/graphdef/editor/part/GMFGraphElementChooserDialog.java
+++ b/plugins/org.eclipse.gmf.graphdef.editor/src/org/eclipse/gmf/graphdef/editor/part/GMFGraphElementChooserDialog.java
@@ -90,6 +90,7 @@ public class GMFGraphElementChooserDialog extends Dialog {
*/
protected Control createDialogArea(Composite parent) {
Composite composite = (Composite) super.createDialogArea(parent);
+ getShell().setText("Select model element");
createModelBrowser(composite);
return composite;
}
diff --git a/plugins/org.eclipse.gmf.graphdef.editor/src/org/eclipse/gmf/graphdef/editor/part/GMFGraphNewDiagramFileWizard.java b/plugins/org.eclipse.gmf.graphdef.editor/src/org/eclipse/gmf/graphdef/editor/part/GMFGraphNewDiagramFileWizard.java
index 3f4dc2a57..8a06cc5da 100644
--- a/plugins/org.eclipse.gmf.graphdef.editor/src/org/eclipse/gmf/graphdef/editor/part/GMFGraphNewDiagramFileWizard.java
+++ b/plugins/org.eclipse.gmf.graphdef.editor/src/org/eclipse/gmf/graphdef/editor/part/GMFGraphNewDiagramFileWizard.java
@@ -142,7 +142,7 @@ public class GMFGraphNewDiagramFileWizard extends Wizard {
IContainer parentContainer = mySelectedModelFile.getParent();
String originalFileName = mySelectedModelFile.getProjectRelativePath().removeFileExtension().lastSegment();
- String fileExtension = ".gmfgraph_diagram";
+ String fileExtension = ".gmfgraph_diagram"; //$NON-NLS-1$
String fileName = originalFileName + fileExtension;
for (int i = 1; parentContainer.getFile(new Path(fileName)).exists(); i++) {
fileName = originalFileName + i + fileExtension;

Back to the top