diff options
| author | Lars Vogel | 2014-01-23 21:03:24 +0000 |
|---|---|---|
| committer | Lars Vogel | 2014-01-29 10:29:00 +0000 |
| commit | 8ba43c4b41d2fc415868a86e80e1df515a9c486a (patch) | |
| tree | ba3f8c61f72bd65d650c4c5595ed48bc7dede06a | |
| parent | f6fadfe1c6ba9806e246ccf4efbd989bae866b78 (diff) | |
| download | eclipse.platform.ui-8ba43c4b41d2fc415868a86e80e1df515a9c486a.tar.gz eclipse.platform.ui-8ba43c4b41d2fc415868a86e80e1df515a9c486a.tar.xz eclipse.platform.ui-8ba43c4b41d2fc415868a86e80e1df515a9c486a.zip | |
Bug 423186 - Need to "clean out" old or unsupported modules from git
repositories
Deletes org.eclipse.e4.ui.examples.css, I looked through it and it does
not look useful anymore.
Change-Id: I9d92e4dec091119eb015bab65c9390b9f19895e1
Signed-off-by: Lars Vogel <Lars.Vogel@gmail.com>
25 files changed, 0 insertions, 1438 deletions
diff --git a/examples/org.eclipse.e4.ui.examples.css/.classpath b/examples/org.eclipse.e4.ui.examples.css/.classpath deleted file mode 100644 index 64c5e31b7a2..00000000000 --- a/examples/org.eclipse.e4.ui.examples.css/.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/examples/org.eclipse.e4.ui.examples.css/.project b/examples/org.eclipse.e4.ui.examples.css/.project deleted file mode 100644 index afc7c919c6b..00000000000 --- a/examples/org.eclipse.e4.ui.examples.css/.project +++ /dev/null @@ -1,28 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<projectDescription> - <name>org.eclipse.e4.ui.examples.css</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/examples/org.eclipse.e4.ui.examples.css/.settings/org.eclipse.core.runtime.prefs b/examples/org.eclipse.e4.ui.examples.css/.settings/org.eclipse.core.runtime.prefs deleted file mode 100644 index c522e1f4ae2..00000000000 --- a/examples/org.eclipse.e4.ui.examples.css/.settings/org.eclipse.core.runtime.prefs +++ /dev/null @@ -1,2 +0,0 @@ -eclipse.preferences.version=1
-line.separator=\n
diff --git a/examples/org.eclipse.e4.ui.examples.css/.settings/org.eclipse.jdt.core.prefs b/examples/org.eclipse.e4.ui.examples.css/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index 7c53145e229..00000000000 --- a/examples/org.eclipse.e4.ui.examples.css/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,7 +0,0 @@ -#Wed Dec 17 23:52:03 EST 2008 -eclipse.preferences.version=1 -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/examples/org.eclipse.e4.ui.examples.css/.settings/org.eclipse.jdt.ui.prefs b/examples/org.eclipse.e4.ui.examples.css/.settings/org.eclipse.jdt.ui.prefs deleted file mode 100644 index 2701adbc904..00000000000 --- a/examples/org.eclipse.e4.ui.examples.css/.settings/org.eclipse.jdt.ui.prefs +++ /dev/null @@ -1,54 +0,0 @@ -eclipse.preferences.version=1 -editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true -sp_cleanup.add_default_serial_version_id=true -sp_cleanup.add_generated_serial_version_id=false -sp_cleanup.add_missing_annotations=true -sp_cleanup.add_missing_deprecated_annotations=true -sp_cleanup.add_missing_methods=false -sp_cleanup.add_missing_nls_tags=false -sp_cleanup.add_missing_override_annotations=true -sp_cleanup.add_missing_override_annotations_interface_methods=true -sp_cleanup.add_serial_version_id=false -sp_cleanup.always_use_blocks=true -sp_cleanup.always_use_parentheses_in_expressions=false -sp_cleanup.always_use_this_for_non_static_field_access=false -sp_cleanup.always_use_this_for_non_static_method_access=false -sp_cleanup.convert_to_enhanced_for_loop=true -sp_cleanup.correct_indentation=true -sp_cleanup.format_source_code=true -sp_cleanup.format_source_code_changes_only=true -sp_cleanup.make_local_variable_final=false -sp_cleanup.make_parameters_final=false -sp_cleanup.make_private_fields_final=true -sp_cleanup.make_type_abstract_if_missing_method=false -sp_cleanup.make_variable_declarations_final=false -sp_cleanup.never_use_blocks=false -sp_cleanup.never_use_parentheses_in_expressions=true -sp_cleanup.on_save_use_additional_actions=true -sp_cleanup.organize_imports=true -sp_cleanup.qualify_static_field_accesses_with_declaring_class=false -sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true -sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true -sp_cleanup.qualify_static_member_accesses_with_declaring_class=false -sp_cleanup.qualify_static_method_accesses_with_declaring_class=false -sp_cleanup.remove_private_constructors=true -sp_cleanup.remove_trailing_whitespaces=true -sp_cleanup.remove_trailing_whitespaces_all=true -sp_cleanup.remove_trailing_whitespaces_ignore_empty=false -sp_cleanup.remove_unnecessary_casts=true -sp_cleanup.remove_unnecessary_nls_tags=true -sp_cleanup.remove_unused_imports=true -sp_cleanup.remove_unused_local_variables=false -sp_cleanup.remove_unused_private_fields=true -sp_cleanup.remove_unused_private_members=false -sp_cleanup.remove_unused_private_methods=true -sp_cleanup.remove_unused_private_types=true -sp_cleanup.sort_members=false -sp_cleanup.sort_members_all=false -sp_cleanup.use_blocks=true -sp_cleanup.use_blocks_only_for_return_and_throw=false -sp_cleanup.use_parentheses_in_expressions=false -sp_cleanup.use_this_for_non_static_field_access=false -sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true -sp_cleanup.use_this_for_non_static_method_access=false -sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true diff --git a/examples/org.eclipse.e4.ui.examples.css/META-INF/MANIFEST.MF b/examples/org.eclipse.e4.ui.examples.css/META-INF/MANIFEST.MF deleted file mode 100644 index 18372021309..00000000000 --- a/examples/org.eclipse.e4.ui.examples.css/META-INF/MANIFEST.MF +++ /dev/null @@ -1,20 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: Css Examples Plug-in (Incubation) -Bundle-SymbolicName: org.eclipse.e4.ui.examples.css -Bundle-Version: 0.9.0.qualifier -Bundle-Activator: org.eclipse.e4.ui.examples.css.Activator -Require-Bundle: org.eclipse.ui, - org.eclipse.core.runtime, - org.eclipse.e4.ui.css.core, - org.eclipse.e4.ui.css.swt, - org.eclipse.swt, - org.w3c.css.sac, - org.apache.batik.css;bundle-version="1.6.0", - org.apache.batik.util;bundle-version="1.6.0", - org.apache.batik.util.gui;bundle-version="1.6.0", - org.apache.batik.xml;bundle-version="1.6.0" -Bundle-ActivationPolicy: lazy -Bundle-RequiredExecutionEnvironment: J2SE-1.5 -Export-Package: org.eclipse.e4.ui.examples.css.editor -Bundle-Vendor: Eclipse.org diff --git a/examples/org.eclipse.e4.ui.examples.css/build.properties b/examples/org.eclipse.e4.ui.examples.css/build.properties deleted file mode 100644 index 34d2e4d2dad..00000000000 --- a/examples/org.eclipse.e4.ui.examples.css/build.properties +++ /dev/null @@ -1,4 +0,0 @@ -source.. = src/ -output.. = bin/ -bin.includes = META-INF/,\ - . diff --git a/examples/org.eclipse.e4.ui.examples.css/forceQualifierUpdate.txt b/examples/org.eclipse.e4.ui.examples.css/forceQualifierUpdate.txt deleted file mode 100644 index 56f1032a8a4..00000000000 --- a/examples/org.eclipse.e4.ui.examples.css/forceQualifierUpdate.txt +++ /dev/null @@ -1,2 +0,0 @@ -# To force a version qualifier update add the bug here -Bug 403352 - Update all parent versions to match our build stream diff --git a/examples/org.eclipse.e4.ui.examples.css/images/bluefade-banner.gif b/examples/org.eclipse.e4.ui.examples.css/images/bluefade-banner.gif Binary files differdeleted file mode 100644 index 672442f5ec9..00000000000 --- a/examples/org.eclipse.e4.ui.examples.css/images/bluefade-banner.gif +++ /dev/null diff --git a/examples/org.eclipse.e4.ui.examples.css/images/bluefade-full.gif b/examples/org.eclipse.e4.ui.examples.css/images/bluefade-full.gif Binary files differdeleted file mode 100644 index 4ed90dc534f..00000000000 --- a/examples/org.eclipse.e4.ui.examples.css/images/bluefade-full.gif +++ /dev/null diff --git a/examples/org.eclipse.e4.ui.examples.css/images/errorstate.gif b/examples/org.eclipse.e4.ui.examples.css/images/errorstate.gif Binary files differdeleted file mode 100644 index a3b621b5709..00000000000 --- a/examples/org.eclipse.e4.ui.examples.css/images/errorstate.gif +++ /dev/null diff --git a/examples/org.eclipse.e4.ui.examples.css/images/lockedstate.gif b/examples/org.eclipse.e4.ui.examples.css/images/lockedstate.gif Binary files differdeleted file mode 100644 index e6379511e95..00000000000 --- a/examples/org.eclipse.e4.ui.examples.css/images/lockedstate.gif +++ /dev/null diff --git a/examples/org.eclipse.e4.ui.examples.css/images/pview.gif b/examples/org.eclipse.e4.ui.examples.css/images/pview.gif Binary files differdeleted file mode 100644 index 4aa54a69d9d..00000000000 --- a/examples/org.eclipse.e4.ui.examples.css/images/pview.gif +++ /dev/null diff --git a/examples/org.eclipse.e4.ui.examples.css/images/sleeping.gif b/examples/org.eclipse.e4.ui.examples.css/images/sleeping.gif Binary files differdeleted file mode 100644 index 1683fca4d67..00000000000 --- a/examples/org.eclipse.e4.ui.examples.css/images/sleeping.gif +++ /dev/null diff --git a/examples/org.eclipse.e4.ui.examples.css/images/waiting.gif b/examples/org.eclipse.e4.ui.examples.css/images/waiting.gif Binary files differdeleted file mode 100644 index 0930dac2303..00000000000 --- a/examples/org.eclipse.e4.ui.examples.css/images/waiting.gif +++ /dev/null diff --git a/examples/org.eclipse.e4.ui.examples.css/pom.xml b/examples/org.eclipse.e4.ui.examples.css/pom.xml deleted file mode 100644 index 4996d41296f..00000000000 --- a/examples/org.eclipse.e4.ui.examples.css/pom.xml +++ /dev/null @@ -1,24 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - Copyright (c) 2012 Eclipse Foundation. - All rights reserved. This program and the accompanying materials - are made available under the terms of the Eclipse Distribution License v1.0 - which accompanies this distribution, and is available at - http://www.eclipse.org/org/documents/edl-v10.php - - Contributors: - Igor Fedorenko - initial implementation ---> -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - <modelVersion>4.0.0</modelVersion> - <parent> - <artifactId>eclipse.platform.ui</artifactId> - <groupId>eclipse.platform.ui</groupId> - <version>4.4.0-SNAPSHOT</version> - <relativePath>../../</relativePath> - </parent> - <groupId>org.eclipse.e4</groupId> - <artifactId>org.eclipse.e4.ui.examples.css</artifactId> - <version>0.9.0-SNAPSHOT</version> - <packaging>eclipse-plugin</packaging> -</project> diff --git a/examples/org.eclipse.e4.ui.examples.css/src/org/eclipse/e4/ui/examples/css/Activator.java b/examples/org.eclipse.e4.ui.examples.css/src/org/eclipse/e4/ui/examples/css/Activator.java deleted file mode 100644 index 0f6f137991a..00000000000 --- a/examples/org.eclipse.e4.ui.examples.css/src/org/eclipse/e4/ui/examples/css/Activator.java +++ /dev/null @@ -1,50 +0,0 @@ -package org.eclipse.e4.ui.examples.css; - -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.e4.ui.examples.css"; - - // The shared instance - private static Activator plugin; - - /** - * The constructor - */ - public Activator() { - } - - /* - * (non-Javadoc) - * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) - */ - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - } - - /* - * (non-Javadoc) - * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) - */ - 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/examples/org.eclipse.e4.ui.examples.css/src/org/eclipse/e4/ui/examples/css/editor/AbstractCSSEditor.java b/examples/org.eclipse.e4.ui.examples.css/src/org/eclipse/e4/ui/examples/css/editor/AbstractCSSEditor.java deleted file mode 100644 index 4e4830837ad..00000000000 --- a/examples/org.eclipse.e4.ui.examples.css/src/org/eclipse/e4/ui/examples/css/editor/AbstractCSSEditor.java +++ /dev/null @@ -1,380 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2008 Angelo Zerr and others. - * 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: - * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation - * IBM Corporation - *******************************************************************************/ -package org.eclipse.e4.ui.examples.css.editor; - -import java.io.BufferedReader; -import java.io.File; -import java.io.FileInputStream; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.io.StringReader; -import java.io.StringWriter; -import java.util.ArrayList; -import java.util.Date; - -import org.eclipse.e4.ui.css.core.dom.IElementProvider; -import org.eclipse.e4.ui.css.core.engine.CSSEngine; -import org.eclipse.e4.ui.css.core.engine.CSSErrorHandler; -import org.eclipse.e4.ui.css.core.exceptions.DOMExceptionImpl; -import org.eclipse.e4.ui.css.core.serializers.CSSHTMLSerializerConfiguration; -import org.eclipse.e4.ui.css.core.serializers.CSSSerializer; -import org.eclipse.e4.ui.css.core.serializers.CSSSerializerConfiguration; -import org.w3c.dom.DOMException; - -/** - * Abstract CSS Editor. - */ -public abstract class AbstractCSSEditor { - - /** - * CSS Engine. - */ - protected CSSEngine engine; - - /** - * CSS Serializer - */ - protected CSSSerializer serializer; - - protected String nativeWidgetDir; - - protected java.util.List cssFiles = new ArrayList(); - - protected AbstractCSSEditor(String nativeWidgetDir) { - this.nativeWidgetDir = nativeWidgetDir; - } - - /** - * Return CSS Engine configured. - * - * @return - */ - protected CSSEngine getCSSEngine() { - // FIXME: don't reset, just make a new engine, see bug 289251 -// if (engine == null) { - // Get SWT CSS Engine - engine = createCSSEngine(); - // Error - engine.setErrorHandler(new CSSErrorHandler() { - public void error(Exception e) { - handleExceptions(e); - } - }); - -// } else { -// // Remove all style sheets. -// engine.reset(); -// } - - if (isHTMLSelector()) { - // Register HTML Element Provider to retrieve - // w3c Element HTMLElement coming from Native Widget. - engine.setElementProvider(getHTMLElementProvider()); - } else { - // Register Native Widget (SWT, Swing...) Element Provider to - // retrieve - // w3c Element Element coming from Native Widget. - engine.setElementProvider(getNativeWidgetElementProvider()); - } - return engine; - } - - /** - * Apply Styles comming from <code>getStyleSheetContent()</code> method to - * implement <code>widget</code>. - * - * @param widget - */ - protected void applyStyles(Object widget) { - try { - Date d1 = new Date(); - engine = getCSSEngine(); - // 1. Parse Style Sheet coming from getStyleSheetContent(). - StringReader reader = new StringReader(getStyleSheetContent()); - engine.parseStyleSheet(reader); - - // 2. Apply styles - engine.applyStyles(widget, true, true); - Date d2 = new Date(); - - // 3. Display time elapsed - setCSSEngineStatuts("Apply style with " - + (d2.getTime() - d1.getTime()) + "ms."); - - } catch (Exception ex) { - handleExceptions(ex); - } - } - - /** - * Apply styles to the fully window or left panel widget. - */ - protected void applyStyles() { - if (mustApplyStylesToWindow()) { - applyStyles(getWindowNativeWidget()); - } else - applyStyles(getLeftPanelNativeWidget()); - } - - protected void fillTextareaWithStyleSheetContent(File file) { - try { - fillTextareaWithStyleSheetContent(new FileInputStream(file)); - } catch (Exception e) { - handleExceptions(e); - } - } - - /** - * Fill the TextArea which store the style sheet content with the - * <code>stream</code> content. - * - * @param stream - */ - protected void fillTextareaWithStyleSheetContent(InputStream stream) { - try { - StringWriter writer = new StringWriter(); - InputStreamReader streamReader = new InputStreamReader(stream); - BufferedReader buffer = new BufferedReader(streamReader); - String line = ""; - boolean b = false; - while (null != (line = buffer.readLine())) { - if (b) - writer.write("\n"); - writer.write(line); - b = true; - } - buffer.close(); - streamReader.close(); - String content = writer.toString(); - setStyleSheetContent(content); - } catch (Exception e) { - handleExceptions(e); - } - } - - protected void fillTextareaWithDefaultStyleSheetContent() { - if (mustApplyStylesToWindow()) - fillTextareaWithDefaultStyleSheetContent(getWindowNativeWidget()); - else - fillTextareaWithDefaultStyleSheetContent(getLeftPanelNativeWidget()); - } - - protected void fillTextareaWithDefaultStyleSheetContent(Object widget) { - if (serializer == null) - this.serializer = new CSSSerializer(); - StringWriter writer = new StringWriter(); - try { - CSSSerializerConfiguration configuration = (isHTMLSelector() ? getCSSHTMLSerializerConfiguration() - : getCSSNativeWidgetSerializerConfiguration()); - serializer.serialize(writer, getCSSEngine(), widget, true, - configuration); - setStyleSheetContent(writer.toString()); - } catch (Exception e) { - handleExceptions(e); - } - } - - protected void applyStylesFromSelectedFile() { - int index = getCSSFilesWidgetSelectionIndex(); - if (index == -1) - if (getCSSFilesWidgetItemCount() > 1) { - index = 1; - selectCSSFilesWidget(index); - // cssFilesWidget.select(index); - } - if (index < 1) { - setStyleSheetContent(""); - return; - } - File file = (File) cssFiles.get(index - 1); - fillTextareaWithStyleSheetContent(file); - } - - protected void populateCSSFiles() { - removeAllCSSFilesWidget(); - int size = cssFiles.size(); - for (int i = 0; i < size; i++) { - cssFiles.remove(0); - } - addItemCSSFilesWidget("None"); - File baseDir = getBaseStyleDir(); - File[] files = baseDir.listFiles(); - for (int i = 0; i < files.length; i++) { - File file = files[i]; - if (file.isFile()) { - addItemCSSFilesWidget(file.getName()); - cssFiles.add(file); - } - } - } - - /** - * Display CSS Engine error - * - * @param e - */ - protected void handleExceptions(Exception e) { - //Don't bother reporting property errors since you get them on every keystroke - //but the last when typing a property name - if(isPropertyValueError(e)) - return; - e.printStackTrace(); - } - - /** - * Return true if @e is a property value exception. - * These will happen as the user types, so ignore them since - * they often represent a word the user hasn't finished yet. - * @param e the exception to be tested - * @return true if @e is a property value exception - */ - protected boolean isPropertyValueError(Exception e) { - if(! (e instanceof DOMExceptionImpl)) - return false; - DOMExceptionImpl domE = (DOMExceptionImpl) e; - return domE.code == DOMException.INVALID_ACCESS_ERR; - } - - protected File getBaseStyleDir() { - if (isHTMLSelector()) - return new File(getBaseStyleDirName() + "/html"); - if (nativeWidgetDir != null) - return new File(getBaseStyleDirName() + "/" + nativeWidgetDir); - return new File(getBaseStyleDirName()); - } - - protected String getBaseStyleDirName() { - return "styles"; - } - - /** - * Create Instance of CSS Engine - * - * @return - */ - protected abstract CSSEngine createCSSEngine(); - - /** - * Return true if HTML selector must be used and false if Native Widget - * Selector must be used. - * - * @return - */ - protected abstract boolean isHTMLSelector(); - - /** - * Return Native Widget Element provider. - * - * @return - */ - protected abstract IElementProvider getNativeWidgetElementProvider(); - - /** - * Return HTML Element provider. - * - * @return - */ - protected abstract IElementProvider getHTMLElementProvider(); - - /** - * Return style sheet content. - * - * @return - */ - protected abstract String getStyleSheetContent(); - - /** - * Set style sheet content. - * - * @param content - */ - protected abstract void setStyleSheetContent(String content); - - /** - * Set CSS Engine status. - * - * @param status - */ - protected abstract void setCSSEngineStatuts(String status); - - /** - * Return true if Styles must be applied to the fully Window and false - * otherwise. - * - * @return - */ - protected abstract boolean mustApplyStylesToWindow(); - - /** - * Get Window Native Widget. - * - * @return - */ - protected abstract Object getWindowNativeWidget(); - - /** - * Get Left Panel Native widget. - * - * @return - */ - protected abstract Object getLeftPanelNativeWidget(); - - /** - * Return CSS Serializer configuration for Native Widget. - * - * @return - */ - protected abstract CSSSerializerConfiguration getCSSNativeWidgetSerializerConfiguration(); - - /** - * Return CSS Serializer configuration for HTML. - * - * @return - */ - protected CSSSerializerConfiguration getCSSHTMLSerializerConfiguration() { - return CSSHTMLSerializerConfiguration.INSTANCE; - } - - /** - * Return selection index of CSS files widget. - * - * @return - */ - protected abstract int getCSSFilesWidgetSelectionIndex(); - - /** - * Return item count of CSS files widget. - * - * @return - */ - protected abstract int getCSSFilesWidgetItemCount(); - - /** - * Select item of CSS files widget at <code>index</code>. - * - * @param index - */ - protected abstract void selectCSSFilesWidget(int index); - - /** - * Remove all items of CSS files widget. - */ - protected abstract void removeAllCSSFilesWidget(); - - /** - * Add item of CSS files widget. - * - * @param item - */ - protected abstract void addItemCSSFilesWidget(String item); - -} diff --git a/examples/org.eclipse.e4.ui.examples.css/src/org/eclipse/e4/ui/examples/css/editor/AbstractCSSSWTEditor.java b/examples/org.eclipse.e4.ui.examples.css/src/org/eclipse/e4/ui/examples/css/editor/AbstractCSSSWTEditor.java deleted file mode 100644 index 2132f03815d..00000000000 --- a/examples/org.eclipse.e4.ui.examples.css/src/org/eclipse/e4/ui/examples/css/editor/AbstractCSSSWTEditor.java +++ /dev/null @@ -1,673 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2008 Angelo Zerr and others. - * 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: - * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation - *******************************************************************************/ -package org.eclipse.e4.ui.examples.css.editor; - -import java.io.File; -import java.util.ArrayList; - -import org.eclipse.e4.ui.css.core.css2.CSS2FontPropertiesHelpers; -import org.eclipse.e4.ui.css.core.dom.IElementProvider; -import org.eclipse.e4.ui.css.core.dom.properties.css2.CSS2FontProperties; -import org.eclipse.e4.ui.css.core.engine.CSSEngine; -import org.eclipse.e4.ui.examples.css.Activator; -import org.eclipse.e4.ui.examples.css.editor.AbstractCSSEditor; -import org.eclipse.e4.ui.css.core.serializers.CSSSerializerConfiguration; -import org.eclipse.e4.ui.css.core.util.impl.resources.FileResourcesLocatorImpl; -import org.eclipse.e4.ui.css.core.util.impl.resources.OSGiResourceLocator; -import org.eclipse.e4.ui.css.swt.dom.SWTElementProvider; -import org.eclipse.e4.ui.css.swt.dom.html.SWTHTMLElementProvider; -import org.eclipse.e4.ui.css.swt.engine.CSSSWTEngineImpl; -import org.eclipse.e4.ui.css.swt.serializers.CSSSWTSerializerConfiguration; -import org.eclipse.swt.SWT; -import org.eclipse.swt.custom.SashForm; -import org.eclipse.swt.custom.StyledText; -import org.eclipse.swt.events.KeyAdapter; -import org.eclipse.swt.events.KeyEvent; -import org.eclipse.swt.events.ModifyEvent; -import org.eclipse.swt.events.ModifyListener; -import org.eclipse.swt.events.MouseAdapter; -import org.eclipse.swt.events.MouseEvent; -import org.eclipse.swt.events.SelectionAdapter; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.graphics.FontData; -import org.eclipse.swt.graphics.Point; -import org.eclipse.swt.graphics.RGB; -import org.eclipse.swt.layout.FillLayout; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.ColorDialog; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.FileDialog; -import org.eclipse.swt.widgets.FontDialog; -import org.eclipse.swt.widgets.Group; -import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.List; -import org.eclipse.swt.widgets.Menu; -import org.eclipse.swt.widgets.MenuItem; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.swt.widgets.Text; -import org.w3c.dom.css.CSSValue; - -/** - * Abstract CSS SWT Editor. - */ -public abstract class AbstractCSSSWTEditor extends AbstractCSSEditor { - - protected static final String[] CSS_FILE_EXTENSION = { "*.css" }; - - private Display display; - - /** - * Textarea which contains content of CSS style sheet. - */ - private StyledText textArea; - - private Button cacheResourcesCheckbox; - - /** - * HTML checkbox to set if CSS must be typed with HTML syntaxe or SWT - * syntax. - */ - private Button htmlCheckbox; - - /** - * Label wich display time elapsed when CSS Engine apply styles. - */ - private Label statusLabel; - - /** - * Apply style when text area change - */ - private Button applyStyleWhenTextAreaChangeCheckbox; - - /** - * Launch Apply style - */ - private Button applyStyleToShellCheckbox; - - protected Shell shell; - - private Composite leftPanel; - - private List cssFilesWidget; - - private java.util.List cssFiles = new ArrayList(); - - private Text selectedCSSPropertyNameText = null; - - private Text selectedCSSPropertyValueText = null; - - protected int currentLine = -1; - - protected AbstractCSSSWTEditor(String nativeWidgetDir, - String[] styleFileExtension) { - super(nativeWidgetDir); - } - - protected AbstractCSSSWTEditor() { - super("swt"); - } - - public void display() { - - display = new Display(); - shell = new Shell(display, SWT.SHELL_TRIM); - GridLayout layout = new GridLayout(); - layout.marginWidth = 0; - layout.marginHeight = 0; - layout.verticalSpacing = 3; - shell.setLayout(layout); - - // create Menus - createMenus(shell); - - /* - * Create a sash form. - */ - SashForm form = new SashForm(shell, SWT.NONE); - form.setLayoutData(new GridData(GridData.FILL_BOTH)); - - /* - * Create left panel with SWT Contents. - */ - createLeftPanel(form); - - /* - * Create right panel with TextArea which contains CSS to load. - */ - createRightPanel(form); - form.setWeights(new int[] { 30, 80 }); - - /* - * Now we open the shell. - */ - shell.setSize(new Point(800, 600)); - shell.open(); - shell.setText("CSS Editors"); - while (!shell.isDisposed()) { - if (!display.readAndDispatch()) - display.sleep(); - } - display.dispose(); - } - - /*-------------------- Menus --------------------**/ - - /** - * Create Menus File, Options - * - * @param shell - */ - protected void createMenus(Shell shell) { - Menu menu = new Menu(shell, SWT.BAR); - shell.setMenuBar(menu); - // Create File item Menu - createMenuItemFile(menu, shell); - // Create Options item Menu - // createMenuItemOptions(menu); - } - - /** - * Create Menu item File with sub menu New and Open - * - * @param menu - * @param shell - */ - protected void createMenuItemFile(Menu menu, final Shell shell) { - MenuItem menuFileHeader = new MenuItem(menu, SWT.CASCADE); - menuFileHeader.setText("&File"); - // File menu - Menu menuFile = new Menu(shell, SWT.DROP_DOWN); - menuFileHeader.setMenu(menuFile); - // New item menu - MenuItem itemNew = new MenuItem(menuFile, SWT.PUSH); - itemNew.setText("&New..."); - itemNew.addSelectionListener(new SelectionAdapter() { - public void widgetSelected(SelectionEvent e) { - fillTextareaWithDefaultStyleSheetContent(); - } - }); - // Open item menu - MenuItem itemOpen = new MenuItem(menuFile, SWT.PUSH); - itemOpen.setText("&Open..."); - itemOpen.addSelectionListener(new SelectionAdapter() { - public void widgetSelected(SelectionEvent e) { - FileDialog dialog = new FileDialog(shell, SWT.NULL); - dialog.setFilterExtensions(CSS_FILE_EXTENSION); - dialog.setText("Select CSS style file"); - dialog.setFilterPath(getBaseStyleDir().getAbsolutePath()); - String path = dialog.open(); - if (path != null) { - File file = new File(path); - fillTextareaWithStyleSheetContent(file); - } - } - }); - - } - - /** - * Create Menu item Options - * - * @param menu - */ - protected void createMenuItemOptions(Menu menu) { - MenuItem menuOptionsHeader = new MenuItem(menu, SWT.CASCADE); - menuOptionsHeader.setText("&Options"); - // Options menu - Menu menuOptions = new Menu(shell, SWT.DROP_DOWN); - menuOptionsHeader.setMenu(menuOptions); - // New item menu - MenuItem itemNew = new MenuItem(menuOptions, SWT.CHECK); - itemNew.setText("&Cache Resource..."); - - } - - /*-------------------- Panel --------------------**/ - - protected void createLeftPanel(Composite parent) { - leftPanel = new Composite(parent, SWT.NONE); - leftPanel.setLayout(new FillLayout()); - createContent(leftPanel); - } - - protected void createRightPanel(Composite parent) { - - SashForm form = new SashForm(parent, SWT.NONE); - form.setLayoutData(new GridData(GridData.FILL_BOTH)); - - GridLayout layout = new GridLayout(); - layout.marginWidth = 0; - layout.marginHeight = 0; - layout.verticalSpacing = 3; - Composite composite = new Composite(form, SWT.NONE); - composite.setLayout(layout); - - statusLabel = new Label(composite, SWT.NONE); - statusLabel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); - - // Create TextArea which contains CSS content. - textArea = new StyledText(composite, SWT.MULTI | SWT.V_SCROLL - | SWT.BORDER); - textArea.setLayoutData(new GridData(GridData.FILL_BOTH)); - textArea.addModifyListener(new ModifyListener() { - public void modifyText(ModifyEvent e) { - if (applyStyleWhenTextAreaChangeCheckbox.getSelection()) - applyStyles(); - } - }); - - textArea.addKeyListener(new KeyAdapter() { - public void keyReleased(KeyEvent e) { - displaySelectedCSSProperty(); - } - }); - textArea.addMouseListener(new MouseAdapter() { - public void mouseDown(MouseEvent e) { - displaySelectedCSSProperty(); - } - }); - - layout = new GridLayout(); - layout.marginWidth = 0; - layout.marginHeight = 0; - layout.verticalSpacing = 3; - composite = new Composite(form, SWT.NONE); - composite.setLayout(layout); - - Group group = new Group(composite, SWT.NONE); - group.setText("Selected CSS Property"); - layout = new GridLayout(2, true); - layout.verticalSpacing = 3; - group.setLayout(layout); - group.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); - - Label label = new Label(group, SWT.NONE); - label.setText("CSS Property name"); - selectedCSSPropertyNameText = new Text(group, SWT.BORDER - | SWT.READ_ONLY); - selectedCSSPropertyNameText.setLayoutData(new GridData( - GridData.FILL_HORIZONTAL)); - - label = new Label(group, SWT.NONE); - label.setText("CSS Property value"); - selectedCSSPropertyValueText = new Text(group, SWT.BORDER); - selectedCSSPropertyValueText.setLayoutData(new GridData( - GridData.FILL_HORIZONTAL)); - selectedCSSPropertyValueText.addKeyListener(new KeyAdapter() { - public void keyReleased(KeyEvent e) { - - String property = selectedCSSPropertyNameText.getText(); - property += ":"; - property += selectedCSSPropertyValueText.getText(); - updateSelectedCSSPropertyValue(property); - } - }); - - final Button b = new Button(group, SWT.PUSH | SWT.BORDER); - b.setText("Change Color"); - b.addSelectionListener(new SelectionAdapter() { - public void widgetSelected(SelectionEvent e) { - ColorDialog colorDialog = new ColorDialog(shell); - colorDialog.setText("ColorDialog Demo"); - String cssValue = selectedCSSPropertyValueText.getText(); - if (cssValue != null && cssValue.length() > 0) { - try { - CSSValue value = engine.parsePropertyValue(cssValue); - RGB rgb = (RGB) engine.convert(value, RGB.class, null); - if (rgb != null) - colorDialog.setRGB(rgb); - } catch (Exception ex) { - handleExceptions(ex); - } - // engine.convert(, RGB.class,); - } - RGB newColor = colorDialog.open(); - if (newColor != null) { - try { - cssValue = engine.convert(newColor, RGB.class, - selectedCSSPropertyNameText.getText()); - if (cssValue == null) - return; - selectedCSSPropertyValueText.setText(cssValue); - String property = selectedCSSPropertyNameText.getText(); - property += ":"; - property += selectedCSSPropertyValueText.getText(); - updateSelectedCSSPropertyValue(property); - } catch (Exception ex) { - handleExceptions(ex); - } - } - } - }); - - final Button b2 = new Button(group, SWT.PUSH | SWT.BORDER); - b2.setText("Change Font"); - b2.addSelectionListener(new SelectionAdapter() { - public void widgetSelected(SelectionEvent e) { - FontDialog fontDialog = new FontDialog(shell); - fontDialog.setText("Choose the font"); - String value = selectedCSSPropertyValueText.getText(); - try { - String propertyName = selectedCSSPropertyNameText.getText(); - CSSValue cssValue = engine.parsePropertyValue(value); - CSS2FontProperties fontProperties = CSS2FontPropertiesHelpers - .createCSS2FontProperties(cssValue, propertyName); - FontData fontData = (FontData) engine.convert(fontProperties, - FontData.class, display); - if (fontData != null) { - FontData[] fontDatas = { fontData }; - fontDialog.setFontList(fontDatas); - } - } catch (Exception ex) { - handleExceptions(ex); - } - FontData newFontData = fontDialog.open(); - if (newFontData != null) { - try { - String cssValue = engine.convert(newFontData, - FontData.class, selectedCSSPropertyNameText - .getText()); - if (cssValue == null) - return; - selectedCSSPropertyValueText.setText(cssValue); - String property = selectedCSSPropertyNameText.getText(); - property += ":"; - property += selectedCSSPropertyValueText.getText(); - updateSelectedCSSPropertyValue(property); - } catch (Exception ex) { - handleExceptions(ex); - } - } - } - }); - - group = new Group(composite, SWT.NONE); - group.setText("CSS Engine options"); - layout = new GridLayout(); - layout.verticalSpacing = 3; - group.setLayout(layout); - group.setLayoutData(new GridData(GridData.FILL_BOTH)); - - cacheResourcesCheckbox = new Button(group, SWT.CHECK); - cacheResourcesCheckbox.setText("Cache Color, Font and Cursor"); - cacheResourcesCheckbox.addSelectionListener(new SelectionAdapter() { - public void widgetSelected(SelectionEvent e) { - if (!cacheResourcesCheckbox.getSelection()) { - engine.getResourcesRegistry().dispose(); - } - } - }); - cacheResourcesCheckbox.setSelection(true); - - applyStyleWhenTextAreaChangeCheckbox = new Button(group, SWT.CHECK); - applyStyleWhenTextAreaChangeCheckbox - .setText("Apply style when textarea change"); - applyStyleWhenTextAreaChangeCheckbox.setSelection(true); - - htmlCheckbox = new Button(group, SWT.CHECK); - htmlCheckbox.setText("is HTML Selector? (otherwise it's SWT Selector)"); - htmlCheckbox.addSelectionListener(new SelectionAdapter() { - public void widgetSelected(SelectionEvent e) { - populateCSSFiles(); - applyStylesFromSelectedFile(); - } - }); - - // Create CSS files list - cssFilesWidget = new List(group, SWT.NONE); - cssFilesWidget.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); - cssFilesWidget.addSelectionListener(new SelectionAdapter() { - public void widgetSelected(SelectionEvent e) { - applyStylesFromSelectedFile(); - } - }); - populateCSSFiles(); - - // Create Apply Style Button. - applyStyleToShellCheckbox = new Button(group, SWT.CHECK); - applyStyleToShellCheckbox.setText("Apply style to Shell?"); - applyStyleToShellCheckbox.addSelectionListener(new SelectionAdapter() { - public void widgetSelected(SelectionEvent e) { - if (applyStyleToShellCheckbox.getSelection()) { - applyStyles(); - } else { - // Apply styles with NONE style to reset - // styles applied into TextArea... - engine = getCSSEngine(); - engine.applyStyles(shell, true); - // Apply styles - applyStyles(); - } - - } - }); - - Button applyStyleButton = new Button(group, SWT.BORDER); - applyStyleButton.setText("Apply style"); - applyStyleButton.addSelectionListener(new SelectionAdapter() { - public void widgetSelected(SelectionEvent e) { - applyStyles(); - } - }); - - form.setWeights(new int[] { 120, 90 }); - - // Select the first CSS style file - applyStylesFromSelectedFile(); - } - - public abstract void createContent(Composite parent); - - protected void displaySelectedCSSProperty() { - selectedCSSPropertyNameText.setText(""); - selectedCSSPropertyValueText.setText(""); - int start = -1; - int end = -1; - -// if (currentLine != -1) -// textArea.setLineBackground(currentLine, 1, null); - - currentLine = textArea.getLineAtOffset(textArea.getCaretOffset()); - if (currentLine + 1 >= textArea.getLineCount()) - return; - start = textArea.getOffsetAtLine(currentLine); - end = textArea.getOffsetAtLine(currentLine + 1) - 2; - if (start <= end) { - String lineText = textArea.getText(start, end); - lineText = lineText.trim(); - int index = lineText.indexOf(":"); - if (index > 0) { - if (lineText.indexOf("{") != -1) - return; - String property = lineText.substring(0, index); - String value = lineText.substring(index + 1, lineText.length()); - value = value.replaceAll(";", ""); - // Remove comment - int commentIndex = value.indexOf("/*"); - if (commentIndex > 0) - value = value.substring(0, commentIndex); - selectedCSSPropertyNameText.setText(property); - selectedCSSPropertyValueText.setText(value); - -// textArea.setLineBackground(currentLine, 1, display -// .getSystemColor(SWT.COLOR_MAGENTA)); - } - } - } - - protected void updateSelectedCSSPropertyValue(String text) { - if (currentLine != -1 && currentLine + 1 >= textArea.getLineCount()) - return; - int start = textArea.getOffsetAtLine(currentLine); - int end = textArea.getOffsetAtLine(currentLine + 1) - 2; - - String startLineText = textArea.getText(0, start); - String endLineText = textArea.getText(end, textArea.getCharCount() - 1); - if (!text.endsWith(";") && !endLineText.startsWith(";")) - text += ";"; - if (endLineText.startsWith(":")) - endLineText.substring(1, endLineText.length()); - String newContent = startLineText + text + endLineText; - textArea.setText(newContent); - } - - /*-------------------- AbstractCSSEditor methods implementation --------------------**/ - - /* - * (non-Javadoc) - * - * @see org.eclipse.e4.ui.core.css.examples.csseditors.AbstractCSSEditor#createCSSEngine() - */ - protected CSSEngine createCSSEngine() { - CSSEngine engine = new CSSSWTEngineImpl(shell.getDisplay()); - engine.getResourcesLocatorManager().registerResourceLocator( - new FileResourcesLocatorImpl()); - return engine; - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.e4.ui.core.css.examples.csseditors.AbstractCSSEditor#getHTMLElementProvider() - */ - protected IElementProvider getHTMLElementProvider() { - return SWTHTMLElementProvider.INSTANCE; - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.e4.ui.core.css.examples.csseditors.AbstractCSSEditor#getNativeWidgetElementProvider() - */ - protected IElementProvider getNativeWidgetElementProvider() { - return SWTElementProvider.INSTANCE; - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.e4.ui.core.css.examples.csseditors.AbstractCSSEditor#isHTMLSelector() - */ - protected boolean isHTMLSelector() { - return htmlCheckbox.getSelection(); - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.e4.ui.core.css.examples.csseditors.AbstractCSSEditor#getStyleSheetContent() - */ - protected String getStyleSheetContent() { - return textArea.getText(); - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.e4.ui.core.css.examples.csseditors.AbstractCSSEditor#setStyleSheetContent(java.lang.String) - */ - protected void setStyleSheetContent(String content) { - textArea.setText(content); - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.e4.ui.core.css.examples.csseditors.AbstractCSSEditor#setCSSEngineStatuts(java.lang.String) - */ - protected void setCSSEngineStatuts(String status) { - statusLabel.setText(status); - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.e4.ui.core.css.examples.csseditors.AbstractCSSEditor#mustApplyStylesToWindow() - */ - protected boolean mustApplyStylesToWindow() { - return applyStyleToShellCheckbox.getSelection(); - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.e4.ui.core.css.examples.csseditors.AbstractCSSEditor#getLeftPanelNativeWidget() - */ - protected Object getLeftPanelNativeWidget() { - return leftPanel; - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.e4.ui.core.css.examples.csseditors.AbstractCSSEditor#getWindowNativeWidget() - */ - protected Object getWindowNativeWidget() { - return shell; - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.e4.ui.core.css.examples.csseditors.AbstractCSSEditor#getCSSNativeWidgetSerializerConfiguration() - */ - protected CSSSerializerConfiguration getCSSNativeWidgetSerializerConfiguration() { - return CSSSWTSerializerConfiguration.INSTANCE; - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.e4.ui.core.css.examples.csseditors.AbstractCSSEditor#getCSSFileWidgetItemCount() - */ - protected int getCSSFilesWidgetItemCount() { - return cssFilesWidget.getItemCount(); - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.e4.ui.core.css.examples.csseditors.AbstractCSSEditor#getCSSFileWidgetSelectionIndex() - */ - protected int getCSSFilesWidgetSelectionIndex() { - return cssFilesWidget.getSelectionIndex(); - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.e4.ui.core.css.examples.csseditors.AbstractCSSEditor#selectCSSFileWidget(int) - */ - protected void selectCSSFilesWidget(int index) { - cssFilesWidget.select(index); - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.e4.ui.core.css.examples.csseditors.AbstractCSSEditor#addCSSFilesWidget(java.lang.String) - */ - protected void addItemCSSFilesWidget(String item) { - cssFilesWidget.add(item); - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.e4.ui.core.css.examples.csseditors.AbstractCSSEditor#removeAllCSSFilesWidget() - */ - protected void removeAllCSSFilesWidget() { - cssFilesWidget.removeAll(); - } -} diff --git a/examples/org.eclipse.e4.ui.examples.css/src/org/eclipse/e4/ui/examples/css/editor/CSSEditorSWTWidgets.java b/examples/org.eclipse.e4.ui.examples.css/src/org/eclipse/e4/ui/examples/css/editor/CSSEditorSWTWidgets.java deleted file mode 100644 index 1b883ca1e53..00000000000 --- a/examples/org.eclipse.e4.ui.examples.css/src/org/eclipse/e4/ui/examples/css/editor/CSSEditorSWTWidgets.java +++ /dev/null @@ -1,116 +0,0 @@ -/******************************************************************************* -s * Copyright (c) 2008 Angelo Zerr and others. - * 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: - * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation - * IBM Corporation - *******************************************************************************/ -package org.eclipse.e4.ui.examples.css.editor; - -import org.eclipse.e4.ui.css.swt.dom.WidgetElement; -import org.eclipse.swt.SWT; -import org.eclipse.swt.custom.CTabFolder; -import org.eclipse.swt.custom.CTabItem; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Combo; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.Text; -import org.eclipse.swt.widgets.ToolBar; - -public class CSSEditorSWTWidgets extends AbstractCSSSWTEditor { - - public void createContent(Composite parent) { - - GridLayout layout = new GridLayout(); - layout.marginWidth = 0; - layout.marginHeight = 0; - layout.verticalSpacing = 3; - Composite composite = new Composite(parent, SWT.NONE); - composite.setLayout(layout); - - //Create SWT ToolBar - ToolBar toolbar = new ToolBar(composite, SWT.HORIZONTAL); - toolbar.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); - - // Create SWT Text - Text text = new Text(composite, SWT.BORDER); - text.setText("bla bla bla..."); - text.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); - - // Create SWT Text [SWT.MULTI] - Text textArea = new Text(composite, SWT.MULTI | SWT.BORDER); - textArea.setText("bla bla bla...[SWT.MULTI]"); - GridData gridData = new GridData(GridData.FILL_HORIZONTAL); - gridData.heightHint = 100; - textArea.setLayoutData(gridData); - - // Create SWT Label - Label label = new Label(composite, SWT.NONE); - label.setText("bla bla bla..."); - label.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); - - // Create Button - Button button = new Button(composite, SWT.BORDER); - button.setText("SWT Button"); - - // Create Button [SWT.CHECK] - Button checkbox = new Button(composite, SWT.CHECK); - checkbox.setText("SWT Button [SWT.CHECK]"); - - // Create Button [SWT.RADIO] - Button radio = new Button(composite, SWT.RADIO); - radio.setText("SWT Button [SWT.RADIO]"); - - // Create Combo - Combo combo = new Combo(composite, SWT.BORDER); - combo.add("Item 1"); - combo.add("Item 2"); - combo.select(0); - - // Create CTabFolder - { - CTabFolder tabFolder = new CTabFolder(composite, SWT.CLOSE); - tabFolder.setUnselectedCloseVisible(true); - tabFolder.setUnselectedImageVisible(true); - - CTabItem tabItem1 = new CTabItem(tabFolder, SWT.NONE); - tabItem1.setText("Busy"); - WidgetElement.setCSSClass(tabItem1, "busy"); - - CTabItem tabItem2 = new CTabItem(tabFolder, SWT.NONE); - tabItem2.setText("Modified"); - WidgetElement.setCSSClass(tabItem2, "modified"); - - tabFolder.setSelection(0); - } - // Create ETabFolder - { - CTabFolder etabFolder = new CTabFolder(composite, SWT.CLOSE); - etabFolder.setUnselectedCloseVisible(true); - etabFolder.setUnselectedImageVisible(true); - - CTabItem etabItem1 = new CTabItem(etabFolder, SWT.NONE); - etabItem1.setText("Busy"); - WidgetElement.setCSSClass(etabItem1, "busy"); - - CTabItem etabItem2 = new CTabItem(etabFolder, SWT.NONE); - etabItem2.setText("Modified"); - WidgetElement.setCSSClass(etabItem2, "modified"); - - etabFolder.setSelection(0); - } - - } - - public static void main(String[] args) { - CSSEditorSWTWidgets editor = new CSSEditorSWTWidgets(); - editor.display(); - } -} diff --git a/examples/org.eclipse.e4.ui.examples.css/styles/html/Osx.css b/examples/org.eclipse.e4.ui.examples.css/styles/html/Osx.css deleted file mode 100644 index 46390e099c7..00000000000 --- a/examples/org.eclipse.e4.ui.examples.css/styles/html/Osx.css +++ /dev/null @@ -1,10 +0,0 @@ -body { - font-family: "Lucida Grande",Serif; - font-size: 11; -} - -input { - font-family: "Lucida Grande",Serif; - font-size: 9; -} - diff --git a/examples/org.eclipse.e4.ui.examples.css/styles/html/Vista.css b/examples/org.eclipse.e4.ui.examples.css/styles/html/Vista.css deleted file mode 100644 index 09093bd55c2..00000000000 --- a/examples/org.eclipse.e4.ui.examples.css/styles/html/Vista.css +++ /dev/null @@ -1,12 +0,0 @@ -body, Tree { - font-family: Calibri; - font-size: 10; - background-color: rgb(233,234,238); - color: rgb(70,70,70); -} - - -input { - font-family: Calibri; - font-size: 10; -} diff --git a/examples/org.eclipse.e4.ui.examples.css/styles/swt/Example.css b/examples/org.eclipse.e4.ui.examples.css/styles/swt/Example.css deleted file mode 100644 index 56732dee473..00000000000 --- a/examples/org.eclipse.e4.ui.examples.css/styles/swt/Example.css +++ /dev/null @@ -1,26 +0,0 @@ -Shell, SashForm { - font-family: "Terminal"; - font-size: 12; - background: url(./images/bluefade-banner.gif); -} - -ToolBar, Button { - font-family: "Terminal"; - font-size: 9; - background: url(./images/bluefade-banner.gif); -} - -Text { - font-family: "Terminal"; - font-size: 11; - background: url(./images/bluefade-full.gif); -} - -CTabFolder { - color: darkblue; - background-color: #D0D0E0; -} -CTabFolder:selected { - color: white; - background-color: #7070EF; -}
\ No newline at end of file diff --git a/examples/org.eclipse.e4.ui.examples.css/styles/swt/Osx.css b/examples/org.eclipse.e4.ui.examples.css/styles/swt/Osx.css deleted file mode 100644 index c4f0a6bd151..00000000000 --- a/examples/org.eclipse.e4.ui.examples.css/styles/swt/Osx.css +++ /dev/null @@ -1,10 +0,0 @@ -Shell, SashForm { - font-family: "Lucida Grande",Serif; - font-size: 11; -} - -ToolBar, Text, Button { - font-family: "Lucida Grande",Serif; - font-size: 9; -} - diff --git a/examples/org.eclipse.e4.ui.examples.css/styles/swt/Vista.css b/examples/org.eclipse.e4.ui.examples.css/styles/swt/Vista.css deleted file mode 100644 index cacaa82ac5e..00000000000 --- a/examples/org.eclipse.e4.ui.examples.css/styles/swt/Vista.css +++ /dev/null @@ -1,13 +0,0 @@ -Shell, Tree { - font-family: Calibri; - font-size: 10; - background-color: rgb(233,234,238); - color: rgb(70,70,70); -} -SashForm { - background-color: black; -} -Text { - font-family: Calibri; - font-size: 10; -} |
