diff options
author | atikhomirov | 2010-12-17 03:29:00 +0000 |
---|---|---|
committer | atikhomirov | 2010-12-17 03:29:00 +0000 |
commit | 1b5e3859e24fb464c7b589f5682514b9b241ee34 (patch) | |
tree | 2ea51bfd91471fca235b5a79a20776d09f9157e3 | |
parent | 6a53d9c4ba6bcfffc2034b8d2144a9d922be6822 (diff) | |
download | org.eclipse.gmf-tooling-1b5e3859e24fb464c7b589f5682514b9b241ee34.tar.gz org.eclipse.gmf-tooling-1b5e3859e24fb464c7b589f5682514b9b241ee34.tar.xz org.eclipse.gmf-tooling-1b5e3859e24fb464c7b589f5682514b9b241ee34.zip |
emfatic (EMFT project) file as our primary metamodel sourcev20101216-2359
-rw-r--r-- | plugins/org.eclipse.gmf.tooldef/models/tooldef.emf | 173 |
1 files changed, 173 insertions, 0 deletions
diff --git a/plugins/org.eclipse.gmf.tooldef/models/tooldef.emf b/plugins/org.eclipse.gmf.tooldef/models/tooldef.emf new file mode 100644 index 000000000..f8842b425 --- /dev/null +++ b/plugins/org.eclipse.gmf.tooldef/models/tooldef.emf @@ -0,0 +1,173 @@ +@namespace(uri="http://www.eclipse.org/gmf/2005/ToolDefinition", prefix="gmftool") +package tooldef; + +///////////////// +// Root container +// + +class ToolRegistry { + @genmodel(documentation="Instead of placing common actions somewhere in menu hierarchy and referencing them in (2..n) cases, keep them in this central registry and use ItemRef everywhere (i.e. in 1..n cases)") + val MenuAction[*] sharedActions; + val Menu[*] allMenus; + val Palette[?] palette; +} + +////////// +// Palette +// + +abstract class AbstractTool { + val Image smallIcon; + val Image largeIcon; + attr String title; + attr String description; +} + +abstract class ToolContainer extends AbstractTool { + // TODO opposite ref + ordered val AbstractTool[*] tools; +} + +class PaletteSeparator extends AbstractTool { +} + +class ToolGroup extends ToolContainer { + attr boolean collapsible; + attr boolean stack; + ref AbstractTool[?] active; +} + +class Palette extends ToolContainer { + ref AbstractTool[?] default; +} + +@genmodel(documentation="predefined, like zoom or marquee") +class StandardTool extends AbstractTool { + //attr String identifier; + attr StandardToolKind toolKind; +} + +enum StandardToolKind { + SELECT; + SELECT_PAN; + MARQUEE; + ZOOM_PAN; + ZOOM_IN; + ZOOM_OUT; +} + +class CreationTool extends AbstractTool { +} + +class GenericTool extends AbstractTool { + attr String[1] toolClass; +} + +///////////////////// +// Menus and toolbars +// + +abstract interface ItemBase { +} + +abstract class Menu { + ordered val ItemBase[*] items; +} + +class Separator extends ItemBase { + attr String name; +} + +class PredefinedItem extends ItemBase { + attr String identifier; +} + +class PredefinedMenu extends Menu, PredefinedItem { +} + +abstract interface ContributionItem extends ItemBase { + val Image icon; + attr String title; +} + +class MenuAction extends ContributionItem { + attr ActionKind kind; + attr String hotKey; +} + +class ItemRef extends ItemBase { + // constraints: self.item not instanceof Separator? + ref ItemBase[1] item; +} + +class ContextMenu extends Menu { + // constraint: isUndefined(default) or super.items.contains(default) + // FIXME - what if default should be itemRef? int (=position) instead? + ref MenuAction[?] default; +} + +class PopupMenu extends Menu, ContributionItem { + id attr String iD; +} + +@genmodel(documentation="no default action and no id, just a collection of items") +class MainMenu extends Menu { + attr String title; +} + +class Toolbar extends Menu { +} + +/////////////// +// Action kinds +// + +enum ActionKind { + CREATE; + PROPCHANGE; // detailsLevel, isVisible, modifier + MODIFY; + PROCESS; // READ? + CUSTOM = 99; +} + + +//class OutlineView { +// attr boolean dontneedthat; +//} + +///////// +// Images +// + +abstract interface Image { +} + +@genmodel(documentation="Delegate to EMF.Edit providers") +class DefaultImage extends Image { +} + +@genmodel(documentation="Image bundled as part of distribution") +class BundleImage extends Image { + @genmodel(documentation="Relative path to image") + attr String path; + @genmodel(documentation="Empty value means image path is relative to generated bundle") + attr String bundle; +} + +///////////////////////////// +// Customizing Property Sheet +// + +abstract interface StyleSelector { + op boolean isOk(Object style); +} + +class GenericStyleSelector extends StyleSelector { + attr AppearanceStyle[+] values; +} + +enum AppearanceStyle { + Font; + Fill; + Line; +}
\ No newline at end of file |