Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCamille Letavernier2013-09-25 09:25:46 +0000
committerCamille Letavernier2013-09-25 09:41:56 +0000
commit21fb5c1bddf6db611dbc66d700c40668adac509d (patch)
tree9b644227ccbd85dfa83a6330eac992032d9ec436 /sandbox
parentfdb0bab349b024e5028265e223962617e87f0cb4 (diff)
downloadorg.eclipse.papyrus-21fb5c1bddf6db611dbc66d700c40668adac509d.tar.gz
org.eclipse.papyrus-21fb5c1bddf6db611dbc66d700c40668adac509d.tar.xz
org.eclipse.papyrus-21fb5c1bddf6db611dbc66d700c40668adac509d.zip
384569: [Palette - CSS] There should be an "apply CSS Style" post-action
available in the palette customization tool https://bugs.eclipse.org/bugs/show_bug.cgi?id=384569 Move the plug-in to its final location
Diffstat (limited to 'sandbox')
-rw-r--r--sandbox/org.eclipse.papyrus.infra.gmfdiag.css.palette/.classpath7
-rw-r--r--sandbox/org.eclipse.papyrus.infra.gmfdiag.css.palette/.project28
-rw-r--r--sandbox/org.eclipse.papyrus.infra.gmfdiag.css.palette/.settings/org.eclipse.jdt.core.prefs7
-rw-r--r--sandbox/org.eclipse.papyrus.infra.gmfdiag.css.palette/META-INF/MANIFEST.MF23
-rw-r--r--sandbox/org.eclipse.papyrus.infra.gmfdiag.css.palette/about.html28
-rw-r--r--sandbox/org.eclipse.papyrus.infra.gmfdiag.css.palette/build.properties7
-rw-r--r--sandbox/org.eclipse.papyrus.infra.gmfdiag.css.palette/icon/sourceEditor.gifbin353 -> 0 bytes
-rw-r--r--sandbox/org.eclipse.papyrus.infra.gmfdiag.css.palette/plugin.xml18
-rw-r--r--sandbox/org.eclipse.papyrus.infra.gmfdiag.css.palette/src/org/eclipse/papyrus/infra/gmfdiag/css/palette/Activator.java69
-rw-r--r--sandbox/org.eclipse.papyrus.infra.gmfdiag.css.palette/src/org/eclipse/papyrus/infra/gmfdiag/css/palette/aspect/CSSStylePostAction.java120
-rw-r--r--sandbox/org.eclipse.papyrus.infra.gmfdiag.css.palette/src/org/eclipse/papyrus/infra/gmfdiag/css/palette/provider/CSSStyleAspectActionProvider.java39
11 files changed, 0 insertions, 346 deletions
diff --git a/sandbox/org.eclipse.papyrus.infra.gmfdiag.css.palette/.classpath b/sandbox/org.eclipse.papyrus.infra.gmfdiag.css.palette/.classpath
deleted file mode 100644
index 2d1a4302f04..00000000000
--- a/sandbox/org.eclipse.papyrus.infra.gmfdiag.css.palette/.classpath
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/sandbox/org.eclipse.papyrus.infra.gmfdiag.css.palette/.project b/sandbox/org.eclipse.papyrus.infra.gmfdiag.css.palette/.project
deleted file mode 100644
index 5a5285828be..00000000000
--- a/sandbox/org.eclipse.papyrus.infra.gmfdiag.css.palette/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.papyrus.infra.gmfdiag.css.palette</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/sandbox/org.eclipse.papyrus.infra.gmfdiag.css.palette/.settings/org.eclipse.jdt.core.prefs b/sandbox/org.eclipse.papyrus.infra.gmfdiag.css.palette/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 44217f8c068..00000000000
--- a/sandbox/org.eclipse.papyrus.infra.gmfdiag.css.palette/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,7 +0,0 @@
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.compliance=1.5
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.5
diff --git a/sandbox/org.eclipse.papyrus.infra.gmfdiag.css.palette/META-INF/MANIFEST.MF b/sandbox/org.eclipse.papyrus.infra.gmfdiag.css.palette/META-INF/MANIFEST.MF
deleted file mode 100644
index 6669dcfe529..00000000000
--- a/sandbox/org.eclipse.papyrus.infra.gmfdiag.css.palette/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,23 +0,0 @@
-Manifest-Version: 1.0
-Require-Bundle: org.eclipse.ui,
- org.eclipse.core.runtime,
- org.eclipse.gef;bundle-version="3.8.0",
- org.eclipse.papyrus.infra.widgets;bundle-version="0.10.0",
- org.eclipse.gmf.runtime.diagram.ui;bundle-version="1.6.0",
- org.eclipse.papyrus.infra.gmfdiag.properties;bundle-version="0.10.0",
- org.eclipse.papyrus.infra.emf;bundle-version="0.10.0",
- org.eclipse.papyrus.infra.core.log;bundle-version="0.10.0",
- org.eclipse.uml2.uml;bundle-version="4.0.0",
- org.eclipse.papyrus.infra.gmfdiag.common;bundle-version="0.10.0",
- org.eclipse.papyrus.uml.diagram.common;bundle-version="0.10.0"
-Bundle-Vendor: Eclipse Modeling Project
-Bundle-ActivationPolicy: lazy
-Bundle-Version: 0.10.0.qualifier
-Bundle-Name: CSS Palette customization (Incubation)
-Bundle-ManifestVersion: 2
-Bundle-Activator: org.eclipse.papyrus.infra.gmfdiag.css.palette.Activa
- tor
-Bundle-SymbolicName: org.eclipse.papyrus.infra.gmfdiag.css.palette;sin
- gleton:=true
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
-
diff --git a/sandbox/org.eclipse.papyrus.infra.gmfdiag.css.palette/about.html b/sandbox/org.eclipse.papyrus.infra.gmfdiag.css.palette/about.html
deleted file mode 100644
index dd02e0be168..00000000000
--- a/sandbox/org.eclipse.papyrus.infra.gmfdiag.css.palette/about.html
+++ /dev/null
@@ -1,28 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
-<title>About</title>
-</head>
-<body lang="EN-US">
-<h2>About This Content</h2>
-
-<p>December 2, 2009</p>
-<h3>License</h3>
-
-<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise
-indicated below, the Content is provided to you under the terms and conditions of the
-Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available
-at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
-For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
-
-<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
-being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
-apply to your use of any object code in the Content. Check the Redistributor's license that was
-provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
-indicated below, the terms and conditions of the EPL still apply to any source code in the Content
-and such source code may be obtained at <a href="http://www.eclipse.org">http://www.eclipse.org</a>.</p>
-
-</body>
-</html> \ No newline at end of file
diff --git a/sandbox/org.eclipse.papyrus.infra.gmfdiag.css.palette/build.properties b/sandbox/org.eclipse.papyrus.infra.gmfdiag.css.palette/build.properties
deleted file mode 100644
index e3693a3b66e..00000000000
--- a/sandbox/org.eclipse.papyrus.infra.gmfdiag.css.palette/build.properties
+++ /dev/null
@@ -1,7 +0,0 @@
-source.. = src/
-output.. = bin/
-bin.includes = META-INF/,\
- .,\
- about.html,\
- plugin.xml
-src.includes = about.html
diff --git a/sandbox/org.eclipse.papyrus.infra.gmfdiag.css.palette/icon/sourceEditor.gif b/sandbox/org.eclipse.papyrus.infra.gmfdiag.css.palette/icon/sourceEditor.gif
deleted file mode 100644
index 75ebdb85865..00000000000
--- a/sandbox/org.eclipse.papyrus.infra.gmfdiag.css.palette/icon/sourceEditor.gif
+++ /dev/null
Binary files differ
diff --git a/sandbox/org.eclipse.papyrus.infra.gmfdiag.css.palette/plugin.xml b/sandbox/org.eclipse.papyrus.infra.gmfdiag.css.palette/plugin.xml
deleted file mode 100644
index afebf315d91..00000000000
--- a/sandbox/org.eclipse.papyrus.infra.gmfdiag.css.palette/plugin.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.4"?>
-<plugin>
- <extension
- point="org.eclipse.papyrus.uml.diagram.common.aspectToolProvider">
- <aspectToolProvider
- class="org.eclipse.papyrus.infra.gmfdiag.css.palette.provider.CSSStyleAspectActionProvider"
- description="Applies a CSS Style to a newly created element"
- icon="icon/sourceEditor.gif"
- id="org.eclipse.papyrus.infra.gmfdiag.css.style"
- name="Apply CSS Style">
- <Priority
- name="Lowest">
- </Priority>
- </aspectToolProvider>
- </extension>
-
-</plugin>
diff --git a/sandbox/org.eclipse.papyrus.infra.gmfdiag.css.palette/src/org/eclipse/papyrus/infra/gmfdiag/css/palette/Activator.java b/sandbox/org.eclipse.papyrus.infra.gmfdiag.css.palette/src/org/eclipse/papyrus/infra/gmfdiag/css/palette/Activator.java
deleted file mode 100644
index c768102bf62..00000000000
--- a/sandbox/org.eclipse.papyrus.infra.gmfdiag.css.palette/src/org/eclipse/papyrus/infra/gmfdiag/css/palette/Activator.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2012 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
- *****************************************************************************/
-package org.eclipse.papyrus.infra.gmfdiag.css.palette;
-
-import org.eclipse.papyrus.infra.core.log.LogHelper;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.osgi.framework.BundleContext;
-
-/**
- * The activator class controls the plug-in life cycle
- */
-public class Activator extends AbstractUIPlugin {
-
- // The plug-in ID
- public static final String PLUGIN_ID = "org.eclipse.papyrus.infra.gmfdiag.css.palette"; //$NON-NLS-1$
-
- public static LogHelper log;
-
- // The shared instance
- private static Activator plugin;
-
- /**
- * The constructor
- */
- public Activator() {
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
- */
- @Override
- public void start(BundleContext context) throws Exception {
- super.start(context);
- plugin = this;
- log = new LogHelper(this);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
- */
- @Override
- public void stop(BundleContext context) throws Exception {
- plugin = null;
- super.stop(context);
- }
-
- /**
- * Returns the shared instance
- *
- * @return the shared instance
- */
- public static Activator getDefault() {
- return plugin;
- }
-
-}
diff --git a/sandbox/org.eclipse.papyrus.infra.gmfdiag.css.palette/src/org/eclipse/papyrus/infra/gmfdiag/css/palette/aspect/CSSStylePostAction.java b/sandbox/org.eclipse.papyrus.infra.gmfdiag.css.palette/src/org/eclipse/papyrus/infra/gmfdiag/css/palette/aspect/CSSStylePostAction.java
deleted file mode 100644
index bbca138528b..00000000000
--- a/sandbox/org.eclipse.papyrus.infra.gmfdiag.css.palette/src/org/eclipse/papyrus/infra/gmfdiag/css/palette/aspect/CSSStylePostAction.java
+++ /dev/null
@@ -1,120 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2012 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
- *****************************************************************************/
-package org.eclipse.papyrus.infra.gmfdiag.css.palette.aspect;
-
-import java.util.List;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand;
-import org.eclipse.gmf.runtime.notation.NotationPackage;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.infra.emf.utils.EMFHelper;
-import org.eclipse.papyrus.infra.gmfdiag.common.databinding.custom.AddCustomStyleListValueCommand;
-import org.eclipse.papyrus.infra.widgets.editors.StringCombo;
-import org.eclipse.papyrus.infra.widgets.providers.EmptyContentProvider;
-import org.eclipse.papyrus.uml.diagram.common.service.palette.IAspectActionProvider;
-import org.eclipse.papyrus.uml.diagram.common.service.palette.IPaletteEntryProxy;
-import org.eclipse.papyrus.uml.diagram.common.service.palette.ModelPostAction;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.uml2.uml.Profile;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-/**
- * A Palette post action to automatically add a CSS Style on a newly created element
- *
- * @author Camille Letavernier
- */
-public class CSSStylePostAction extends ModelPostAction {
-
- private StringCombo editor;
-
- private Node configurationNode;
-
- public static final String CLASS_ELEMENT = "cssClass";
-
- public static final String CLASS_PROPERTY = "class";
-
- //Copied from org.eclipse.papyrus.infra.gmfdiag.css.notation.CSSStyles.CSS_GMF_CLASS_KEY
- //FIXME: Add a dependency and use the existing constant. Avoid dependency to the GMF Factory.
- private static final String CSS_CLASS = "cssClass";
-
- public Control createConfigurationComposite(Composite parent, IPaletteEntryProxy entryProxy, List<Profile> appliedProfiles) {
- editor = new StringCombo(parent, SWT.NONE);
- editor.setContentProvider(EmptyContentProvider.instance); //TODO: We should not depend on the CSS Parser ; do not use CSSClassContentProvider.
- return editor;
- }
-
- @Override
- public void init(Node configurationNode, IAspectActionProvider factory) {
- super.init(configurationNode, factory);
- this.configurationNode = configurationNode;
- }
-
- public void save(Node parentNode) {
- String value = editor.getValue();
- Element cssElement = ((Element)parentNode).getOwnerDocument().createElement(CLASS_ELEMENT);
- parentNode.appendChild(cssElement);
- cssElement.setAttribute(CLASS_PROPERTY, value);
- }
-
- private String getValue() {
- NodeList cssElements = ((Element)configurationNode).getElementsByTagName(CLASS_ELEMENT);
- if(cssElements != null) {
- for(int i = 0; i < cssElements.getLength(); i++) {
- Node node = cssElements.item(i);
- if(node instanceof Element) {
- String value = ((Element)node).getAttribute(CLASS_PROPERTY);
- return value;
- }
- }
- }
- return null;
- }
-
- //We should not depend on the properties view to edit the custom style.
- //FIXME: Move CustomStyleValueCommand to infra.gmfdiag.common (or infra.gmfdiag.tools)
- public ICommand getPostCommand(final IAdaptable viewAdapter) {
- TransactionalEditingDomain domain = (TransactionalEditingDomain)EMFHelper.resolveEditingDomain(viewAdapter);
-
- if(domain != null) {
- AbstractTransactionalCommand transactionalCommand = new AbstractTransactionalCommand(domain, "Change css style", null) {
-
- @Override
- protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- View notationView = (View)viewAdapter.getAdapter(View.class);
- if(notationView != null) {
- String value = getValue();
- if(value != null) {
- AddCustomStyleListValueCommand command = new AddCustomStyleListValueCommand(getEditingDomain(), notationView, CSS_CLASS, NotationPackage.eINSTANCE.getStringListValueStyle(), NotationPackage.eINSTANCE.getStringListValueStyle_StringListValue(), value);
- command.execute();
- return CommandResult.newOKCommandResult();
- }
- }
- return CommandResult.newOKCommandResult();
- }
- };
-
- return transactionalCommand;
- }
-
- return null;
- }
-}
diff --git a/sandbox/org.eclipse.papyrus.infra.gmfdiag.css.palette/src/org/eclipse/papyrus/infra/gmfdiag/css/palette/provider/CSSStyleAspectActionProvider.java b/sandbox/org.eclipse.papyrus.infra.gmfdiag.css.palette/src/org/eclipse/papyrus/infra/gmfdiag/css/palette/provider/CSSStyleAspectActionProvider.java
deleted file mode 100644
index bc5529c9ba8..00000000000
--- a/sandbox/org.eclipse.papyrus.infra.gmfdiag.css.palette/src/org/eclipse/papyrus/infra/gmfdiag/css/palette/provider/CSSStyleAspectActionProvider.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2012 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
- *****************************************************************************/
-package org.eclipse.papyrus.infra.gmfdiag.css.palette.provider;
-
-import org.eclipse.papyrus.infra.gmfdiag.css.palette.aspect.CSSStylePostAction;
-import org.eclipse.papyrus.uml.diagram.common.service.palette.AbstractAspectActionProvider;
-import org.eclipse.papyrus.uml.diagram.common.service.palette.IAspectAction;
-import org.eclipse.papyrus.uml.diagram.common.service.palette.IPaletteEntryProxy;
-import org.w3c.dom.Node;
-
-/**
- * A Palette post action provider to automatically add a CSS Style on a newly created element
- *
- * @author Camille Letavernier
- *
- * @see CSSStylePostAction
- */
-public class CSSStyleAspectActionProvider extends AbstractAspectActionProvider {
-
- public IAspectAction createAction(Node configurationNode) {
- IAspectAction cssStylePostAction = new CSSStylePostAction();
- cssStylePostAction.init(configurationNode, this);
- return cssStylePostAction;
- }
-
- public boolean isEnable(IPaletteEntryProxy entryProxy) {
- return true;
- }
-
-}

Back to the top