Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 221820 Details for
Bug 389783
menu item order changes dynamically
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
plugin showing the issue
textUMLPlugin.js (text/html), 7.35 KB, created by
Rafael Chaves
on 2012-10-02 23:57:25 EDT
(
hide
)
Description:
plugin showing the issue
Filename:
MIME Type:
Creator:
Rafael Chaves
Created:
2012-10-02 23:57:25 EDT
Size:
7.35 KB
patch
obsolete
>/******************************************************************************* > * @license > * Copyright (c) 2012 Abstratt Technologies. > * All rights reserved. This program and the accompanying materials are made > * available under the terms of the Eclipse Public License v1.0 > * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution > * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). > * > * Contributors: > * Rafael Chaves - initial API and implementation > *******************************************************************************/ >window.onload = function() { > var checkSyntax = function(title, contents) { > return dojo.xhrGet({ > handleAs: 'json', > url: "../mdd/builder" + title, > load: function(result) { > return result > } > }); > }; > > var getOutline = function(text, title) { > return dojo.xhrPost({ > postData: text, > handleAs: 'json', > url: "../mdd/analyzer/?fileName=" + title, > load: function(result) { > return result; > } > }); > }; > > var autoFormat = function(selectedText, text, selection, resource) { > return dojo.xhrPost({ > postData: text, > handleAs: 'text', > url: "../mdd/formatter/?fileName=" + resource, > load: function(result) { > return { text: result, selection: null }; > } > }); > }; > > var computeProposals = function(prefix, buffer, selection) { > return [ > { > proposal: "package package_name;\n\n/* add classes here */\n\nend.", > description: 'New package' > }, > { > proposal: "class class_name\n/* add attributes and operations here */\nend;", > description: 'New class' > }, > { > proposal: "attribute attribute_name : String;", > description: 'New attribute' > }, > { > proposal: "operation operation_name(param1 : String, param2 : Integer) : Boolean;\nbegin\n /* IMPLEMENT ME */\n return false;\nend;", > description: 'New operation' > } > ]; > }; > > var deploy = function(selection) { > return dojo.xhrPost({ > postData: '', > handleAs: 'json', > url: "../mdd/deployer/?path=" + selection[0].Location > }); > }; > > var provider = new eclipse.PluginProvider(); > > provider.registerServiceProvider("orion.core.contenttype", {}, { > contentTypes: [{ id: "text/uml", > name: "TextUML", > extension: ["tuml"], > extends: "text/plain" > }] > }); > > provider.registerServiceProvider("orion.core.contenttype", {}, { > contentTypes: [{ id: "application/vnd-json-data", > name: "JSON-encoded dataset", > filename: ["data.json"], > extends: "application/javascript" > }] > }); > > provider.registerServiceProvider("orion.core.contenttype", {}, { > contentTypes: [{ id: "application/vnd-mdd-properties", > name: "Cloudfier properties file", > filename: ["mdd.properties"], > extends: "text/plain" > }] > }); > > provider.registerServiceProvider("orion.navigate.content", null, { > id: "orion.cloudfier.content.examples", > name: "Get Cloudfier examples", > description: "Get the Cloudfier example applications into your workspace by cloning a git repository. Once the repository is cloned, a 'cloudfier-examples' folder will appear in the Navigator.", > uriTemplate: "{OrionHome}/git/git-repository.html#,cloneGitRepository=https://bitbucket.org/abstratt/cloudfier-examples.git" > }); > > provider.registerServiceProvider("orion.edit.validator", { checkSyntax: checkSyntax }, { contentType: ["text/uml", "application/vnd-json-data"] }); > > provider.registerServiceProvider("orion.edit.outliner", { getOutline: getOutline }, { contentType: ["text/uml"], id: "com.abstratt.textuml.outliner", name: "TextUML outliner" }); > > provider.registerServiceProvider("orion.edit.command", { > run : autoFormat > }, { > name : "Format (^M)", > key : [ "m", true ], > contentType: ["text/uml"] > }); > > provider.registerServiceProvider("orion.navigate.command", { run: deploy }, { > name: "Deploy Application", > id: "orion.cloudfier.commands.deploy", > forceSingleItem: true, > tooltip: "Deploys the selected project to Cloudfier", > contentType: ["application/vnd-mdd-properties"] > }); > > provider.registerServiceProvider("orion.navigate.command", { }, { > name: "Start Application", > id: "orion.cloudfier.commands.launchApp", > forceSingleItem: true, > tooltip: "Start the application in Cloudfier (you must deploy first)", > uriTemplate: "http://localhost:8090/mdd/ui/session/?location={Location}", > contentType: ["application/vnd-mdd-properties"] > }); > > provider.registerServiceProvider("orion.navigate.command", { }, { > name: "Browse REST API", > id: "orion.cloudfier.commands.browseAPI", > forceSingleItem: true, > tooltip: "Browse the REST API for the selected project in Cloudfier", > uriTemplate: "http://localhost:8090/mdd/api/session/?location={Location}", > contentType: ["application/vnd-mdd-properties"] > }); > > /* Registers a highlighter service. */ > provider.registerServiceProvider("orion.edit.highlighter", > { > // "grammar" provider is purely declarative. No service methods. > }, { > type : "grammar", > contentType: ["text/uml"], > grammar: { > patterns: [ > { > end: '"', > begin: '"', > name: 'string.quoted.double.textuml', > }, > { begin: "\\(\\*", > end: "\\*\\)", > name: "comment.model.textuml" > }, > { > begin: "/\\*", > end: "\\*/", > name: "comment.ignored.textuml" > }, > { > name: 'keyword.control.untitled', > match: '\\b(abstract|access|aggregation|alias|and|any|association|as|attribute|begin|by|class|datatype|derived|composition|constant|dependency|end|enumeration|extends|function|implements|interface|in|initial|inout|invariant|is|model|navigable|nonunique|not|on|operation|or|ordered|out|package|postcondition|precondition|private|primitive|profile|property|protected|public|raises|readonly|reference|required|return|role|self|specializes|state|statemachine|static|stereotype|subsets|terminate|to|transition|type|unique|unordered|var|when)\\b' > }, > { > "match": "([a-zA-Z_][a-zA-Z0-9_]*)", > "name": "variable.other.textuml" > }, > { > "match": "<|>|<=|>=|=|==|\\*|/|-|\\+", > "name": "keyword.other.textuml" > }, > { > "match": ";", > "name": "punctuation.textuml" > } > ] > } > }); > > provider.registerServiceProvider("orion.edit.contentAssist", > { > computeProposals: computeProposals > }, > { > name: "TextUML content assist", > contentType: ["text/uml"] > } > ); > > provider.connect(); >};
/******************************************************************************* * @license * Copyright (c) 2012 Abstratt Technologies. * All rights reserved. This program and the accompanying materials are made * available under the terms of the Eclipse Public License v1.0 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). * * Contributors: * Rafael Chaves - initial API and implementation *******************************************************************************/ window.onload = function() { var checkSyntax = function(title, contents) { return dojo.xhrGet({ handleAs: 'json', url: "../mdd/builder" + title, load: function(result) { return result } }); }; var getOutline = function(text, title) { return dojo.xhrPost({ postData: text, handleAs: 'json', url: "../mdd/analyzer/?fileName=" + title, load: function(result) { return result; } }); }; var autoFormat = function(selectedText, text, selection, resource) { return dojo.xhrPost({ postData: text, handleAs: 'text', url: "../mdd/formatter/?fileName=" + resource, load: function(result) { return { text: result, selection: null }; } }); }; var computeProposals = function(prefix, buffer, selection) { return [ { proposal: "package package_name;\n\n/* add classes here */\n\nend.", description: 'New package' }, { proposal: "class class_name\n/* add attributes and operations here */\nend;", description: 'New class' }, { proposal: "attribute attribute_name : String;", description: 'New attribute' }, { proposal: "operation operation_name(param1 : String, param2 : Integer) : Boolean;\nbegin\n /* IMPLEMENT ME */\n return false;\nend;", description: 'New operation' } ]; }; var deploy = function(selection) { return dojo.xhrPost({ postData: '', handleAs: 'json', url: "../mdd/deployer/?path=" + selection[0].Location }); }; var provider = new eclipse.PluginProvider(); provider.registerServiceProvider("orion.core.contenttype", {}, { contentTypes: [{ id: "text/uml", name: "TextUML", extension: ["tuml"], extends: "text/plain" }] }); provider.registerServiceProvider("orion.core.contenttype", {}, { contentTypes: [{ id: "application/vnd-json-data", name: "JSON-encoded dataset", filename: ["data.json"], extends: "application/javascript" }] }); provider.registerServiceProvider("orion.core.contenttype", {}, { contentTypes: [{ id: "application/vnd-mdd-properties", name: "Cloudfier properties file", filename: ["mdd.properties"], extends: "text/plain" }] }); provider.registerServiceProvider("orion.navigate.content", null, { id: "orion.cloudfier.content.examples", name: "Get Cloudfier examples", description: "Get the Cloudfier example applications into your workspace by cloning a git repository. Once the repository is cloned, a 'cloudfier-examples' folder will appear in the Navigator.", uriTemplate: "{OrionHome}/git/git-repository.html#,cloneGitRepository=https://bitbucket.org/abstratt/cloudfier-examples.git" }); provider.registerServiceProvider("orion.edit.validator", { checkSyntax: checkSyntax }, { contentType: ["text/uml", "application/vnd-json-data"] }); provider.registerServiceProvider("orion.edit.outliner", { getOutline: getOutline }, { contentType: ["text/uml"], id: "com.abstratt.textuml.outliner", name: "TextUML outliner" }); provider.registerServiceProvider("orion.edit.command", { run : autoFormat }, { name : "Format (^M)", key : [ "m", true ], contentType: ["text/uml"] }); provider.registerServiceProvider("orion.navigate.command", { run: deploy }, { name: "Deploy Application", id: "orion.cloudfier.commands.deploy", forceSingleItem: true, tooltip: "Deploys the selected project to Cloudfier", contentType: ["application/vnd-mdd-properties"] }); provider.registerServiceProvider("orion.navigate.command", { }, { name: "Start Application", id: "orion.cloudfier.commands.launchApp", forceSingleItem: true, tooltip: "Start the application in Cloudfier (you must deploy first)", uriTemplate: "http://localhost:8090/mdd/ui/session/?location={Location}", contentType: ["application/vnd-mdd-properties"] }); provider.registerServiceProvider("orion.navigate.command", { }, { name: "Browse REST API", id: "orion.cloudfier.commands.browseAPI", forceSingleItem: true, tooltip: "Browse the REST API for the selected project in Cloudfier", uriTemplate: "http://localhost:8090/mdd/api/session/?location={Location}", contentType: ["application/vnd-mdd-properties"] }); /* Registers a highlighter service. */ provider.registerServiceProvider("orion.edit.highlighter", { // "grammar" provider is purely declarative. No service methods. }, { type : "grammar", contentType: ["text/uml"], grammar: { patterns: [ { end: '"', begin: '"', name: 'string.quoted.double.textuml', }, { begin: "\\(\\*", end: "\\*\\)", name: "comment.model.textuml" }, { begin: "/\\*", end: "\\*/", name: "comment.ignored.textuml" }, { name: 'keyword.control.untitled', match: '\\b(abstract|access|aggregation|alias|and|any|association|as|attribute|begin|by|class|datatype|derived|composition|constant|dependency|end|enumeration|extends|function|implements|interface|in|initial|inout|invariant|is|model|navigable|nonunique|not|on|operation|or|ordered|out|package|postcondition|precondition|private|primitive|profile|property|protected|public|raises|readonly|reference|required|return|role|self|specializes|state|statemachine|static|stereotype|subsets|terminate|to|transition|type|unique|unordered|var|when)\\b' }, { "match": "([a-zA-Z_][a-zA-Z0-9_]*)", "name": "variable.other.textuml" }, { "match": "<|>|<=|>=|=|==|\\*|/|-|\\+", "name": "keyword.other.textuml" }, { "match": ";", "name": "punctuation.textuml" } ] } }); provider.registerServiceProvider("orion.edit.contentAssist", { computeProposals: computeProposals }, { name: "TextUML content assist", contentType: ["text/uml"] } ); provider.connect(); };
View Attachment As Raw
Actions:
View
Attachments on
bug 389783
: 221820 |
221821