Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf')
-rw-r--r--extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/IRichText.java355
-rw-r--r--extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/IRichTextEditor.java50
-rw-r--r--extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/IRichTextToolBar.java72
-rw-r--r--extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/Messages.java145
-rw-r--r--extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/Resources.properties160
-rw-r--r--extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/RichText.java1671
-rw-r--r--extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/RichTextCommand.java267
-rw-r--r--extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/RichTextEditor.java1555
-rw-r--r--extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/RichTextEditorForm.java59
-rw-r--r--extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/RichTextFormToolkit.java91
-rw-r--r--extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/RichTextImages.java475
-rw-r--r--extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/RichTextListener.java66
-rw-r--r--extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/RichTextPlugin.java80
-rw-r--r--extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/RichTextResources.java148
-rw-r--r--extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/RichTextSelection.java150
-rw-r--r--extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/RichTextToolBar.java191
-rw-r--r--extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/actions/AddCodeAction.java42
-rw-r--r--extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/actions/AddImageAction.java76
-rw-r--r--extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/actions/AddLineAction.java58
-rw-r--r--extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/actions/AddLinkAction.java74
-rw-r--r--extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/actions/AddOrderedListAction.java59
-rw-r--r--extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/actions/AddTableAction.java81
-rw-r--r--extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/actions/AddUnorderedListAction.java59
-rw-r--r--extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/actions/BaseRichTextAction.java83
-rw-r--r--extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/actions/BlockTagAction.java81
-rw-r--r--extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/actions/BoldAction.java67
-rw-r--r--extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/actions/ClearContentAction.java64
-rw-r--r--extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/actions/CopyAction.java84
-rw-r--r--extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/actions/CutAction.java76
-rw-r--r--extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/actions/FindReplaceAction.java388
-rw-r--r--extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/actions/FontNameAction.java121
-rw-r--r--extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/actions/FontSizeAction.java106
-rw-r--r--extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/actions/FontStyleAction.java94
-rw-r--r--extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/actions/IBaseRichTextAction.java62
-rw-r--r--extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/actions/IRichTextAction.java97
-rw-r--r--extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/actions/IRichTextComboAction.java76
-rw-r--r--extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/actions/IndentAction.java59
-rw-r--r--extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/actions/ItalicAction.java67
-rw-r--r--extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/actions/JustifyCenterAction.java58
-rw-r--r--extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/actions/JustifyFullAction.java58
-rw-r--r--extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/actions/JustifyLeftAction.java58
-rw-r--r--extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/actions/JustifyRightAction.java58
-rw-r--r--extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/actions/OutdentAction.java59
-rw-r--r--extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/actions/PasteAction.java247
-rw-r--r--extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/actions/PastePlainTextAction.java62
-rw-r--r--extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/actions/RichTextAction.java158
-rw-r--r--extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/actions/RichTextComboAction.java148
-rw-r--r--extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/actions/SubscriptAction.java68
-rw-r--r--extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/actions/SuperscriptAction.java69
-rw-r--r--extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/actions/TidyAction.java95
-rw-r--r--extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/actions/TidyActionGroup.java82
-rw-r--r--extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/actions/UnderlineAction.java68
-rw-r--r--extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/actions/package.html5
-rw-r--r--extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/dialogs/AddCodeDialog.java79
-rw-r--r--extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/dialogs/AddImageDialog.java143
-rw-r--r--extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/dialogs/AddLinkDialog.java126
-rw-r--r--extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/dialogs/AddTableDialog.java220
-rw-r--r--extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/dialogs/BaseDialog.java91
-rw-r--r--extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/dialogs/FindReplaceDialog.java337
-rw-r--r--extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/dialogs/package.html5
-rw-r--r--extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/html/BlockTag.java195
-rw-r--r--extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/html/FontName.java150
-rw-r--r--extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/html/FontStyle.java197
-rw-r--r--extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/html/Image.java59
-rw-r--r--extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/html/Link.java89
-rw-r--r--extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/html/Table.java196
-rw-r--r--extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/html/package.html5
-rw-r--r--extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/package.html5
-rw-r--r--extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/preferences/RichTextPreferencePage.java183
-rw-r--r--extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/preferences/RichTextPreferences.java51
-rw-r--r--extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/preferences/RichTextPreferencesInitializer.java45
-rw-r--r--extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/preferences/package.html5
72 files changed, 0 insertions, 10983 deletions
diff --git a/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/IRichText.java b/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/IRichText.java
deleted file mode 100644
index 68d20796988..00000000000
--- a/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/IRichText.java
+++ /dev/null
@@ -1,355 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.epf.richtext;
-
-import java.net.URL;
-import java.util.Iterator;
-
-import org.eclipse.epf.richtext.actions.FindReplaceAction;
-import org.eclipse.swt.events.DisposeListener;
-import org.eclipse.swt.events.HelpListener;
-import org.eclipse.swt.events.KeyListener;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Listener;
-
-/**
- * The interface for a rich text control.
- * <p>
- * A rich text control is an editable user interface object that displays rich
- * text and images.
- *
- * @author Kelvin Low
- * @author Jeff Hardy
- * @since 1.0
- */
-public interface IRichText {
-
- public static final String PROPERTY_NAME = "richText"; //$NON-NLS-1$
-
- /**
- * Returns this rich text control.
- *
- * @return this rich text control
- */
- public Control getControl();
-
- /**
- * Sets the layout data.
- *
- * @param layoutData
- * the layout data to set
- */
- public void setLayoutData(Object layoutData);
-
- /**
- * Returns the layout data.
- *
- * @return this control's layout data
- */
- public Object getLayoutData();
-
- /**
- * Sets focus to this control.
- */
- public void setFocus();
-
- /**
- * Tells the control it does not have focus.
- */
- public void setBlur();
-
- /**
- * Checks whether this control has focus.
- *
- * @return <code>true</code> if this control has the user-interface focus
- */
- public boolean hasFocus();
-
- /**
- * Returns the base path used for resolving text and image links.
- *
- * @return the base path used for resolving links in this control
- */
- public String getBasePath();
-
- /**
- * Returns the editable state.
- *
- * @return <code>true</code> if the content is ediatble
- */
- public boolean getEditable();
-
- /**
- * Sets the editable state.
- *
- * @param editable
- * the editable state
- */
- public void setEditable(boolean editable);
-
- /**
- * Checks whether the content has been modified.
- *
- * @return <code>true</code> if the content has been modified
- */
- public boolean getModified();
-
- /**
- * Sets the modified state.
- *
- * @param modified
- * the modified state
- */
- public void setModified(boolean modified);
-
- /**
- * Returns the rich text content.
- *
- * @return the rich text content formatted in a markup language
- */
- public String getText();
-
- /**
- * Sets the rich text content.
- *
- * @param text
- * the rich text content formatted in a markup language
- */
- public void setText(String text);
-
- /**
- * Restores the rich text content back to the initial value.
- */
- public void restoreText();
-
- /**
- * Checks whether the editor content has been modified. If it has been
- * modified, notify the modify listeners.
- */
- public void checkModify();
-
- /**
- * Returns an object that describes the current selection
- *
- * @return a <code>RichTextSelection</code> object
- */
- public RichTextSelection getSelected();
-
- /**
- * Returns an application specific property value.
- *
- * @param key
- * the name of the property
- * @return the value of the property or <code>null</code> if it has not
- * been set
- */
- public Object getData(String key);
-
- /**
- * Sets an application specific property name and value.
- *
- * @param key
- * the name of the property
- * @param value
- * the property value
- */
- public void setData(String key, Object value);
-
- /**
- * Executes the given rich text command. The supported command strings are
- * defined in <code>RichTextCommand<code>.
- *
- * @param command a rich text command string
- * @return a status code returned by the executed command
- */
- public int executeCommand(String command);
-
- /**
- * Executes the given rich text command with a single parameter. The
- * supported command strings are defined in <code>RichTextCommand<code>.
- *
- * @param command a rich text command string
- * @param param a parameter for the command or <code>null</code>
- * @return a status code returned by the executed command
- */
- public int executeCommand(String command, String param);
-
- /**
- * Executes the given rich text command with an array of parameters. The
- * supported command strings are defined in <code>RichTextCommand<code>.
- *
- * @param command a rich text command string
- * @param params an array of parameters for the command or <code>null</code>
- * @return a status code returned by the executed command
- */
- public int executeCommand(String command, String[] params);
-
- /**
- * Returns the modify listeners attached to this control.
- *
- * @return an iterator for retrieving the modify listeners
- */
- public Iterator<ModifyListener> getModifyListeners();
-
- /**
- * Adds a listener to the collection of listeners who will be notified when
- * keys are pressed and released within this control.
- *
- * @param listener
- * the listener which should be notified
- */
- public void addKeyListener(KeyListener listener);
-
- /**
- * Removes a listener from the collection of listeners who will be notified
- * when keys are pressed and released within this control.
- *
- * @param listener
- * the listener which should no longer be notified
- */
- public void removeKeyListener(KeyListener listener);
-
- /**
- * Adds a listener to the collection of listeners who will be notified when
- * the content of this control is modified.
- *
- * @param listener
- * the listener which should be notified
- */
- public void addModifyListener(ModifyListener listener);
-
- /**
- * Removes a listener from the collection of listeners who will be notified
- * when the content of this control is modified.
- *
- * @param listener
- * the listener which should no longer be notified
- */
- public void removeModifyListener(ModifyListener listener);
-
- /**
- * Adds the listener to the collection of listeners who will be notifed when
- * this control is disposed.
- *
- * @param listener
- * the listener which should be notified
- */
- public void addDisposeListener(DisposeListener listener);
-
- /**
- * Removes a listener from the collection of listeners who will be notified
- * when this control is disposed.
- *
- * @param listener
- * the listener which should no longer be notified
- */
- public void removeDisposeListener(DisposeListener listener);
-
- /**
- * Adds a listener to the collection of listeners who will be notified when
- * help events are generated for this control.
- *
- * @param listener
- * the listener which should be notified
- */
- public void addHelpListener(HelpListener listener);
-
- /**
- * Removes a listener from the collection of listeners who will be notified
- * when help events are generated for this control.
- *
- * @param listener
- * the listener which should no longer be notified
- */
- public void removeHelpListener(HelpListener listener);
-
- /**
- * Adds the listener to the collection of listeners who will be notifed when
- * an event of the given type occurs within this control.
- *
- * @param eventType
- * the type of event to listen for
- * @param listener
- * the listener which should be notified when the event occurs
- */
- public void addListener(int eventType, Listener listener);
-
- /**
- * Removes the listener from the collection of listeners who will be notifed
- * when an event of the given type occurs within this econtrol.
- *
- * @param eventType
- * the type of event to listen to
- * @param listener
- * the listener which should no longer be notified when the event
- * occurs
- */
- public void removeListener(int eventType, Listener listener);
-
- /**
- * Notifies the modify listeners
- *
- */
- public void notifyModifyListeners();
-
- /**
- * Returns the event listeners attached to this control.
- *
- * @return an iterator for retrieving the event listeners attached to this
- * control
- */
- public Iterator<RichTextListener> getListeners();
-
- /**
- * Returns the base URL of the rich text control whose content was last
- * copied to the clipboard.
- *
- * @return the base URL of a rich text control
- */
- public URL getCopyURL();
-
- /**
- * Sets the base URL of the rich text control whose content was last copied
- * to the clipboard.
- */
- public void setCopyURL();
-
- /**
- * Disposes the operating system resources allocated by this control.
- */
- public void dispose();
-
- /**
- * Checks whether this control has been disposed.
- *
- * @return <code>true</code> if this control is disposed successfully
- */
- public boolean isDisposed();
-
- /**
- *
- * @return the control's FindReplaceAction
- */
- public FindReplaceAction getFindReplaceAction();
-
- /**
- * Sets the FindReplaceAction to use
- * @param findReplaceAction
- */
- public void setFindReplaceAction(FindReplaceAction findReplaceAction);
-
- /**
- * Sets the initialText variable, which stores what is saved on disk
- * @param text
- */
- public void setInitialText(String text);
-} \ No newline at end of file
diff --git a/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/IRichTextEditor.java b/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/IRichTextEditor.java
deleted file mode 100644
index 9905e7578f8..00000000000
--- a/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/IRichTextEditor.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.epf.richtext;
-
-import org.eclipse.epf.richtext.actions.FindReplaceAction;
-
-/**
- * The interface for a rich text editor.
- * <p>
- * A rich text editor is a composite user interface object that includes a tool
- * bar, a tab folder for entering the rich text content, and a tab folder for
- * viewing and modifying the rich text content in a markup language.
- *
- * @author Kelvin Low
- * @since 1.0
- */
-public interface IRichTextEditor extends IRichText {
-
- /**
- * Fills the tool bar with rich text action items.
- *
- * @param toolBar
- * a rich text editor tool bar
- */
- public void fillToolBar(IRichTextToolBar toolBar);
-
- /**
- * Selects the rich text or the markup language tab.
- *
- * @param index
- * <code>0</code> for the rich text tab, <code>1</code> for
- * the markup language tab
- */
- public void setSelection(int index);
-
- /**
- * Sets the FindReplaceAction to use
- * @param findReplaceAction
- */
- public void setFindReplaceAction(FindReplaceAction findReplaceAction);
-
-}
diff --git a/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/IRichTextToolBar.java b/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/IRichTextToolBar.java
deleted file mode 100644
index fa8b434f715..00000000000
--- a/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/IRichTextToolBar.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-//------------------------------------------------------------------------------
-// Copyright (c) 2005, 2006 IBM Corporation 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:
-// IBM Corporation - initial implementation
-//------------------------------------------------------------------------------
-package org.eclipse.epf.richtext;
-
-import org.eclipse.epf.richtext.actions.RichTextComboAction;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.action.ToolBarManager;
-
-/**
- * The interface for a rich text editor toolbar.
- *
- * @author Kelvin Low
- * @since 1.0
- */
-public interface IRichTextToolBar {
-
-
- /**
- * Adds a button action to the tool bar.
- *
- * @param action
- * the button action to add
- */
- public void addAction(IAction action);
-
- /**
- * Adds a combo action to the tool bar.
- *
- * @param action
- * the combo action to add
- */
- public void addAction(RichTextComboAction item);
-
- /**
- * Adds a separator to the tool bar.
- */
- public void addSeparator();
-
- /**
- * Updates the toolbar state.
- * <p>
- * Enables/disables actions depending on the currently selected
- * RichTextEditor tab (RichText vs. HTML)
- *
- * @param editable specifies whether to enable non-ReadOnly commands
- */
- public void updateToolBar(boolean enabled);
-
- /**
- *
- * @return the toolbar manager
- */
- public ToolBarManager getToolbarMgr();
-}
diff --git a/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/Messages.java b/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/Messages.java
deleted file mode 100644
index c3b3dd6d417..00000000000
--- a/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/Messages.java
+++ /dev/null
@@ -1,145 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-//------------------------------------------------------------------------------
-// Copyright (c) 2005, 2007 IBM Corporation 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:
-// IBM Corporation - initial implementation
-//------------------------------------------------------------------------------
-package org.eclipse.epf.richtext;
-
-import org.eclipse.osgi.util.NLS;
-
-/**
- * The RichText resources.
- *
- * @author Kelvin Low
- * @author Jeff Hardy
- * @since 1.0
- */
-public final class Messages extends NLS {
-
- static {
- NLS.initializeMessages("messages", Messages.class); //$NON-NLS-1$
- }
-
- private Messages() {
- }
-
- public static String fontNameAction_CSS_Default;
- public static String fontNameAction_CSS_Default_Mozilla;
- public static String fontNameAction_DefaultFontName;
- public static String fontStyle_normal;
- public static String fontStyle_sectionHeading;
- public static String fontStyle_subsectionHeading;
- public static String fontStyle_subSubsectionHeading;
- public static String fontStyle_quote;
- public static String fontStyle_codeSample;
- public static String blockTag_paragraph;
- public static String blockTag_heading1;
- public static String blockTag_heading2;
- public static String blockTag_heading3;
- public static String blockTag_heading4;
- public static String blockTag_heading5;
- public static String blockTag_heading6;
- public static String blockTag_address;
- public static String blockTag_preformattedText;
- public static String fontName_default;
- public static String fontName_arial;
- public static String fontName_courierNew;
- public static String fontName_timesNewRoman;
- public static String fontName_verdana;
- public static String addHorizontalBarAction_toolTipText;
- public static String addImageAction_toolTipText;
- public static String addLineAction_toolTipText;
- public static String addLinkAction_toolTipText;
- public static String addOrderedListAction_toolTipText;
- public static String addTableAction_toolTipText;
- public static String addUnorderedListAction_toolTipText;
- public static String boldAction_toolTipText;
- public static String clearContentAction_toolTipText;
- public static String copyAction_toolTipText;
- public static String cutAction_toolTipText;
- public static String findReplaceAction_toolTipText;
- public static String indentAction_toolTipText;
- public static String italicAction_toolTipText;
- public static String justifyCenterAction_toolTipText;
- public static String justifyFullAction_toolTipText;
- public static String justifyLeftAction_toolTipText;
- public static String justifyRightAction_toolTipText;
- public static String outdentAction_toolTipText;
- public static String pasteAction_toolTipText;
- public static String pastePlainTextAction_toolTipText;
- public static String subscriptAction_toolTipText;
- public static String superscriptAction_toolTipText;
- public static String underlineAction_toolTipText;
- public static String fontStyleAction_toolTipText;
- public static String blockTagAction_toolTipText;
- public static String fontNameAction_toolTipText;
- public static String fontSizeAction_toolTipText;
- public static String cutAction_text;
- public static String copyAction_text;
- public static String pasteAction_text;
- public static String pastePlainTextAction_text;
- public static String richTextTab_text;
- public static String richTextTab_toolTipText;
- public static String htmlTab_text;
- public static String htmlTab_toolTipText;
- public static String addImageDialog_title;
- public static String addLinkDialog_title;
- public static String addTableDialog_title;
- public static String findReplaceDialog_title;
- public static String urlDisplayNameLabel_text;
- public static String urlLabel_text;
- public static String summaryLabel_text;
- public static String captionLabel_text;
- public static String rowsLabel_text;
- public static String columnsLabel_text;
- public static String widthLabel_text;
- public static String tableStyleLabel_text;
- public static String tableHeaderNone_text;
- public static String tableHeaderCols_text;
- public static String tableHeaderRows_text;
- public static String tableHeaderBoth_text;
- public static String browseButton_text;
- public static String clearContentDialog_title;
- public static String clearContentDialog_text;
- public static String findLabel_text;
- public static String replaceLabel_text;
- public static String optionsGroup_text;
- public static String caseSensitiveCheckbox_text;
- public static String wholeWordCheckbox_text;
- public static String directionGroup_text;
- public static String forwardRadioButton_text;
- public static String backwardRadioButton_text;
- public static String findButton_text;
- public static String replaceButton_text;
- public static String replaceFindButton_text;
- public static String replaceallButton_text;
- public static String FindReplace_Status_noMatch_label;
- public static String maxCharsPerLineLabel_text;
- public static String indentHTMLCheckbox_text;
- public static String indentSizeLabel_text;
- public static String tidy_clean_text;
- public static String tidy_cleaner_text;
- public static String tidy_cleanest_text;
- public static String tidy_clean_toolTipText;
- public static String tidy_cleaner_toolTipText;
- public static String tidy_cleanest_toolTipText;
- public static String addCodeAction_toolTipText;
- public static String addCodeDialog_title;
- public static String addCodeDialog_Msg;
-
-} \ No newline at end of file
diff --git a/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/Resources.properties b/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/Resources.properties
deleted file mode 100644
index 1eeeb7bc043..00000000000
--- a/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/Resources.properties
+++ /dev/null
@@ -1,160 +0,0 @@
-###############################################################################
-# Copyright (c) 2009 IBM Corporation 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:
-# IBM Corporation - initial API and implementation
-###############################################################################
-#-------------------------------------------------------------------------------
-# Copyright (c) 2000, 2007 IBM Corporation 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:
-# IBM Corporation - initial implementation.
-#-------------------------------------------------------------------------------
-# NLS_MESSAGEFORMAT_VAR
-
-################################################################################
-# BEGIN NO TRANSLATION
-###############################################################################
-# !! DO NOT TRANSLATE THE FOLLOWING LINE !!
-fontNameAction_CSS_Default=arial, helvetica, sans-serif
-# !! DO NOT TRANSLATE THE FOLLOWING LINE !!
-fontNameAction_CSS_Default_Mozilla=arial,helvetica,sans-serif
-################################################################################
-# END NO TRANSLATION
-################################################################################
-
-
-
-# Font Style Names
-fontStyle_normal=Normal
-fontStyle_sectionHeading=Section Heading
-fontStyle_subsectionHeading=Subsection Heading
-fontStyle_subSubsectionHeading=Sub Subsection Heading
-fontStyle_quote=Quote
-fontStyle_codeSample=Code Sample
-
-# HTML Block Tags
-blockTag_paragraph=Paragraph
-blockTag_heading1=Heading 1
-blockTag_heading2=Heading 2
-blockTag_heading3=Heading 3
-blockTag_heading4=Heading 4
-blockTag_heading5=Heading 5
-blockTag_heading6=Heading 6
-blockTag_address=Address
-blockTag_preformattedText=Preformatted Text
-
-# HTML Font Names
-fontName_default=Default
-fontName_arial=Arial
-fontName_courierNew=Courier New
-fontName_timesNewRoman=Times New Roman
-fontName_verdana=Verdana
-
-# Rich Text Editor Tool Buttons
-addHorizontalBarAction_toolTipText=Add Horizontal Bar
-addImageAction_toolTipText=Add Image
-addLineAction_toolTipText=Add Line
-addLinkAction_toolTipText=Add Link
-addOrderedListAction_toolTipText=Add Ordered List
-addTableAction_toolTipText=Add Table
-addUnorderedListAction_toolTipText=Add Unordered List
-boldAction_toolTipText=Bold
-clearContentAction_toolTipText=Clear Content
-copyAction_toolTipText=Copy
-cutAction_toolTipText=Cut
-findReplaceAction_toolTipText=Find/Replace
-indentAction_toolTipText=Indent
-italicAction_toolTipText=Italic
-justifyCenterAction_toolTipText=Justify Center
-justifyFullAction_toolTipText=Justify Full
-justifyLeftAction_toolTipText=Justify Left
-justifyRightAction_toolTipText=Justify Right
-outdentAction_toolTipText=Outdent
-pasteAction_toolTipText=Paste
-pastePlainTextAction_toolTipText=Paste as plain text
-subscriptAction_toolTipText=Subscript
-superscriptAction_toolTipText=Superscript
-underlineAction_toolTipText=Underline
-tidy_clean_text=Default Clean
-tidy_cleaner_text=Clean MS HTML
-tidy_cleanest_text=Clean Word 2000 HTML
-tidy_clean_toolTipText=Clean with JTidy using default options
-tidy_cleaner_toolTipText=Clean HTML of MS HTML
-tidy_cleanest_toolTipText=Clean Word 2000 HTML
-addCodeAction_toolTipText=Insert custom html (javascript or video)
-
-# Rich Text Editor Comboboxes
-fontStyleAction_toolTipText=Set Font Style
-blockTagAction_toolTipText=Set Block Tag
-fontNameAction_toolTipText=Set Font
-fontNameAction_DefaultFontName=Default font
-fontSizeAction_toolTipText=Set Font Size
-
-# Rich Text Editor Context Menu Items
-cutAction_text=&Cut
-copyAction_text=C&opy
-pasteAction_text=&Paste
-pastePlainTextAction_text=Paste &as plain text
-
-# Rich Text Editor Tabs
-richTextTab_text=Rich Text
-richTextTab_toolTipText=Edit content in rich text
-htmlTab_text=HTML
-htmlTab_toolTipText=Edit content in HTML
-
-# Add Dialogs
-addImageDialog_title=Add Image
-addLinkDialog_title=Add Link
-addTableDialog_title=Add Table
-findReplaceDialog_title=Find/Replace
-urlLabel_text=URL:
-summaryLabel_text=Summary:
-captionLabel_text=Caption:
-rowsLabel_text=Rows:
-columnsLabel_text=Columns:
-widthLabel_text=Width:
-tableStyleLabel_text=Style:
-tableHeaderNone_text=Table with no headers
-tableHeaderCols_text=Table with column headers
-tableHeaderRows_text=Table with row headers
-tableHeaderBoth_text=Table with column and row headers
-browseButton_text=Browse...
-addCodeDialog_title=Insert Custom Html
-addCodeDialog_Msg=Input your html for javascript or video:
-
-# Clear Editor Content Dialog
-clearContentDialog_title=Clear Editor Content Confirmation
-clearContentDialog_text=Do you really want to clear the content of this rich text editor?
-
-# Find/Replace Dialog
-findLabel_text=Find:
-replaceLabel_text=Replace with:
-optionsGroup_text=Options
-caseSensitiveCheckbox_text=Case sensitive
-wholeWordCheckbox_text=Whole word
-directionGroup_text=Direction
-forwardRadioButton_text=Forward
-backwardRadioButton_text=Backward
-findButton_text=Find
-replaceButton_text=Replace
-replaceFindButton_text=Replace/Find
-replaceallButton_text=Replace All
-# taken from org.eclipse.ui.workbench.texteditor
-FindReplace_Status_noMatch_label=String Not Found
-
-# Preference Page
-maxCharsPerLineLabel_text=Maximum characters per line:
-indentHTMLCheckbox_text=Indent HTML tags
-indentSizeLabel_text=Indent Size:
-urlDisplayNameLabel_text=URL Display Name:
-
-
diff --git a/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/RichText.java b/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/RichText.java
deleted file mode 100644
index b0ec1071064..00000000000
--- a/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/RichText.java
+++ /dev/null
@@ -1,1671 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-//------------------------------------------------------------------------------
-// Copyright (c) 2005, 2007 IBM Corporation 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:
-// IBM Corporation - initial implementation
-//------------------------------------------------------------------------------
-package org.eclipse.epf.richtext;
-
-import java.io.File;
-import java.io.StringWriter;
-import java.io.UnsupportedEncodingException;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.epf.common.CommonPlugin;
-import org.eclipse.epf.common.IHTMLFormatter;
-import org.eclipse.epf.common.serviceability.Logger;
-import org.eclipse.epf.common.utils.ExtensionHelper;
-import org.eclipse.epf.common.utils.FileUtil;
-import org.eclipse.epf.common.utils.XMLUtil;
-import org.eclipse.epf.common.xml.XSLTProcessor;
-import org.eclipse.epf.richtext.actions.CopyAction;
-import org.eclipse.epf.richtext.actions.CutAction;
-import org.eclipse.epf.richtext.actions.FindReplaceAction;
-import org.eclipse.epf.richtext.actions.PasteAction;
-import org.eclipse.epf.richtext.actions.PastePlainTextAction;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.browser.Browser;
-import org.eclipse.swt.browser.LocationAdapter;
-import org.eclipse.swt.browser.LocationEvent;
-import org.eclipse.swt.browser.StatusTextEvent;
-import org.eclipse.swt.browser.StatusTextListener;
-import org.eclipse.swt.events.ControlAdapter;
-import org.eclipse.swt.events.ControlEvent;
-import org.eclipse.swt.events.DisposeEvent;
-import org.eclipse.swt.events.DisposeListener;
-import org.eclipse.swt.events.HelpListener;
-import org.eclipse.swt.events.KeyAdapter;
-import org.eclipse.swt.events.KeyEvent;
-import org.eclipse.swt.events.KeyListener;
-import org.eclipse.swt.events.MenuEvent;
-import org.eclipse.swt.events.MenuListener;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.swt.widgets.MenuItem;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * The default rich text control implementation.
- * <p>
- * The default rich text editor uses XHTML as the underlying markup language for
- * the rich text content. It is implemented using a SWT <code>Browser</code>
- * control and DHTML (HTML, CSS and JavaScript).
- *
- * @author Kelvin Low
- * @author Jeff Hardy
- * @since 1.0
- */
-public class RichText implements IRichText {
-
- // Encoded single quote. All single quotes need to be specially encoded to
- // avoid JavaScript error when calling Browse.executeCommand().
- private static final String ENCODED_SINGLE_QUOTE = "%sq%"; //$NON-NLS-1$
-
- private static final String ENCODED_NEWLINE = "%EOL%"; //$NON-NLS-1$
-
- protected static final String STATUS_PREFIX = "$$$"; //$NON-NLS-1$
-
- protected static final int STATUS_PREFIX_LENGTH = STATUS_PREFIX.length();
-
- protected static final int STATUS_NOP = 0;
-
- protected static final int STATUS_INITIALIZED = 1;
-
- protected static final int STATUS_MODIFIED = 2;
-
- protected static final int STATUS_GET_TEXT = 3;
-
- protected static final int STATUS_KEY_DOWN = 4;
-
- protected static final int STATUS_KEY_UP = 5;
-
- protected static final int STATUS_SELECT_TEXT = 6;
-
- protected static final int STATUS_SELECT_CONTROL = 7;
-
- protected static final int STATUS_SELECT_NONE = 8;
-
- protected static final int STATUS_EXEC_CMD = 9;
-
- protected static final int STATUS_REFORMAT_LINKS = 10;
-
- // The default base path used for resolving links (<href>, <img>, etc.)
- private static final String DEFAULT_BASE_PATH = System
- .getProperty("user.home") //$NON-NLS-1$
- + System.getProperty("file.separator") + "rte"; //$NON-NLS-1$ //$NON-NLS-2$
-
- // If true, log debugging info.
- protected boolean debug;
-
- // The plug-in logger.
- protected Logger logger;
-
- // The underlying SWT Browser used for loading the JavaScript/DHTML editor.
- protected Browser editor;
-
- // The underlying OleControlSite for the SWT Browser (Win32 only).
- protected Control editorControl;
-
- // The base URL of the rich text control whose content was last
- // copied to the clipboard.
- protected static URL copyURL;
-
- // The context menu associated with this control.
- protected Menu contextMenu;
-
- // The folder that contains the supporting CSS and JavaScript files
- protected String rteFolder;
-
- // The URL that points to the supporting CSS and JavaScript files.
- protected String rteURL;
-
- // The base path used for resolving links (<href>, <img>, etc.)
- protected String basePath;
-
- // The DHTML initialization flag.
- protected boolean initialized;
-
- // The initial focus.
- protected boolean initializedWithFocus;
-
- // The control's initial text. This is used to cache the HTML source passed
- // in via setText()while the DHTML initialization is happening.
- protected String initialText;
-
- // The control's current text.
- protected String currentText = ""; //$NON-NLS-1$
-
- // The control's editable flag.
- protected boolean editable = true;
-
- // The control's modification flag.
- protected boolean modified;
-
- // The control's text and object selection flag.
- protected boolean hasSelection;
-
- // The control's text selection
- protected RichTextSelection richTextSelection = new RichTextSelection();
-
- // JavaScript command execution status code.
- protected int status = 0;
-
- // The HTML source formatter.
- protected IHTMLFormatter htmlFormatter;
-
- // The SWT event listeners.
- protected Map<Listener, RichTextListener> listeners;
-
- // The modify listeners.
- protected List<ModifyListener> modifyListeners;
-
- // The control's edit flag.
- protected boolean notifyingModifyListeners = false;
-
- // The controls's focus flag.
- protected boolean hasFocus = false;
-
- // The controls's processing JavaScript event flag.
- protected boolean processingJSEvent = false;
-
- // The controls's processing MODIFIED JavaScript event flag.
- protected boolean checkingModifyEvent = false;
-
- // The control's find/replace text action
- protected FindReplaceAction findReplaceAction;
-
- // The control's IE flag
- protected boolean isIE = false;
-
- // A event type indicate control has been initialized
- public static final int RICH_TEXT_INITIALIZED_WIN32 = 98979695;
- public static final int RICH_TEXT_INITIALIZED_LINUX = 98979694;
-
- /**
- * Creates a new instance.
- *
- * @param parent
- * the parent composite
- * @param style
- * the style for this control
- * @param basePath
- * the path used for resolving links
- */
- public RichText(Composite parent, int style, String basePath) {
- debug = RichTextPlugin.getDefault().isDebugging();
- logger = RichTextPlugin.getDefault().getLogger();
- findReplaceAction = new FindReplaceAction(this);
- rteFolder = RichTextPlugin.getDefault().getInstallPath() + "rte/"; //$NON-NLS-1$
- rteURL = XMLUtil.escape("file://" + rteFolder); //$NON-NLS-1$
- setBasePath(basePath);
-
- try {
- editor = new Browser(parent, SWT.NONE);
- if (debug) {
- printDebugMessage("RichText", "basePath=" + basePath); //$NON-NLS-1$ //$NON-NLS-2$
- }
- editor.setLayoutData(new GridData(GridData.FILL_BOTH));
- editor.setData(PROPERTY_NAME, this);
- init(parent, style);
- } catch (Exception e) {
- editor = null;
- String msg = "Failed to create RichText with basePath=" + basePath; //$NON-NLS-1$
- logger.logError(msg, e);
- if (debug) {
- System.out.println(msg);
- e.printStackTrace();
- }
- }
- }
-
- /**
- * Creates a new instance.
- *
- * @param parent
- * the parent composite
- * @param style
- * the style for this control
- */
- public RichText(Composite parent, int style) {
- this(parent, style, null);
- }
-
- /**
- * Sets the base path for resolving links.
- */
- protected void setBasePath(String path) {
- if (path != null && path.length() > 0) {
- if (path.startsWith(FileUtil.UNC_PATH_PREFIX)) {
- basePath = FileUtil.UNC_PATH_PREFIX
- + FileUtil.appendSeparator(path.substring(
- FileUtil.UNC_PATH_PREFIX_LENGTH).replace('\\',
- '/'), "/"); //$NON-NLS-1$
- } else {
- basePath = FileUtil.appendSeparator(path).replace('\\', '/');
- }
- } else {
- basePath = FileUtil.appendSeparator(DEFAULT_BASE_PATH).replace(
- '\\', '/');
- }
- }
-
- /**
- * Initializes this control.
- *
- * @param parent
- * the parent composite
- * @param style
- * the style for this control
- * @throws Exception
- * when an error has occurred while initialzing this control
- */
- protected void init(Composite parent, int style) throws Exception {
- try {
- addStatusTextListener();
-
- // Bug 244838 : Enforce Browser resizing when its container is resized
- editor.addControlListener(new ControlAdapter() {
- @Override
- public void controlResized(ControlEvent e) {
- if (!Platform.getOS().equals("win32")) { //$NON-NLS-1$
- // Workaround Mozilla'a IFRAME height issue.
- executeCommand(RichTextCommand.SET_HEIGHT, "" + editor.getBounds().height); //$NON-NLS-1$
- }
- }
- });
-
- if (debug) {
- printDebugMessage("init", "added status text listener"); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- String editorHTML = generateEditorHTML();
- if (debug) {
- printDebugMessage("init", "generated editor HTML"); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- editor.setText(editorHTML);
- if (debug) {
- printDebugMessage("init", "loaded editor HTML"); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- contextMenu = new Menu(parent.getShell(), SWT.POP_UP);
- editor.setMenu(contextMenu);
- fillContextMenu(contextMenu);
- if (debug) {
- printDebugMessage("init", "added context menu"); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- addListeners();
- if (debug) {
- printDebugMessage("init", "added listeners"); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
-// htmlFormatter = new HTMLFormatter();
- htmlFormatter = (IHTMLFormatter) ExtensionHelper.createExtensionForJTidy(
- CommonPlugin.getDefault().getId(), "htmlFormatter"); //$NON-NLS-1$
- if (debug) {
- printDebugMessage("init", "instantiated HTMLFormatter"); //$NON-NLS-1$ //$NON-NLS-2$
- }
- } catch (Exception e) {
- editor = null;
- dispose();
- throw e;
- }
- }
-
- /**
- * Returns this rich text control.
- *
- * @return this rich text control
- */
- public Control getControl() {
- return editor;
- }
-
- /**
- * Sets the layout data.
- *
- * @param layoutData
- * the layout data to set
- */
- public void setLayoutData(Object layoutData) {
- if (editor != null) {
- editor.setLayoutData(layoutData);
- }
- }
-
- /**
- * Returns the layout data.
- *
- * @return this control's layout data
- */
- public Object getLayoutData() {
- if (editor != null) {
- return editor.getLayoutData();
- }
- return null;
- }
-
- /**
- * Sets focus to this control.
- */
- public void setFocus() {
- if (debug) {
- printDebugMessage("setFocus, editable=" + editable); //$NON-NLS-1$
- }
- if (editor != null) {
- if (initialized) {
- if (!editor.isFocusControl()) {
- if (!Platform.getOS().equals("win32")) { //$NON-NLS-1$
- // Workaround for Mozilla and Firefox rich text editor focus
- // issue.
- editor.setFocus();
- }
- executeCommand(RichTextCommand.SET_FOCUS);
- }
- hasFocus = true;
- } else {
- initializedWithFocus = true;
- }
- }
- }
-
- /**
- * Tells the control it does not have focus.
- */
- public void setBlur() {
- if (debug) {
- printDebugMessage("setBlur, editable=" + editable); //$NON-NLS-1$
- }
- if (editor != null) {
- if (initialized) {
- hasFocus = false;
- } else {
- initializedWithFocus = false;
- }
- }
- }
-
- /**
- * Checks whether this control has focus.
- *
- * @return <code>true</code> if this control has the user-interface focus
- */
- public boolean hasFocus() {
- if (editor != null) {
- return hasFocus;
- }
- return false;
- }
-
- /**
- * Returns the base path used for resolving text and image links.
- *
- * @return the base path used for resolving links in this control
- */
- public String getBasePath() {
- return basePath;
- }
-
- /**
- * Returns the base URL of the rich text control whose content was last
- * copied to the clipboard.
- *
- * @return the base URL of a rich text control
- */
- public URL getCopyURL() {
- return copyURL;
- }
-
- /**
- * Sets the base URL of the rich text control whose content was last copied
- * to the clipboard.
- */
- public void setCopyURL() {
- try {
- copyURL = new File(basePath).toURL();
- } catch (Exception e) {
- copyURL = null;
- }
- }
-
- /**
- * Returns the editable state.
- *
- * @return <code>true</code> if the content is editable
- */
- public boolean getEditable() {
- return editable;
- }
-
- /**
- * Sets the editable state.
- *
- * @param editable
- * the editable state
- */
- public void setEditable(boolean editable) {
- this.editable = editable;
- if (initialized) {
- executeCommand(RichTextCommand.SET_EDITABLE, "" + editable); //$NON-NLS-1$
- }
- }
-
- /**
- * Checks whether the content has been modified.
- *
- * @return <code>true</code> if the content has been modified
- */
- public boolean getModified() {
- return modified;
- }
-
- /**
- * Sets the modified state.
- *
- * @param modified
- * the modified state
- */
- public void setModified(boolean modified) {
- this.modified = modified;
- }
-
- /**
- * Returns the rich text content.
- *
- * @return the rich text content formatted in a markup language
- */
- public String getText() {
- if (editor != null && initialized) {
- try {
- executeCommand(RichTextCommand.GET_TEXT);
- if (currentText != null && currentText.length() > 0) {
- currentText = currentText.replaceAll(
- "<P>&nbsp;</P>", "<br/>"); //$NON-NLS-1$ //$NON-NLS-2$
- currentText = tidyText(currentText);
- currentText = formatHTML(currentText);
- } else {
- currentText = ""; //$NON-NLS-1$
- }
- if (debug) {
- printDebugMessage("getText", "text=", currentText); //$NON-NLS-1$ //$NON-NLS-2$
- }
- return currentText;
- } catch (Exception e) {
- logger.logError(e);
- }
- }
- return ""; //$NON-NLS-1$
- }
-
- protected String formatHTML(String text) {
- String formattedText;
- try {
- // Call JTidy to format the source to XHTML.
- formattedText = htmlFormatter.formatHTML(text);
- if (htmlFormatter.getLastErrorStr() != null) {
- logger.logError(htmlFormatter.getLastErrorStr());
- }
- return formattedText;
- } catch (UnsupportedEncodingException e) {
- logger.logError(e);
- }
- return text;
- }
-
- /**
- * Sets the rich text content.
- *
- * @param text
- * the rich text content formatted in a markup language
- */
- public void setText(String text) {
- if (editor != null) {
- if (debug) {
- printDebugMessage("setText", "text=", text); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- String newText = text;
- if (newText != null) {
- newText = tidyText(newText);
- // Call JTidy to format the source to XHTML.
- newText = formatHTML(newText);
- } else {
- newText = ""; //$NON-NLS-1$
- }
-
- if (initialized) {
- modified = !newText.equals(currentText);
- }
- initialText = newText;
- if (initialText.equals("") && !isIE) { //$NON-NLS-1$
- initialText = "<br />"; //$NON-NLS-1$
- }
-
- if (debug) {
- printDebugMessage(
- "setText", "modified=" + modified + ", newText=", newText); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- }
-
- if (initialized) {
- try {
- executeCommand(RichTextCommand.SET_TEXT, workaroundForObjectParamNode(newText));
- executeCommand(RichTextCommand.SET_EDITABLE, "" + editable); //$NON-NLS-1$
- } catch (Exception e) {
- logger.logError(e);
- }
- }
-
- currentText = newText;
- }
- }
-
- /**
- * Restores the rich text content back to the initial value.
- */
- public void restoreText() {
- setText(initialText);
- modified = false;
- }
-
- /**
- * Returns the currently selected text.
- *
- * @return the selected text or <code>""</code> if there is no
- * hasSelection
- */
- public String getSelectedText() {
- // executeCommand(RichTextCommand.GET_SELECTED_TEXT);
- return richTextSelection.getText();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.epf.richtext.IRichText#getSelected()
- */
- public RichTextSelection getSelected() {
- return richTextSelection;
- }
-
- /**
- * Returns an application specific property value.
- *
- * @param key
- * the name of the property
- * @return the value of the property or <code>null</code> if it has not
- * been set
- */
- public Object getData(String key) {
- if (editor != null) {
- return editor.getData(key);
- }
- return null;
- }
-
- /**
- * Sets an application specific property name and value.
- *
- * @param key
- * the name of the property
- * @param value
- * the property value
- */
- public void setData(String key, Object value) {
- if (editor != null) {
- editor.setData(key, value);
- }
- }
-
- /**
- * Executes the given JavaScript.
- *
- * @param script
- * the JavaScript to execute
- * @return a status code returned by the executed script
- */
- protected int execute(final String script) {
- status = 0;
- if (editor != null && script != null && script.length() > 0) {
- try {
- if (!isIE && processingJSEvent) {
- Display.getCurrent().asyncExec(new Runnable() {
- public void run() {
- if (!isDisposed()) {
- editor.execute(script);
- if (!Platform.getOS().equals(Platform.OS_WIN32)) {
- if (script.startsWith(RichTextCommand.SET_TEXT)) {
- notifyListeners(RichText.RICH_TEXT_INITIALIZED_LINUX, new Event());
- }
- }
- }
- }
- });
- } else {
- editor.execute(script);
- }
- if (debug) {
- printDebugMessage("execute", script); //$NON-NLS-1$
- }
- } catch (Exception e) {
- String msg = "Failed to execute " + script; //$NON-NLS-1$
- logger.logError(msg, e);
- if (debug) {
- printDebugMessage("execute", msg); //$NON-NLS-1$
- e.printStackTrace();
- }
- }
- }
- return status;
- }
-
- /**
- * Executes the given rich text command. The supported command strings are
- * defined in <code>RichTextCommand<code>.
- *
- * @param command a rich text command string.
- * @return a status code returned by the executed command
- */
- public int executeCommand(String command) {
- status = 0;
- if (command != null && command.equals(RichTextCommand.CLEAR_CONTENT)) {
- String oldInitialText = initialText;
- setText(""); //$NON-NLS-1$
- initialText = oldInitialText;
- status = 1;
- modified = true;
- notifyModifyListeners();
- } else {
- status = execute(command + "();"); //$NON-NLS-1$
- }
- return status;
- }
-
- /**
- * Executes the given rich text command with a single parameter. The
- * supported command strings are defined in <code>RichTextCommand<code>.
- *
- * @param command a rich text command string
- * @param param a parameter for the command or <code>null</code>
- * @return a status code returned by the executed command
- */
- public int executeCommand(String command, String param) {
- if (param == null) {
- return executeCommand(command);
- }
- return execute(command + "('" + formatText(param) + "');"); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * Executes the given rich text command with an array of parameters. The
- * supported command strings are defined in <code>RichTextCommand<code>.
- *
- * @param command a rich text command string
- * @param params an array of parameters for the command or <code>null</code>
- * @return a status code returned by the executed command
- */
- public int executeCommand(String command, String[] params) {
- if (params == null || params.length == 0) {
- return executeCommand(command);
- }
- StringBuffer sb = new StringBuffer();
- int paramsLength = params.length;
- for (int i = 0; i < paramsLength; i++) {
- sb.append('\'').append(formatText(params[i])).append('\'');
- if (i < paramsLength - 1) {
- sb.append(',');
- }
- }
- String param = sb.toString();
- return execute(command + "(" + param + ");"); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * Disposes the operating system resources allocated by the control.
- */
- public void dispose() {
- if (contextMenu != null && !contextMenu.isDisposed()) {
- contextMenu.dispose();
- contextMenu = null;
- }
- if (listeners != null) {
- listeners.clear();
- listeners = null;
- }
- if (modifyListeners != null) {
- modifyListeners.clear();
- modifyListeners = null;
- }
- if (htmlFormatter != null) {
- htmlFormatter = null;
- }
- if (this.findReplaceAction != null) {
- this.findReplaceAction.dispose();
- this.findReplaceAction = null;
- }
- }
-
- /**
- * Checks whether this control has been disposed.
- *
- * @return <code>true</code> if this control is disposed successfully
- */
- public boolean isDisposed() {
- return editor.isDisposed();
- }
-
- /**
- * Returns the modify listeners attached to this control.
- *
- * @return an iterator for retrieving the modify listeners
- */
- public Iterator<ModifyListener> getModifyListeners() {
- return modifyListeners.iterator();
- }
-
- /**
- * Adds a listener to the collection of listeners who will be notified when
- * keys are pressed and released within this control.
- *
- * @param listener
- * the listener which should be notified
- */
- public void addKeyListener(KeyListener listener) {
- if (editor != null) {
- editor.addKeyListener(listener);
- }
- }
-
- /**
- * Removes a listener from the collection of listeners who will be notified
- * when keys are pressed and released within this control.
- *
- * @param listener
- * the listener which should no longer be notified
- */
- public void removeKeyListener(KeyListener listener) {
- if (editor != null) {
- editor.removeKeyListener(listener);
- }
- }
-
- /**
- * Adds a listener to the collection of listeners who will be notified when
- * the content of this control is modified.
- *
- * @param listener
- * the listener which should be notified
- */
- public void addModifyListener(ModifyListener listener) {
- if (editor != null && listener != null
- && !modifyListeners.contains(listener)) {
- modifyListeners.add(listener);
- }
- }
-
- /**
- * Removes a listener from the collection of listeners who will be notified
- * when the content of this control is modified.
- *
- * @param listener
- * the listener which should no longer be notified
- */
- public void removeModifyListener(ModifyListener listener) {
- if (editor != null && listener != null
- && modifyListeners.contains(listener)) {
- modifyListeners.remove(listener);
- }
- }
-
- /**
- * Adds the listener to the collection of listeners who will be notifed when
- * this control is disposed.
- *
- * @param listener
- * the listener which should be notified
- */
- public void addDisposeListener(DisposeListener listener) {
- if (editor != null) {
- editor.addDisposeListener(listener);
- }
- }
-
- /**
- * Removes a listener from the collection of listeners who will be notified
- * when this control is disposed.
- *
- * @param listener
- * the listener which should no longer be notified
- */
- public void removeDisposeListener(DisposeListener listener) {
- if (editor != null) {
- editor.removeDisposeListener(listener);
- }
- }
-
- /**
- * Adds a listener to the collection of listeners who will be notified when
- * help events are generated for this control.
- *
- * @param listener
- * the listener which should be notified
- */
- public void addHelpListener(HelpListener listener) {
- if (editor != null) {
- editor.addHelpListener(listener);
- }
- }
-
- /**
- * Removes a listener from the collection of listeners who will be notified
- * when help events are generated for this control.
- *
- * @param listener
- * the listener which should no longer be notified
- */
- public void removeHelpListener(HelpListener listener) {
- if (editor != null) {
- editor.removeHelpListener(listener);
- }
- }
-
- /**
- * Adds the listener to the collection of listeners who will be notifed when
- * an event of the given type occurs within this control.
- *
- * @param eventType
- * the type of event to listen for
- * @param listener
- * the listener which should be notified when the event occurs
- */
- public void addListener(int eventType, Listener listener) {
- if (editor != null && !listeners.containsKey(listener)) {
- if (eventType != SWT.SELECTED) {
- if (editorControl == null
- || (eventType != SWT.Activate
- && eventType != SWT.Deactivate
- && eventType != SWT.FocusIn && eventType != SWT.FocusOut)) {
- editor.addListener(eventType, listener);
- }
- }
- listeners.put(listener, new RichTextListener(eventType, listener));
- }
- }
-
- /**
- * Removes the listener from the collection of listeners who will be notifed
- * when an event of the given type occurs within this control.
- *
- * @param eventType
- * the type of event to listen for
- * @param listener
- * the listener which should no longer be notified when the event
- * occurs
- */
- public void removeListener(int eventType, Listener listener) {
- if (editor != null && listeners.containsKey(listener)) {
- if (editorControl == null
- || (eventType != SWT.Activate
- && eventType != SWT.Deactivate
- && eventType != SWT.FocusIn && eventType != SWT.FocusOut)) {
- editor.removeListener(eventType, listener);
- }
- listeners.remove(listener);
- }
- }
-
- /**
- * Returns the event listeners attached to this control.
- *
- * @return an iterator for retrieving the event listeners attached to this
- * control
- */
- public Iterator<RichTextListener> getListeners() {
- return listeners.values().iterator();
- }
-
- /**
- * Adds the listener to monitor events and status sent by the underlying
- * DHTML editor.
- */
- protected void addStatusTextListener() {
- editor.addStatusTextListener(new StatusTextListener() {
- public void changed(StatusTextEvent event) {
- String eventText = event.text;
- int eventTextLength = eventText.length();
- if (eventText.startsWith(STATUS_PREFIX)
- && eventTextLength > STATUS_PREFIX_LENGTH) {
- try {
- processingJSEvent = true;
- int endStatusIndex = STATUS_PREFIX_LENGTH + 1;
- if (eventText.length() > STATUS_PREFIX_LENGTH + 1
- && Character.isDigit(eventText
- .charAt(endStatusIndex))) {
- endStatusIndex++;
- }
- int statusType = Integer.parseInt(eventText.substring(
- STATUS_PREFIX_LENGTH, endStatusIndex));
- switch (statusType) {
- case STATUS_NOP:
- break;
- case STATUS_INITIALIZED:
- if (!initialized) {
- initialized = true;
- if (debug) {
- printDebugMessage(
- "statusTextListener", "STATUS_INITIALIZED"); //$NON-NLS-1$ //$NON-NLS-2$
- }
- if (!Platform.getOS().equals("win32")) { //$NON-NLS-1$
- // Workaround Mozilla'a IFRAME
- // height issue.
- executeCommand(RichTextCommand.SET_HEIGHT,
- "" + editor.getBounds().height); //$NON-NLS-1$
- }
- executeCommand(RichTextCommand.SET_TEXT,
- workaroundForObjectParamNode(currentText));
- if (initializedWithFocus) {
- setFocus();
- }
- if (!editable) {
- executeCommand(
- RichTextCommand.SET_EDITABLE,
- "" + editable); //$NON-NLS-1$
- }
-
- if (Platform.getOS().equals(Platform.OS_WIN32)) {
- notifyListeners(RichText.RICH_TEXT_INITIALIZED_WIN32, new Event());
- }
- }
- break;
- case STATUS_MODIFIED:
- if (debug) {
- printDebugMessage(
- "statusTextListener", "STATUS_MODIFIED"); //$NON-NLS-1$ //$NON-NLS-2$
- }
- checkModify();
- break;
- case STATUS_GET_TEXT:
- if (eventTextLength >= STATUS_PREFIX_LENGTH + 2) {
- currentText = eventText
- .substring(STATUS_PREFIX_LENGTH + 2);
-
- currentText = unWorkaroundForObjectParamNode(currentText);
- } else {
- currentText = ""; //$NON-NLS-1$
- }
- if (debug) {
- printDebugMessage(
- "statusTextListener", //$NON-NLS-1$
- "STATUS_GET_TEXT, currentText=", currentText); //$NON-NLS-1$
- }
- break;
- case STATUS_KEY_DOWN:
- if (eventTextLength >= STATUS_PREFIX_LENGTH + 2) {
- String cmd = eventText
- .substring(STATUS_PREFIX_LENGTH + 2);
- if (debug) {
- printDebugMessage("statusTextListener", //$NON-NLS-1$
- "STATUS_KEY_DOWN, cmd=" + cmd); //$NON-NLS-1$
- }
- if (cmd.equals(RichTextCommand.COPY)) {
- setCopyURL();
- } else if (cmd.equals(RichTextCommand.CUT)) {
- setCopyURL();
- CutAction action = new CutAction(
- RichText.this);
- action.execute(RichText.this);
- } else if (cmd
- .equals(RichTextCommand.FIND_TEXT)) {
- getFindReplaceAction().execute(
- RichText.this);
- } else if (cmd.equals(RichTextCommand.PASTE)) {
- PasteAction action = new PasteAction(
- RichText.this);
- action.execute(RichText.this);
- } else if (cmd.equals(RichTextCommand.SAVE)) {
- PlatformUI.getWorkbench()
- .getActiveWorkbenchWindow()
- .getActivePage().getActiveEditor()
- .doSave(null);
- } else if (cmd.equals(RichTextCommand.SAVE_ALL)) {
- PlatformUI.getWorkbench()
- .getActiveWorkbenchWindow()
- .getActivePage().saveAllEditors(
- false);
- }
- }
- break;
- case STATUS_KEY_UP:
- if (debug) {
- printDebugMessage("statusTextListener", //$NON-NLS-1$
- "STATUS_KEY_UP, modified=" + modified); //$NON-NLS-1$
- }
- checkModify();
- break;
- case STATUS_SELECT_TEXT:
- if (eventTextLength >= STATUS_PREFIX_LENGTH + 2) {
- String[] strings = eventText.substring(
- STATUS_PREFIX_LENGTH + 2).split(
- "\\$", 5); //$NON-NLS-1$
- try {
- richTextSelection.setFontName(strings[0]);
- richTextSelection.setFontSize(strings[1]);
- richTextSelection.setBlockStyle(strings[2]);
- richTextSelection.setFlags(Integer
- .parseInt(strings[3]));
- richTextSelection.setText(strings[4]);
- } catch (NumberFormatException e) {
- logger.logError(e);
- }
- if (debug) {
- printDebugMessage(
- "selectionStatusListener", //$NON-NLS-1$
- "current selection is=" + richTextSelection); //$NON-NLS-1$
- }
-
- hasSelection = true;
- if (hasFocus())
- notifyListeners(SWT.SELECTED, new Event());
- } else {
- richTextSelection.setText(""); //$NON-NLS-1$
- hasSelection = false;
- }
- if (debug) {
- printDebugMessage(
- "statusTextListener", //$NON-NLS-1$
- "STATUS_SELECT_TEXT, selectedText=", richTextSelection.getText()); //$NON-NLS-1$
- }
- break;
- case STATUS_SELECT_CONTROL:
- if (debug) {
- printDebugMessage("statusTextListener", //$NON-NLS-1$
- "STATUS_SELECT_CONTROL, control selected"); //$NON-NLS-1$
- }
- hasSelection = true;
- break;
- case STATUS_SELECT_NONE:
- if (debug) {
- printDebugMessage("statusTextListener", //$NON-NLS-1$
- "STATUS_SELECT_NONE, no selection"); //$NON-NLS-1$
- }
- hasSelection = false;
- break;
- case STATUS_EXEC_CMD:
- if (eventTextLength >= STATUS_PREFIX_LENGTH + 3) {
- try {
- status = Integer.parseInt(eventText
- .substring(
- STATUS_PREFIX_LENGTH + 2,
- STATUS_PREFIX_LENGTH + 3));
- } catch (Exception e) {
- status = -1;
- }
- }
- if (debug && status != 1) {
- printDebugMessage("statusTextListener", //$NON-NLS-1$
- "STATUS_EXEC_CMD, status=" + status); //$NON-NLS-1$
- }
- break;
- case STATUS_REFORMAT_LINKS:
- if (debug) {
- printDebugMessage(
- "statusTextListener", "STATUS_REFORMAT_LINKS"); //$NON-NLS-1$ //$NON-NLS-2$
- }
- if (Platform.getOS().equals("win32")) { //$NON-NLS-1$
- // Workaround the drag and drop issue with DBCS
- // characters.
- if (modified) {
- setText(getText());
- modified = true;
- }
- }
- checkModify();
- break;
- }
- } catch (Exception e) {
- } finally {
- processingJSEvent = false;
- }
- }
- }
- });
- }
-
- /**
- * Generates the HTML source for the editor.
- *
- * @return the HTML source for the editor
- */
- protected String generateEditorHTML() throws Exception {
- String escapedBasePath = basePath;
- if (escapedBasePath.startsWith(FileUtil.UNC_PATH_PREFIX))
- escapedBasePath = escapedBasePath.replaceFirst(
- "^\\\\\\\\", "\\\\\\\\\\\\\\\\"); //$NON-NLS-1$ //$NON-NLS-2$
- escapedBasePath = XMLUtil
- .escape("file://" + escapedBasePath.replaceAll("'", "\\\\'")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- String escapedRteUTL = rteURL.replaceAll("&apos;", "%27"); //$NON-NLS-1$ //$NON-NLS-2$
-
- StringBuffer rteXML = new StringBuffer();
- rteXML.append("<rte id=\"").append("rte") //$NON-NLS-1$ //$NON-NLS-2$
- .append("\" css=\"").append(escapedRteUTL + "rte.css") //$NON-NLS-1$ //$NON-NLS-2$
- .append("\" js=\"").append(escapedRteUTL + "rte.js") //$NON-NLS-1$ //$NON-NLS-2$
- .append("\" baseURL=\"").append(escapedBasePath) //$NON-NLS-1$
- .append("\"/>"); //$NON-NLS-1$
- StringWriter result = new StringWriter();
- XSLTProcessor.transform(
- rteFolder + "rte.xsl", rteXML.toString(), result); //$NON-NLS-1$
- return result.toString();
- }
-
- /**
- * Fills the context menu with menu items.
- *
- * @param contextMenu
- * a context menu containing rich text actions
- */
- protected void fillContextMenu(Menu contextMenu) {
- final MenuItem cutItem = new MenuItem(contextMenu, SWT.PUSH);
- cutItem.setText(RichTextResources.cutAction_text);
- cutItem.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent event) {
- CutAction action = new CutAction(RichText.this);
- action.execute(RichText.this);
- }
- });
- final MenuItem copyItem = new MenuItem(contextMenu, SWT.PUSH);
- copyItem.setText(RichTextResources.copyAction_text);
- copyItem.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent event) {
- CopyAction action = new CopyAction(RichText.this);
- action.execute(RichText.this);
- }
- });
- final MenuItem pasteItem = new MenuItem(contextMenu, SWT.PUSH);
- pasteItem.setText(RichTextResources.pasteAction_text);
- pasteItem.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent event) {
- PasteAction action = new PasteAction(RichText.this);
- action.execute(RichText.this);
- }
- });
-
- final MenuItem pastePlainTextItem = new MenuItem(contextMenu, SWT.PUSH);
- pastePlainTextItem.setText(RichTextResources.pastePlainTextAction_text);
- pastePlainTextItem.setImage(RichTextImages.IMG_PASTE_PLAIN_TEXT);
- pastePlainTextItem.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent event) {
- PastePlainTextAction action = new PastePlainTextAction(
- RichText.this);
- action.execute(RichText.this);
- }
- });
-
- contextMenu.addMenuListener(new MenuListener() {
- public void menuHidden(MenuEvent e) {
- }
-
- public void menuShown(MenuEvent e) {
- getSelectedText();
- cutItem.setEnabled(editable && hasSelection);
- copyItem.setEnabled(hasSelection);
- pasteItem.setEnabled(editable);
- pastePlainTextItem.setEnabled(editable);
- }
- });
- }
-
- /**
- * Adds listeners to manage the activation and focus events.
- */
- protected void addListeners() {
- editorControl = getControlSite(editor);
- if (editorControl != null) {
- if (debug) {
- printDebugMessage(
- "init", "editorControl=" + editorControl.getClass().getName()); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- // only IE (win32) has the editorControl != null
- isIE = true;
-
- editorControl.addListener(SWT.Activate, new Listener() {
- public void handleEvent(Event event) {
- if (debug) {
- printDebugMessage("activateListener"); //$NON-NLS-1$
- }
- setFocus();
- notifyListeners(SWT.Activate, event);
- }
- });
-
- editorControl.addListener(SWT.Deactivate, new Listener() {
- public void handleEvent(Event event) {
- if (debug) {
- printDebugMessage("deactivateListener"); //$NON-NLS-1$
- }
- setBlur();
- notifyListeners(SWT.Deactivate, event);
- }
- });
-
- editorControl.addListener(SWT.FocusIn, new Listener() {
- public void handleEvent(Event event) {
- if (debug) {
- printDebugMessage("focusInListener"); //$NON-NLS-1$
- }
- executeCommand("updateSelection"); //$NON-NLS-1$
- notifyListeners(SWT.FocusIn, event);
- }
- });
-
- editorControl.addKeyListener(new KeyAdapter() {
- public void keyReleased(KeyEvent event) {
- int keyCode = event.keyCode;
- int stateMask = event.stateMask;
- if (debug) {
- printDebugMessage(
- "keyUpListener", "keyCode=" + keyCode //$NON-NLS-1$ //$NON-NLS-2$
- + ", stateMask=" + stateMask + ", editable=" + editable); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- if ( stateMask == SWT.CTRL && event.keyCode == 0x11 ) { //0x11 is for all Control key, such as ctrl-b, ctrl-I, ctrl-c, etc..
- executeCommand("updateSelection");
- }
-
- if ((stateMask & SWT.CTRL) > 0
- || (stateMask & SWT.ALT) > 0
- || ((stateMask & SWT.SHIFT) > 0 && keyCode == stateMask)) {
- return;
- }
- if (editable) {
- switch (event.keyCode) {
- case SWT.ARROW_DOWN:
- case SWT.ARROW_LEFT:
- case SWT.ARROW_RIGHT:
- case SWT.ARROW_UP:
- case SWT.END:
- case SWT.HOME:
- case SWT.PAGE_DOWN:
- case SWT.PAGE_UP:
- case SWT.TAB:
- return;
- default:
- checkModify();
- break;
- }
- }
- }
- });
-
-// editorControl.addListener(SWT.KeyUp, new Listener() {
-// public void handleEvent(Event event) {
-// int keyCode = event.keyCode;
-// int stateMask = event.stateMask;
-// if (debug) {
-// printDebugMessage(
-// "keyUpListener", "keyCode=" + keyCode //$NON-NLS-1$ //$NON-NLS-2$
-// + ", stateMask=" + stateMask + ", editable=" + editable); //$NON-NLS-1$ //$NON-NLS-2$
-// }
-// if ((stateMask & SWT.CTRL) > 0
-// || (stateMask & SWT.ALT) > 0
-// || ((stateMask & SWT.SHIFT) > 0 && keyCode == stateMask)) {
-// return;
-// }
-// if (editable) {
-// switch (event.keyCode) {
-// case SWT.ARROW_DOWN:
-// case SWT.ARROW_LEFT:
-// case SWT.ARROW_RIGHT:
-// case SWT.ARROW_UP:
-// case SWT.END:
-// case SWT.HOME:
-// case SWT.PAGE_DOWN:
-// case SWT.PAGE_UP:
-// case SWT.TAB:
-// return;
-// default:
-// checkModify();
-// break;
-// }
-// }
-// }
-// });
-
- editor.addLocationListener(new LocationAdapter() {
- public void changing(LocationEvent event) {
- // Deactivate the links in the content page in readonly
- // mode.
- event.doit = editable;
- }
- });
- } else {
- editor.addListener(SWT.Activate, new Listener() {
- public void handleEvent(Event event) {
- if (debug) {
- printDebugMessage("activateListener"); //$NON-NLS-1$
- }
- setFocus();
- }
- });
-
- editor.addKeyListener(new KeyListener() {
- public void keyPressed(KeyEvent e) {
- if (e.keyCode == SWT.TAB) {
- if ((e.stateMask & SWT.SHIFT) != 0) {
- editor.traverse(SWT.TRAVERSE_TAB_PREVIOUS);
- } else if ((e.stateMask & SWT.CTRL) == 0 ){
- editor.traverse(SWT.TRAVERSE_TAB_NEXT);
- }
- return;
- }
- if (!editable) {
- e.doit = false;
- }
- }
-
- public void keyReleased(KeyEvent e) {
- if ((e.stateMask & SWT.CTRL) > 0
- || (e.stateMask & SWT.ALT) > 0)
- return;
- if (editable) {
- switch (e.keyCode) {
- case SWT.ARROW_DOWN:
- case SWT.ARROW_LEFT:
- case SWT.ARROW_RIGHT:
- case SWT.ARROW_UP:
- case SWT.END:
- case SWT.HOME:
- case SWT.PAGE_DOWN:
- case SWT.PAGE_UP:
- case SWT.SHIFT:
- case SWT.TAB:
- break;
- default:
- checkModify();
- break;
- }
- }
- }
- });
- }
-
- editor.addDisposeListener(new DisposeListener() {
- public void widgetDisposed(DisposeEvent e) {
- if (debug) {
- printDebugMessage("disposeListener"); //$NON-NLS-1$
- }
- dispose();
- }
- });
-
- listeners = new Hashtable<Listener, RichTextListener>();
- modifyListeners = new ArrayList<ModifyListener>();
- }
-
- /**
- * Notifies the rich text event listeners.
- *
- * @param eventType
- * the event type
- * @param event
- * the SWT event
- */
- protected void notifyListeners(int eventType, Event event) {
- if (notifyingModifyListeners) {
- return;
- }
-
- if (listeners != null) {
- event.display = Display.getCurrent();
- event.widget = editor;
-
- for (Iterator<RichTextListener> i = listeners.values().iterator(); i
- .hasNext();) {
- RichTextListener listener = i.next();
- if (listener.getEventType() == eventType) {
- if (debug) {
- printDebugMessage(
- "notifyListeners", "notifying listener, " + listener + ", eventType=" + eventType); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- }
- listener.getListener().handleEvent(event);
- if (debug) {
- printDebugMessage(
- "notifyListeners", "notified listener, " + listener + ", eventType=" + eventType); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- }
- }
- }
- }
- }
-
- /**
- * Notifies the modify listeners that the rich text editor content has
- * changed.
- */
- public void notifyModifyListeners() {
- notifyingModifyListeners = true;
-
- Event event = new Event();
- event.display = Display.getCurrent();
- event.widget = editor;
-
- for (Iterator<ModifyListener> i = modifyListeners.iterator(); i
- .hasNext();) {
- ModifyListener listener = i.next();
- if (debug) {
- printDebugMessage(
- "notifyModifyListeners", "notifying listener, " + listener); //$NON-NLS-1$ //$NON-NLS-2$
- }
- listener.modifyText(new ModifyEvent(event));
- if (debug) {
- printDebugMessage(
- "notifyModifyListeners", "notified listener, " + listener); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
-
- notifyingModifyListeners = false;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.epf.richtext.IRichText#checkModify()
- */
- public void checkModify() {
- try {
- if (!checkingModifyEvent) {
- checkingModifyEvent = true;
- if (modified) {
- notifyModifyListeners();
- } else {
- if (!isIE && processingJSEvent) {
- Display.getCurrent().asyncExec(new Runnable() {
- public void run() {
- if (!getText().equals(initialText)) {
- modified = true;
- notifyModifyListeners();
- }
- }
- });
- } else {
- if (!getText().equals(initialText)) {
- modified = true;
- notifyModifyListeners();
- }
- }
- }
- if (debug) {
- printDebugMessage("checkModify", "modified=" + modified); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
- } finally {
- checkingModifyEvent = false;
- }
- }
-
- /**
- * This provides an opportunity for a sub class to tidy up the rich text.
- *
- * @param text
- * rich text encoded in HTML format
- */
- protected String tidyText(String text) {
- return text;
- }
-
- /**
- * Formats the text for consumption by the JavaScript/DHTML editor.
- *
- * @param text
- * rich text encoded in HTML format
- */
- protected String formatText(String text) {
- if (text == null || text.length() == 0) {
- return text;
- }
- StringBuffer result = new StringBuffer();
- int textSize = text.length();
- for (int i = 0; i < textSize; i++) {
- char ch = text.charAt(i);
- switch (ch) {
- case '\r':
- break;
- case '\t':
- result.append(' ');
- break;
- case '\n':
- result.append(ENCODED_NEWLINE);
- break;
- case '\'':
- result.append(ENCODED_SINGLE_QUOTE);
- break;
- case '\\':
- result.append("\\\\"); //$NON-NLS-1$
- break;
- default:
- result.append(ch);
- }
- }
- return result.toString();
- }
-
- /**
- * Returns the child <code>OleControlSite</code> contained within the
- * given <code>Composite</code>.
- *
- * @param composite
- * a <code>Composite</code> object, presumably a
- * <code>Browser</code>
- * @return an <code>OleControlSite</code> object
- */
- protected Control getControlSite(Composite composite) {
- if (Platform.getOS().equals("win32")) { //$NON-NLS-1$
- Control[] controls = composite.getChildren();
- for (int i = 0; i < controls.length; i++) {
- String controlClass = controls[i].getClass().getName();
- if (controlClass.equals("org.eclipse.swt.browser.WebSite")) { //$NON-NLS-1$
- return controls[i];
- } else if (controls[i] instanceof Composite) {
- return getControlSite((Composite) controls[i]);
- }
- }
- }
- return null;
- }
-
- /**
- * Displays the given debug message to the console.
- */
- protected void printDebugMessage(String method, String msg, String text) {
- StringBuffer strBuf = new StringBuffer();
- strBuf.append("RichText[").append(editor.handle).append(']') //$NON-NLS-1$
- .append('.').append(method);
- if (msg != null && msg.length() > 0) {
- strBuf.append(": ").append(msg); //$NON-NLS-1$
- }
- if (text != null && text.length() > 0) {
- strBuf.append('\n').append(text);
- }
- System.out.println(strBuf);
- }
-
- /**
- * Displays the given debug message to the console.
- */
- protected void printDebugMessage(String method, String msg) {
- printDebugMessage(method, msg, null);
- }
-
- /**
- * Displays the given debug message to the console.
- */
- protected void printDebugMessage(String method) {
- printDebugMessage(method, null);
- }
-
- public FindReplaceAction getFindReplaceAction() {
- return findReplaceAction;
- }
-
- public void setFindReplaceAction(FindReplaceAction findReplaceAction) {
- if (findReplaceAction != null) {
- if (this.findReplaceAction != null
- && this.findReplaceAction != findReplaceAction) {
- this.findReplaceAction.dispose();
- }
- this.findReplaceAction = findReplaceAction;
- this.findReplaceAction.setRichText(this);
- }
- }
-
- public void setInitialText(String text) {
- setText(text);
- initialText = text == null ? "" : text; //$NON-NLS-1$
- modified = false;
- }
-
- public boolean hasError() {
- return htmlFormatter.getLastErrorStr() != null;
- }
-
- public static String workaroundForObjectParamNode(String html) {
- String result = html.replaceAll("<param", "<paramTemp"); //$NON-NLS-1$ //$NON-NLS-2$
-
- return result;
- }
-
- private String unWorkaroundForObjectParamNode(String html) {
- String result = html.replaceAll("<paramTemp", "<param"); //$NON-NLS-1$ //$NON-NLS-2$
-
- return result;
- }
-
-}
diff --git a/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/RichTextCommand.java b/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/RichTextCommand.java
deleted file mode 100644
index dbf706443ec..00000000000
--- a/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/RichTextCommand.java
+++ /dev/null
@@ -1,267 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-//------------------------------------------------------------------------------
-// Copyright (c) 2005, 2006 IBM Corporation 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:
-// IBM Corporation - initial implementation
-//------------------------------------------------------------------------------
-package org.eclipse.epf.richtext;
-
-/**
- * Defines the editing commands supported by the default rich text control and
- * editor.
- *
- * @author Kelvin Low
- * @since 1.0
- */
-public class RichTextCommand {
-
- /**
- * Adds a HTML fragment.
- */
- public static final String ADD_HTML = "addHTML"; //$NON-NLS-1$
-
- /**
- * Adds an image.
- */
- public static final String ADD_IMAGE = "addImage"; //$NON-NLS-1$
-
- /**
- * Adds a horizontal line.
- */
- public static final String ADD_LINE = "addLine"; //$NON-NLS-1$
-
- /**
- * Adds a link.
- */
- public static final String ADD_LINK = "addLink"; //$NON-NLS-1$
-
- /**
- * Inserts text over the current selection.
- */
- public static final String INSERT_TEXT = "insertText"; //$NON-NLS-1$
-
- /**
- * Adds an ordered list.
- */
- public static final String ADD_ORDERED_LIST = "addOrderedList"; //$NON-NLS-1$
-
- /**
- * Adds a table.
- */
- public static final String ADD_TABLE = "addTable"; //$NON-NLS-1$
-
- /**
- * Adds an unordered list.
- */
- public static final String ADD_UNORDERED_LIST = "addUnorderedList"; //$NON-NLS-1$
-
- /**
- * Sets the background color of the selected text.
- */
- public static final String BACKGROUND_COLOR = "backColor"; //$NON-NLS-1$
-
- /**
- * Toggles the 'bold' attribute of the selected text.
- */
- public static final String BOLD = "bold"; //$NON-NLS-1$
-
- /**
- * Clears the rich text content.
- */
- public static final String CLEAR_CONTENT = "clearContent"; //$NON-NLS-1$
-
- /**
- * Copies the selected text to the clipboard.
- */
- public static final String COPY = "copy"; //$NON-NLS-1$
-
- /**
- * Cuts the selected text to the clipboard.
- */
- public static final String CUT = "cut"; //$NON-NLS-1$
-
- /**
- * Deletes the selected text.
- */
- public static final String DELETE = "deleteText"; //$NON-NLS-1$
-
- /**
- * Finds text.
- */
- public static final String FIND_TEXT = "findText"; //$NON-NLS-1$
-
- /**
- * Gets the HTML source.
- */
- public static final String GET_TEXT = "getText"; //$NON-NLS-1$
-
- /**
- * Sets the foreground color of the selected text.
- */
- public static final String FORGROUND_COLOR = "foreColor"; //$NON-NLS-1$
-
- /**
- * Formats the selected text.
- */
- public static final String FORMAT_BLOCK = "formatBlock"; //$NON-NLS-1$
-
- /**
- * Returns the selected text.
- */
- public static final String GET_SELECTED_TEXT = "getSelectedText"; //$NON-NLS-1$
-
- /**
- * Indents the selected text.
- */
- public static final String INDENT = "indent"; //$NON-NLS-1$
-
- /**
- * Toggles the 'italic' attribute of the selected text.
- */
- public static final String ITALIC = "italic"; //$NON-NLS-1$
-
- /**
- * Center justifies the selected text.
- */
- public static final String JUSTIFY_CENTER = "justifyCenter"; //$NON-NLS-1$
-
- /**
- * Fully justifies the selected text.
- */
- public static final String JUSTIFY_FULL = "justifyFull"; //$NON-NLS-1$
-
- /**
- * Left justifies the selected text.
- */
- public static final String JUSTIFY_LEFT = "justifyLeft"; //$NON-NLS-1$
-
- /**
- * Right justifies the selected text.
- */
- public static final String JUSTIFY_RIGHT = "justifyRight"; //$NON-NLS-1$
-
- /**
- * Outdents the selected text.
- */
- public static final String OUTDENT = "outdent"; //$NON-NLS-1$
-
- /**
- * Pastes text from the clipboard.
- */
- public static final String PASTE = "paste"; //$NON-NLS-1$
-
- /**
- * Replaces all text.
- */
- public static final String REPLACE_ALL_TEXT = "replaceAllText"; //$NON-NLS-1$
-
- /**
- * Replaces the selected text.
- */
- public static final String REPLACE_TEXT = "replaceText"; //$NON-NLS-1$
-
- /**
- * Redoes the previous command.
- */
- public static final String REDO = "redo"; //$NON-NLS-1$
-
- /**
- * Removes the current formatting of the selected text.
- */
- public static final String REMOVE_FORMAT = "removeFormat"; //$NON-NLS-1$
-
- /**
- * Saves the editor
- */
- public static final String SAVE = "save"; //$NON-NLS-1$
-
- /**
- * Saves all editors
- */
- public static final String SAVE_ALL = "saveAll"; //$NON-NLS-1$
-
- /**
- * Selects all text.
- */
- public static final String SELECT_ALL = "selectAll"; //$NON-NLS-1$
-
- /**
- * Sets the font name for the selected text.
- */
- public static final String SET_FONT_NAME = "setFontName"; //$NON-NLS-1$
-
- /**
- * Sets the font size for the selected text.
- */
- public static final String SET_FONT_SIZE = "setFontSize"; //$NON-NLS-1$
-
- /**
- * Sets the font style for the selected text.
- */
- public static final String SET_FONT_STYLE = "setFontStyle"; //$NON-NLS-1$
-
- /**
- * Sets whether the content can be edited.
- */
- public static final String SET_EDITABLE = "setEditable"; //$NON-NLS-1$
-
- /**
- * Sets focus to this control.
- */
- public static final String SET_FOCUS = "setFocus"; //$NON-NLS-1$
-
- /**
- * Sets the height of this control.
- */
- public static final String SET_HEIGHT = "setHeight"; //$NON-NLS-1$
-
- /**
- * Sets the HTML source.
- */
- public static final String SET_TEXT = "setText"; //$NON-NLS-1$
-
- /**
- * Toggles the 'strike-through' attribute of the selected text.
- */
- public static final String STRIKE_THROUGH = "strikeThrough"; //$NON-NLS-1$
-
- /**
- * Toggles the subscript attribute of the selected text.
- */
- public static final String SUBSCRIPT = "subscript"; //$NON-NLS-1$
-
- /**
- * Toggles the superscript attribute of the selected text.
- */
- public static final String SUPERSCRIPT = "superscript"; //$NON-NLS-1$
-
- /**
- * Toggles the underline attribute of the selected text.
- */
- public static final String UNDERLINE = "underline"; //$NON-NLS-1$
-
- /**
- * Undoes the previous command.
- */
- public static final String UNDO = "undo"; //$NON-NLS-1$
-
- /**
- * Converts a link to normal text.
- */
- public static final String UNLINK = "unlink"; //$NON-NLS-1$
-
-}
diff --git a/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/RichTextEditor.java b/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/RichTextEditor.java
deleted file mode 100644
index 039b2a86c35..00000000000
--- a/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/RichTextEditor.java
+++ /dev/null
@@ -1,1555 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-//------------------------------------------------------------------------------
-// Copyright (c) 2005, 2007 IBM Corporation 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:
-// IBM Corporation - initial implementation
-//------------------------------------------------------------------------------
-package org.eclipse.epf.richtext;
-
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.commands.ParameterizedCommand;
-import org.eclipse.core.commands.operations.IUndoContext;
-import org.eclipse.epf.common.serviceability.Logger;
-import org.eclipse.epf.richtext.actions.CopyAction;
-import org.eclipse.epf.richtext.actions.CutAction;
-import org.eclipse.epf.richtext.actions.FindReplaceAction;
-import org.eclipse.epf.richtext.actions.PasteAction;
-import org.eclipse.epf.richtext.actions.PastePlainTextAction;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.bindings.Binding;
-import org.eclipse.jface.bindings.keys.KeySequence;
-import org.eclipse.jface.bindings.keys.KeyStroke;
-import org.eclipse.jface.bindings.keys.SWTKeySupport;
-import org.eclipse.jface.text.Document;
-import org.eclipse.jface.text.DocumentEvent;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IDocumentListener;
-import org.eclipse.jface.text.ITextViewerExtension;
-import org.eclipse.jface.text.ITextViewerExtension6;
-import org.eclipse.jface.text.IUndoManager;
-import org.eclipse.jface.text.IUndoManagerExtension;
-import org.eclipse.jface.text.TextViewer;
-import org.eclipse.jface.text.TextViewerUndoManager;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CTabFolder;
-import org.eclipse.swt.custom.CTabItem;
-import org.eclipse.swt.custom.StyledText;
-import org.eclipse.swt.custom.VerifyKeyListener;
-import org.eclipse.swt.custom.ViewForm;
-import org.eclipse.swt.dnd.DND;
-import org.eclipse.swt.dnd.DropTarget;
-import org.eclipse.swt.dnd.DropTargetEvent;
-import org.eclipse.swt.dnd.DropTargetListener;
-import org.eclipse.swt.dnd.HTMLTransfer;
-import org.eclipse.swt.dnd.TextTransfer;
-import org.eclipse.swt.dnd.Transfer;
-import org.eclipse.swt.events.DisposeListener;
-import org.eclipse.swt.events.HelpListener;
-import org.eclipse.swt.events.KeyEvent;
-import org.eclipse.swt.events.KeyListener;
-import org.eclipse.swt.events.MenuEvent;
-import org.eclipse.swt.events.MenuListener;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.VerifyEvent;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.swt.widgets.MenuItem;
-import org.eclipse.ui.IActionBars;
-import org.eclipse.ui.IEditorSite;
-import org.eclipse.ui.IKeyBindingService;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.actions.ActionFactory;
-import org.eclipse.ui.keys.IBindingService;
-import org.eclipse.ui.operations.OperationHistoryActionHandler;
-import org.eclipse.ui.operations.RedoActionHandler;
-import org.eclipse.ui.operations.UndoActionHandler;
-import org.eclipse.ui.texteditor.IAbstractTextEditorHelpContextIds;
-import org.eclipse.ui.texteditor.IReadOnlyDependent;
-import org.eclipse.ui.texteditor.ITextEditorActionConstants;
-import org.eclipse.ui.texteditor.IUpdate;
-import org.eclipse.ui.texteditor.IWorkbenchActionDefinitionIds;
-
-/**
- * The default rich text editor implementation.
- * <p>
- * The default rich text editor uses XHTML as the underlying markup language for
- * the rich text content. It is implemented using a <code>ViewForm</code>
- * control with a tool bar at the top, a tab folder that contains a
- * <code>RichText</code> control for entering the rich text content, and a tab
- * foler that contains a <code>StyleText</code> control for viewing and
- * modifying the XHTML representation of the rich text content.
- *
- * @author Kelvin Low
- * @author Jeff Hardy
- * @since 1.0
- */
-public class RichTextEditor implements IRichTextEditor {
-
- // The HTML tab name.
- protected static final String HTML_TAB_NAME = RichTextResources.htmlTab_text;
-
- // If true, log debugging info.
- protected boolean debug;
-
- // The plug-in logger.
- protected Logger logger;
-
- // The base path used for resolving links (<href>, <img>, etc.).
- protected String basePath;
-
- // The editor form.
- protected ViewForm form;
-
- // The editor tool bar.
- protected IRichTextToolBar toolBar;
-
- // The editor content.
- protected Composite content;
-
- // The editor tab folder.
- protected CTabFolder tabFolder;
-
- // The rich text tab
- protected CTabItem richTextTab;
-
- // The HTML source tab
- protected CTabItem htmlTab;
-
- // The embedded rich text control.
- protected IRichText richText;
-
- // The underlying HTML text editor.
- protected TextViewer sourceViewer;
-
- protected IDocument currentDoc;
-
- // Drop support
- protected DropTarget sourceEditDropTarget;
-
- // HTML editor's context menu
- protected Menu contextMenu;
-
- // Has the HTML source been modified?
- protected boolean sourceModified = false;
-
- // The editor's editable flag.
- protected boolean editable = true;
-
- private OperationHistoryActionHandler undoAction;
-
- private OperationHistoryActionHandler redoAction;
-
- private IEditorSite editorSite;
-
- /** The actions registered with the editor. */
- private Map<String, IAction> fActions= new HashMap<String, IAction>(10);
-
- /** The verify key listener for activation code triggering. */
- private ActivationCodeTrigger fActivationCodeTrigger= new ActivationCodeTrigger();
-
- /** The editor's action activation codes. */
- private List fActivationCodes= new ArrayList(2);
-
- final IUndoManager undoManager= new TextViewerUndoManager(10);
-
- /**
- * The key binding scopes of this editor.
- * @since 2.1
- */
- private String[] fKeyBindingScopes;
-
-
- protected IDocumentListener sourceEditDocumentListener= new IDocumentListener() {
- public void documentAboutToBeChanged(DocumentEvent event) {
- }
- public void documentChanged(DocumentEvent event) {
- sourceModified = true;
- if (richText != null && richText instanceof RichText) {
- richText.notifyModifyListeners();
- }
- }
- };
-
-
- // The deactivate listener for the sourceEdit control.
- protected Listener sourceEditDeactivateListener = new Listener() {
- public void handleEvent(Event event) {
- if (sourceModified) {
- updateRichText(sourceViewer.getTextWidget().getText());
- setModified(true);
- sourceModified = false;
- }
- }
- };
-
- // The key listener for the sourceEdit control.
- protected KeyListener sourceEditKeyListener = new KeyListener() {
- public void keyPressed(KeyEvent e) {
- Object adapter = PlatformUI.getWorkbench().getAdapter(
- IBindingService.class);
- if (adapter != null && adapter instanceof IBindingService) {
- int accel = SWTKeySupport
- .convertEventToUnmodifiedAccelerator(e);
- KeyStroke stroke = SWTKeySupport
- .convertAcceleratorToKeyStroke(accel);
- KeySequence seq = KeySequence.getInstance(stroke);
- Binding bind = ((IBindingService) adapter).getPerfectMatch(seq);
- if (bind != null) {
- ParameterizedCommand command = bind
- .getParameterizedCommand();
- if (command != null) {
- String cmdId = command.getId();
- if (cmdId != null
- && cmdId
- .equals("org.eclipse.ui.edit.findReplace")) { //$NON-NLS-1$
- richText.getFindReplaceAction().execute(RichTextEditor.this);
- }
- }
- }
- }
- }
-
- public void keyReleased(KeyEvent e) {
- }
- };
-
- /**
- * Creates a new instance.
- *
- * @param parent
- * the parent composite
- * @param style
- * the editor style
- */
- public RichTextEditor(Composite parent, int style, IEditorSite editorSite) {
- this(parent, style, editorSite, null);
- }
-
- /**
- * Creates a new instance.
- *
- * @param parent
- * the parent composite
- * @param style
- * the editor style
- * @param basePath
- * the base path used for resolving links
- */
- public RichTextEditor(Composite parent, int style, IEditorSite editorSite, String basePath) {
- this.basePath = basePath;
- this.editorSite = editorSite;
- debug = RichTextPlugin.getDefault().isDebugging();
- logger = RichTextPlugin.getDefault().getLogger();
- init(parent, style);
- }
-
- /**
- * Initializes this editor.
- *
- * @param parent
- * the parent composite
- * @param style
- * the editor style
- */
- protected void init(Composite parent, int style) {
- try {
- form = new ViewForm(parent, style);
- form.marginHeight = 0;
- form.marginWidth = 0;
-
- toolBar = new RichTextToolBar(form, SWT.FLAT, this);
-
- content = new Composite(form, SWT.FLAT);
- GridLayout layout = new GridLayout();
- layout.marginHeight = 0;
- layout.marginWidth = 0;
- content.setLayout(layout);
-
- tabFolder = createEditorTabFolder(content, style);
-
- form.setTopCenter(((RichTextToolBar)toolBar).getToolbarMgr().getControl());
- form.setTopLeft(((RichTextToolBar)toolBar).getToolbarMgrCombo().getControl());
- form.setContent(content);
- } catch (Exception e) {
- logger.logError(e);
- }
- }
-
- /**
- * Returns the form control.
- *
- * @return the form control
- */
- public Control getControl() {
- return form;
- }
-
- /**
- * Returns the rich text control embedded within this editor.
- */
- public IRichText getRichTextControl() {
- return richText;
- }
-
- /**
- * Sets the layout data.
- *
- * @param layoutData
- * the layout data to set
- */
- public void setLayoutData(Object layoutData) {
- if (form != null) {
- form.setLayoutData(layoutData);
- }
- }
-
- /**
- * Returns the layout data.
- *
- * @return the editor's layout data
- */
- public Object getLayoutData() {
- if (form != null) {
- return form.getLayoutData();
- }
- return null;
- }
-
- /**
- * Sets focus to this editor.
- */
- public void setFocus() {
- if (richText != null) {
- richText.setFocus();
- }
- setSelection(0);
- if (toolBar != null && tabFolder != null) {
- toolBar.updateToolBar(editable);
- }
-
- }
-
- /**
- * Tells the control it does not have focus.
- */
- public void setBlur() {
- if (richText != null) {
- richText.setBlur();
- }
- }
-
- /**
- * Checks whether this editor has focus.
- *
- * @return <code>true</code> if this editor has the user-interface focus
- */
- public boolean hasFocus() {
- if (richText != null) {
- return richText.hasFocus();
- }
- return false;
- }
-
- /**
- * Selects the Rich Text or HTML tab.
- *
- * @param index
- * <code>0</code> for the Rich Text tab, <code>1</code> for
- * the HTML tab.
- */
- public void setSelection(int index) {
- if (tabFolder != null) {
- tabFolder.setSelection(index);
- }
- }
-
- /**
- * Returns the base path used for resolving text and image links.
- *
- * @return the base path used for resolving links specified with <href>,
- * <img>, etc.
- */
- public String getBasePath() {
- return basePath;
- }
-
- /**
- * Returns the base URL of the rich text control whose content was last
- * copied to the clipboard.
- *
- * @return the base URL of a rich text control
- */
- public URL getCopyURL() {
- if (richText != null) {
- return richText.getCopyURL();
- }
- return null;
- }
-
- /**
- * Sets the base URL of the rich text control whose content was last copied
- * to the clipboard.
- */
- public void setCopyURL() {
- if (richText != null) {
- richText.setCopyURL();
- }
- }
-
- /**
- * Returns the editable state.
- *
- * @return <code>true</code> if the content can be edited
- */
- public boolean getEditable() {
- return editable;
- }
-
- /**
- * Sets the editable state.
- *
- * @param editable
- * the editable state
- */
- public void setEditable(boolean editable) {
- this.editable = editable;
- if (toolBar != null && tabFolder != null) {
- toolBar.updateToolBar(editable);
- }
- if (richText != null) {
- richText.setEditable(editable);
- }
- if (sourceViewer != null) {
- sourceViewer.setEditable(editable);
- }
- }
-
- /**
- * Checks whether the content has been modified.
- *
- * @return <code>true</code> if the content has been modified
- */
- public boolean getModified() {
- if (richText != null) {
- return richText.getModified();
- }
- return false;
- }
-
- /**
- * Sets the modified state.
- *
- * @param modified
- * the modified state
- */
- public void setModified(boolean modified) {
- if (richText != null) {
- richText.setModified(modified);
- }
- }
-
- /**
- * Returns the rich text content.
- *
- * @return the rich text content formatted in XHTML
- */
- public String getText() {
- if (sourceModified) {
- setText(getSourceEdit().getText());
- setModified(true);
- sourceModified = false;
- }
- if (richText != null) {
- return richText.getText();
- }
- return ""; //$NON-NLS-1$
- }
-
- /**
- * Sets the rich text content.
- *
- * @param text
- * the rich text content in XHTML format
- */
- public void setText(String text) {
- if (richText != null) {
- richText.setText(text);
- }
- sourceModified = false;
- if (tabFolder != null) {
- if (toolBar != null) {
- toolBar.updateToolBar(editable);
- }
- if (getSourceEdit() != null) {
- removeModifyListeners();
- currentDoc.set(text);
- addModifyListeners();
- }
- }
- }
-
- protected void addModifyListeners() {
- if (currentDoc != null) {
- currentDoc.addDocumentListener(sourceEditDocumentListener);
- }
- }
-
- protected void removeModifyListeners() {
- if (currentDoc != null) {
- currentDoc.removeDocumentListener(sourceEditDocumentListener);
- }
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.epf.richtext.IRichText#checkModify()
- */
- public void checkModify() {
- richText.checkModify();
- if (sourceModified) {
- notifyModifyListeners();
- }
- if (debug) {
- printDebugMessage("checkModify", "modified=" + sourceModified); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
-
- /**
- * Restores the rich text content back to the initial value.
- */
- public void restoreText() {
- if (richText != null) {
- richText.restoreText();
- }
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.epf.richtext.IRichText#getSelected()
- */
- public RichTextSelection getSelected() {
- if (tabFolder.getSelection() == htmlTab) {
- String HTMLsource = getSourceEdit().getText();
- Point sel = sourceViewer.getSelectedRange();
- int selStartIndex = sel.x;
- int selEndIndex = sel.x + sel.y - 1;
- richText.getSelected().clear();
- richText.getSelected().setText(HTMLsource.substring(selStartIndex, selEndIndex + 1));
- }
- return richText.getSelected();
- }
-
- /**
- * Returns an application specific property value.
- *
- * @param key
- * the name of the property
- * @return the value of the property or <code>null</code> if it has not
- * been set
- */
- public Object getData(String key) {
- if (richText != null) {
- return richText.getData(key);
- }
- return null;
- }
-
- /**
- * Sets an application specific property name and value.
- *
- * @param key
- * the name of the property
- * @param value
- * the new value for the property
- */
- public void setData(String key, Object value) {
- if (richText != null) {
- richText.setData(key, value);
- }
- }
-
- /**
- * Executes the given rich text command. The supported command strings are
- * defined in <code>RichTextCommand<code>.
- *
- * @param command a rich text command string
- * @return a status code returned by the executed command
- */
- public int executeCommand(String command) {
- if (richText != null) {
- return richText.executeCommand(command);
- }
- return 0;
- }
-
- /**
- * Executes the given rich text command with a single parameter. The
- * supported command strings are defined in <code>RichTextCommand<code>.
- *
- * @param command a rich text command string
- * @param param a parameter for the command or <code>null</code>
- * @return a status code returned by the executed command
- */
- public int executeCommand(String command, String param) {
- if (richText != null) {
- return richText.executeCommand(command, param);
- }
- return 0;
- }
-
- /**
- * Executes the given rich text command with an array of parameters. The
- * supported command strings are defined in <code>RichTextCommand<code>.
- *
- * @param command a rich text command string
- * @param params an array of parameters for the command or <code>null</code>
- * @return a status code returned by the executed command
- */
- public int executeCommand(String command, String[] params) {
- if (richText != null) {
- return richText.executeCommand(command, params);
- }
- return 0;
- }
-
- /**
- * Disposes the operating system resources allocated by this editor.
- */
- public void dispose() {
- if (contextMenu != null && !contextMenu.isDisposed()) {
- contextMenu.dispose();
- contextMenu = null;
- }
- if (sourceEditDropTarget != null) {
- sourceEditDropTarget.dispose();
- sourceEditDropTarget = null;
- }
- if (fActivationCodeTrigger != null) {
- fActivationCodeTrigger.uninstall();
- fActivationCodeTrigger= null;
- }
- removeModifyListeners();
- if (getSourceEdit() != null) {
- getSourceEdit().removeListener(SWT.Deactivate,
- sourceEditDeactivateListener);
- getSourceEdit().removeKeyListener(sourceEditKeyListener);
- sourceEditDeactivateListener = null;
- sourceEditKeyListener = null;
- }
-
- if (sourceViewer != null) {
- sourceViewer= null;
- }
-
- if (fActions != null) {
- fActions.clear();
- fActions= null;
- }
- if (fActivationCodes != null) {
- fActivationCodes.clear();
- fActivationCodes= null;
- }
-
- if (richText != null) {
- richText.dispose();
- richText = null;
- }
- }
-
- /**
- * Checks whether this control has been disposed.
- *
- * @return <code>true</code> if this control is disposed successfully
- */
- public boolean isDisposed() {
- if (richText != null) {
- return richText.isDisposed();
- }
- return true;
- }
-
- /**
- * Returns the modify listeners attached to this editor.
- *
- * @return an iterator for retrieving the modify listeners
- */
- public Iterator<ModifyListener> getModifyListeners() {
- if (richText != null) {
- richText.getModifyListeners();
- }
- return null;
- }
-
- /**
- * Adds a listener to the collection of listeners who will be notified when
- * keys are pressed and released within this editor.
- *
- * @param listener
- * the listener which should be notified
- */
- public void addKeyListener(KeyListener listener) {
- if (richText != null) {
- richText.addKeyListener(listener);
- }
- }
-
- /**
- * Removes a listener from the collection of listeners who will be notified
- * when keys are pressed and released within this editor.
- *
- * @param listener
- * the listener which should no longer be notified
- */
- public void removeKeyListener(KeyListener listener) {
- if (richText != null) {
- richText.removeKeyListener(listener);
- }
- }
-
- /**
- * Adds a listener to the collection of listeners who will be notified when
- * the content of this editor is modified.
- *
- * @param listener
- * the listener which should be notified
- */
- public void addModifyListener(ModifyListener listener) {
- if (richText != null) {
- richText.addModifyListener(listener);
- }
- }
-
- /**
- * Removes a listener from the collection of listeners who will be notified
- * when the content of this editor is modified.
- *
- * @param listener
- * the listener which should no longer be notified
- */
- public void removeModifyListener(ModifyListener listener) {
- if (richText != null) {
- richText.removeModifyListener(listener);
- }
- }
-
- /**
- * Adds the listener to the collection of listeners who will be notifed when
- * this editor is disposed.
- *
- * @param listener
- * the listener which should be notified
- */
- public void addDisposeListener(DisposeListener listener) {
- if (richText != null) {
- richText.addDisposeListener(listener);
- }
- }
-
- /**
- * Removes a listener from the collection of listeners who will be notified
- * when this editor is disposed.
- *
- * @param listener
- * the listener which should no longer be notified
- */
- public void removeDisposeListener(DisposeListener listener) {
- if (richText != null) {
- richText.removeDisposeListener(listener);
- }
- }
-
- /**
- * Adds a listener to the collection of listeners who will be notified when
- * help events are generated for this editor.
- *
- * @param listener
- * the listener which should be notified
- */
- public void addHelpListener(HelpListener listener) {
- if (richText != null) {
- richText.addHelpListener(listener);
- }
- }
-
- /**
- * Removes a listener from the collection of listeners who will be notified
- * when help events are generated for this editor.
- *
- * @param listener
- * the listener which should no longer be notified
- */
- public void removeHelpListener(HelpListener listener) {
- if (richText != null) {
- richText.removeHelpListener(listener);
- }
- }
-
- /**
- * Adds the listener to the collection of listeners who will be notifed when
- * an event of the given type occurs within this editor.
- *
- * @param eventType
- * the type of event to listen for
- * @param listener
- * the listener which should be notified when the event occurs
- */
- public void addListener(int eventType, Listener listener) {
- if (richText != null) {
- richText.addListener(eventType, listener);
- }
- }
-
- /**
- * Removes the listener from the collection of listeners who will be notifed
- * when an event of the given type occurs within this editor.
- *
- * @param eventType
- * the type of event to listen for
- * @param listener
- * the listener which should no longer be notified when the event
- * occurs
- */
- public void removeListener(int eventType, Listener listener) {
- if (richText != null) {
- richText.removeListener(eventType, listener);
- }
- }
-
- /**
- * Returns the event listeners attached to this editor.
- *
- * @return an iterator for retrieving the event listeners attached to this
- * editor
- */
- public Iterator<RichTextListener> getListeners() {
- if (richText != null) {
- return richText.getListeners();
- }
- return null;
- }
-
- /**
- * Notifies the modify listeners that the rich text editor content has
- * changed.
- */
- public void notifyModifyListeners() {
- if (richText != null) {
- Event event = new Event();
- event.display = Display.getCurrent();
- event.widget = richText.getControl();
-
- for (Iterator<ModifyListener> i = getModifyListeners(); i != null && i.hasNext();) {
- ModifyListener listener = i.next();
- listener.modifyText(new ModifyEvent(event));
- }
- }
- }
-
- /**
- * Fills the tool bar with action items.
- *
- * @param toolBar
- * a tool bar contain rich text actions
- */
- public void fillToolBar(IRichTextToolBar toolBar) {
- }
-
- /**
- * Creates the underlying rich text control.
- *
- * @param parent
- * the parent composite
- * @param style
- * the style for the control
- * @param basePath
- * the path used for resolving links
- */
- protected IRichText createRichTextControl(Composite parent, int style,
- String basePath) {
- return new RichText(parent, style, basePath);
- }
-
- /**
- * Creates the editor tab folder.
- *
- * @param parent
- * the parent control
- * @param style
- * the style for the control
- * @return a new editor toolbar
- */
- protected CTabFolder createEditorTabFolder(Composite parent, int style) {
- CTabFolder folder = new CTabFolder(parent, SWT.FLAT | SWT.BOTTOM);
- folder.setLayout(new GridLayout(1, true));
- folder.setLayoutData(new GridData(GridData.FILL_BOTH));
-
- Composite richTextComposite = new Composite(folder, SWT.FLAT);
- GridLayout richTextCompositeLayout = new GridLayout(1, false);
- richTextCompositeLayout.marginHeight = 0;
- richTextCompositeLayout.marginWidth = 0;
- richTextComposite.setLayout(richTextCompositeLayout);
- richTextComposite.setLayoutData(new GridData(GridData.FILL_BOTH));
-
- richText = createRichTextControl(richTextComposite, style, basePath);
- richText.setData(PROPERTY_NAME, this);
- richText.getFindReplaceAction().setRichText(this);
-
- richTextTab = new CTabItem(folder, SWT.FLAT);
- richTextTab.setText(RichTextResources.richTextTab_text);
- richTextTab.setToolTipText(RichTextResources.richTextTab_toolTipText);
- richTextTab.setControl(richTextComposite);
-
- Composite htmlComposite = new Composite(folder, SWT.FLAT);
- htmlComposite.setLayout(new FillLayout());
-
- sourceViewer = new TextViewer(htmlComposite, SWT.FLAT | SWT.MULTI
- | SWT.WRAP | SWT.V_SCROLL);
- sourceViewer.setUndoManager(undoManager);
- setDocument(null);
- addModifyListeners();
- getSourceEdit().addListener(SWT.Deactivate, sourceEditDeactivateListener);
- getSourceEdit().addKeyListener(sourceEditKeyListener);
- contextMenu = new Menu(parent.getShell(), SWT.POP_UP);
- getSourceEdit().setMenu(contextMenu);
- // FIXME! This opens up a can of worms, especially with DBCS characters.
- // See https://bugs.eclipse.org/bugs/show_bug.cgi?id=179432.
- //addDropSupportToStyledText();
- fillContextMenu(contextMenu);
-
-
- htmlTab = new CTabItem(folder, SWT.NONE);
- htmlTab.setText(HTML_TAB_NAME);
- htmlTab.setToolTipText(RichTextResources.htmlTab_toolTipText);
- htmlTab.setControl(htmlComposite);
-
- folder.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent event) {
- CTabItem item = (CTabItem) event.item;
- if (item.getText().equals(HTML_TAB_NAME)) {
- removeModifyListeners();
- currentDoc.set(getText());
- sourceModified = false;
- addModifyListeners();
- if (toolBar != null) {
- toolBar.updateToolBar(editable);
- }
- } else {
- updateRichText(getSourceEdit().getText());
- setModified(true);
- if (toolBar != null) {
- toolBar.updateToolBar(editable);
- }
- }
- }
- });
- fillToolBar(toolBar);
-
- initializeActivationCodeTrigger();
- createActions();
-
- folder.setSelection(0);
-
- return folder;
- }
-
-
- private void setDocument(IDocument doc) {
- if (doc == null) {
- doc = new Document();
- }
- // clean up old doc
- undoManager.disconnect();
- IDocument oldDoc = sourceViewer.getDocument();
- if (oldDoc != null) {
- oldDoc.removeDocumentListener(sourceEditDocumentListener);
- }
-
- // hook up new doc
- currentDoc = doc;
- sourceViewer.setDocument(currentDoc);
- currentDoc.addDocumentListener(sourceEditDocumentListener);
- undoManager.connect(sourceViewer);
- if (undoAction != null) {
- undoAction.setContext(getUndoContext());
- }
- if (redoAction != null) {
- redoAction.setContext(getUndoContext());
- }
- }
-
- /**
- * Returns the HTML source edit control.
- *
- * @return a <code>StyleText</code> object.
- */
- public StyledText getSourceEdit() {
- if (sourceViewer != null) {
- return sourceViewer.getTextWidget();
- }
- return null;
- }
-
- /**
- * Inserts text at the selection (overwriting the selection).
- */
- public void addHTML(String text) {
- if (text == null || text.length() == 0)
- return;
- if (tabFolder.getSelection() == richTextTab) {
- //To avoid encoding of javascript
- text = text.replaceAll("&", "&amp;"); //$NON-NLS-1$//$NON-NLS-2$
- executeCommand(RichTextCommand.ADD_HTML, text);
- } else if (tabFolder.getSelection() == htmlTab) {
- String oldHTML = getSourceEdit().getText();
- Point sel = sourceViewer.getSelectedRange();
- int selStartIndex = sel.x;
- int selEndIndex = sel.x + sel.y - 1;
- String newHTML = oldHTML.substring(0, selStartIndex) + text
- + oldHTML.substring(selEndIndex + 1);
- removeModifyListeners();
- currentDoc.set(newHTML);
- addModifyListeners();
- updateRichText(newHTML);
- }
- }
-
-
- /**
- * Inserts an image at the selection (overwriting the selection).
- */
- public void addImage(String imageURL, String height, String width, String altTag) {
- if (tabFolder.getSelection() == richTextTab) {
- executeCommand(
- RichTextCommand.ADD_IMAGE,
- new String[] {
- imageURL,
- height, width, altTag });
- } else if (tabFolder.getSelection() == htmlTab) {
- StringBuffer imageLink = new StringBuffer();
- // order of these attributes is the same as JTidy'ed HTML
- imageLink.append("<img"); //$NON-NLS-1$
- if (height.length() > 0) {
- imageLink.append(" height=\"" + height + "\""); //$NON-NLS-1$ //$NON-NLS-2$
- }
- if (altTag.length() > 0) {
- imageLink.append(" alt=\"" + altTag + "\""); //$NON-NLS-1$ //$NON-NLS-2$
- }
- imageLink.append(" src=\"" + imageURL + "\""); //$NON-NLS-1$ //$NON-NLS-2$
- if (width.length() > 0) {
- imageLink.append(" width=\"" + width + "\""); //$NON-NLS-1$ //$NON-NLS-2$
- }
- imageLink.append(" />"); //$NON-NLS-1$
- String oldHTML = getSourceEdit().getText();
- Point sel = sourceViewer.getSelectedRange();
- int selStartIndex = sel.x;
- int selEndIndex = sel.x + sel.y - 1;
- String newHTML = oldHTML.substring(0, selStartIndex) + imageLink.toString()
- + oldHTML.substring(selEndIndex + 1);
- removeModifyListeners();
- currentDoc.set(newHTML);
- addModifyListeners();
- updateRichText(newHTML);
- }
- }
-
- /**
- * Checks whether the HTML tab is selected.
- *
- * @return <code>true</code> if the HTML tab is selected.
- */
- public boolean isHTMLTabSelected() {
- return (tabFolder.getSelection() == htmlTab);
- }
-
- /**
- * Fills the context menu with menu items.
- *
- * @param contextMenu
- * a context menu containing rich text actions
- */
- protected void fillContextMenu(Menu contextMenu) {
- final MenuItem cutItem = new MenuItem(contextMenu, SWT.PUSH);
- cutItem.setText(RichTextResources.cutAction_text);
- cutItem.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent event) {
- CutAction action = new CutAction(RichTextEditor.this);
- action.execute(RichTextEditor.this);
- }
- });
- final MenuItem copyItem = new MenuItem(contextMenu, SWT.PUSH);
- copyItem.setText(RichTextResources.copyAction_text);
- copyItem.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent event) {
- CopyAction action = new CopyAction(RichTextEditor.this);
- action.execute(RichTextEditor.this);
- }
- });
- final MenuItem pasteItem = new MenuItem(contextMenu, SWT.PUSH);
- pasteItem.setText(RichTextResources.pasteAction_text);
- pasteItem.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent event) {
- PasteAction action = new PasteAction(RichTextEditor.this);
- action.execute(RichTextEditor.this);
- }
- });
-
- final MenuItem pastePlainTextItem = new MenuItem(contextMenu, SWT.PUSH);
- pastePlainTextItem.setText(RichTextResources.pastePlainTextAction_text);
- pastePlainTextItem.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent event) {
- PastePlainTextAction action = new PastePlainTextAction(RichTextEditor.this);
- action.execute(RichTextEditor.this);
- }
- });
-
- contextMenu.addMenuListener(new MenuListener() {
- public void menuHidden(MenuEvent e) {
- }
-
- public void menuShown(MenuEvent e) {
- String selectedText = getSelected().getText();
- boolean selection = selectedText.length() > 0;
- cutItem.setEnabled(editable && selection);
- copyItem.setEnabled(selection);
- pasteItem.setEnabled(editable);
- pastePlainTextItem.setEnabled(editable);
- }
- });
- }
-
- /**
- * Updates the content of the rich text control without updating the HTML
- * source editor.
- * <p>
- * This method should be called by the HTML source editor to sync up its
- * content with the rich text control.
- *
- * @param text
- * the rich text content in XHTML format
- */
- private void updateRichText(String text) {
- if (richText != null) {
- richText.setText(text);
- richText.checkModify();
- }
- sourceModified = false;
- if (tabFolder != null) {
- if (toolBar != null) {
- toolBar.updateToolBar(editable);
- }
- }
- }
-
- private void addDropSupportToStyledText() {
- // this function based heavily on the example at:
- // http://www.eclipse.org/articles/Article-SWT-DND/DND-in-SWT.html
-
- // Allow data to be copied to the drop target
- int operations = DND.DROP_MOVE | DND.DROP_COPY | DND.DROP_DEFAULT;
- sourceEditDropTarget = new DropTarget(getSourceEdit(), operations);
-
- // Receive data in Text or HTML format
- final TextTransfer textTransfer = TextTransfer.getInstance();
- final HTMLTransfer htmlTransfer = HTMLTransfer.getInstance();
- Transfer[] types = new Transfer[] {htmlTransfer, textTransfer};
- sourceEditDropTarget.setTransfer(types);
-
- sourceEditDropTarget.addDropListener(new DropTargetListener() {
- public void dragEnter(DropTargetEvent event) {
- if (event.detail == DND.DROP_DEFAULT) {
- if ((event.operations & DND.DROP_COPY) != 0) {
- event.detail = DND.DROP_COPY;
- } else {
- event.detail = DND.DROP_NONE;
- }
- }
- if (!getEditable()) {
- event.detail = DND.DROP_NONE;
- }
- // will accept text but prefer to have HTML dropped
- for (int i = 0; i < event.dataTypes.length; i++) {
- if (htmlTransfer.isSupportedType(event.dataTypes[i])){
- event.currentDataType = event.dataTypes[i];
- break;
- }
- }
- }
- public void dragOver(DropTargetEvent event) {
- event.feedback = DND.FEEDBACK_SELECT | DND.FEEDBACK_INSERT_AFTER | DND.FEEDBACK_SCROLL;
- }
- public void dragOperationChanged(DropTargetEvent event) {
- if (event.detail == DND.DROP_DEFAULT) {
- if ((event.operations & DND.DROP_COPY) != 0) {
- event.detail = DND.DROP_COPY;
- } else {
- event.detail = DND.DROP_NONE;
- }
- }
- }
- public void dragLeave(DropTargetEvent event) {
- }
- public void dropAccept(DropTargetEvent event) {
- }
- public void drop(DropTargetEvent event) {
- if (textTransfer.isSupportedType(event.currentDataType) ||
- htmlTransfer.isSupportedType(event.currentDataType)) {
- String text = (String)event.data;
- addHTML(text);
- }
- }
- });
- }
-
- /**
- * Displays the given debug message to the console.
- */
- private void printDebugMessage(String method, String msg, String text) {
- StringBuffer strBuf = new StringBuffer();
- strBuf.append("RichTextEditor[").append(richText.getControl().handle).append(']') //$NON-NLS-1$
- .append('.').append(method);
- if (msg != null && msg.length() > 0) {
- strBuf.append(": ").append(msg); //$NON-NLS-1$
- }
- if (text != null && text.length() > 0) {
- strBuf.append('\n').append(text);
- }
- System.out.println(strBuf);
- }
-
- /**
- * Displays the given debug message to the console.
- */
- private void printDebugMessage(String method, String msg) {
- printDebugMessage(method, msg, null);
- }
-
- public FindReplaceAction getFindReplaceAction() {
- return richText.getFindReplaceAction();
- }
-
- public void setFindReplaceAction(FindReplaceAction findReplaceAction) {
- if (richText != null) {
- richText.setFindReplaceAction(findReplaceAction);
- richText.getFindReplaceAction().setRichText(this);
-
- }
- }
-
- public void setInitialText(String text) {
- if (richText != null) {
- richText.setInitialText(text);
- }
- if (getSourceEdit() != null) {
- removeModifyListeners();
- setDocument(new Document(text));
- addModifyListeners();
- }
-
- }
-
-
- /**
- * from org.eclipse.ui.texteditor.AbstractTextEditor#getUndoContext()
- * Returns this editor's viewer's undo manager undo context.
- *
- * @return the undo context or <code>null</code> if not available
- * @since 3.1
- */
- private IUndoContext getUndoContext() {
- if (sourceViewer instanceof ITextViewerExtension6) {
- IUndoManager undoManager= ((ITextViewerExtension6)sourceViewer).getUndoManager();
- if (undoManager instanceof IUndoManagerExtension)
- return ((IUndoManagerExtension)undoManager).getUndoContext();
- }
- return null;
- }
-
- protected void createActions() {
- createUndoRedoActions();
- // select all
- Action selectAllAction = new Action() {
- @Override
- public void run() {
- getSourceEdit().selectAll();
- }
- };
- selectAllAction.setActionDefinitionId(IWorkbenchActionDefinitionIds.SELECT_ALL);
- registerAction(ActionFactory.SELECT_ALL.getId(), selectAllAction);
- }
-
- /*
- * from org.eclipse.ui.texteditor.AbstractTextEditor#createUndoRedoActions()
- */
- protected void createUndoRedoActions() {
- IUndoContext undoContext= getUndoContext();
- if (undoContext != null) {
- // Use actions provided by global undo/redo
-
- // Create the undo action
- undoAction= new UndoActionHandler(getEditorSite(), undoContext);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(undoAction, IAbstractTextEditorHelpContextIds.UNDO_ACTION);
- undoAction.setActionDefinitionId(IWorkbenchActionDefinitionIds.UNDO);
- registerAction(ITextEditorActionConstants.UNDO, undoAction);
-
- // Create the redo action.
- redoAction= new RedoActionHandler(getEditorSite(), undoContext);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(redoAction, IAbstractTextEditorHelpContextIds.REDO_ACTION);
- redoAction.setActionDefinitionId(IWorkbenchActionDefinitionIds.REDO);
- registerAction(ITextEditorActionConstants.REDO, redoAction);
- }
- }
-
- private IEditorSite getEditorSite() {
- return editorSite;
- }
-
-
- /**
- * Registers the given undo/redo action under the given ID and
- * ensures that previously installed actions get disposed. It
- * also takes care of re-registering the new action with the
- * global action handler.
- *
- * @param actionId the action id under which to register the action
- * @param action the action to register
- * @since 3.1
- */
- private void registerAction(String actionId, IAction action) {
- IAction oldAction= getAction(actionId);
- if (oldAction instanceof OperationHistoryActionHandler)
- ((OperationHistoryActionHandler)oldAction).dispose();
-
- setAction(actionId, action);
-
- IActionBars actionBars= getEditorSite().getActionBars();
- if (actionBars != null)
- actionBars.setGlobalActionHandler(actionId, action);
- }
-
-
- /*
- * @see ITextEditor#getAction(String)
- */
- public IAction getAction(String actionID) {
- assert actionID != null;
- IAction action= (IAction) fActions.get(actionID);
-
-// if (action == null) {
-// action= findContributedAction(actionID);
-// if (action != null)
-// setAction(actionID, action);
-// }
-
- return action;
- }
-
- /*
- * @see ITextEditor#setAction(String, IAction)
- */
- public void setAction(String actionID, IAction action) {
- assert actionID != null;
- if (action == null) {
- action= (IAction) fActions.remove(actionID);
- if (action != null)
- fActivationCodeTrigger.unregisterActionFromKeyActivation(action);
- } else {
- fActions.put(actionID, action);
- fActivationCodeTrigger.registerActionForKeyActivation(action);
- }
- }
-
- /**
- * Initializes the activation code trigger.
- *
- * @since 2.1
- */
- private void initializeActivationCodeTrigger() {
- fActivationCodeTrigger.install();
- fActivationCodeTrigger.setScopes(fKeyBindingScopes);
- }
-
- /**
- * Internal key verify listener for triggering action activation codes.
- */
- class ActivationCodeTrigger implements VerifyKeyListener {
-
- /** Indicates whether this trigger has been installed. */
- private boolean fIsInstalled= false;
- /**
- * The key binding service to use.
- * @since 2.0
- */
- private IKeyBindingService fKeyBindingService;
-
- /*
- * @see VerifyKeyListener#verifyKey(org.eclipse.swt.events.VerifyEvent)
- */
- public void verifyKey(VerifyEvent event) {
-
- ActionActivationCode code= null;
- int size= fActivationCodes.size();
- for (int i= 0; i < size; i++) {
- code= (ActionActivationCode) fActivationCodes.get(i);
- if (code.matches(event)) {
- IAction action= getAction(code.fActionId);
- if (action != null) {
-
- if (action instanceof IUpdate)
- ((IUpdate) action).update();
-
- if (!action.isEnabled() && action instanceof IReadOnlyDependent) {
- IReadOnlyDependent dependent= (IReadOnlyDependent) action;
- boolean writable= dependent.isEnabled(true);
- if (writable) {
- event.doit= false;
- return;
- }
- } else if (action.isEnabled()) {
- event.doit= false;
- action.run();
- return;
- }
- }
- }
- }
- }
-
- /**
- * Installs this trigger on the editor's text widget.
- * @since 2.0
- */
- public void install() {
- if (!fIsInstalled) {
-
- if (sourceViewer instanceof ITextViewerExtension) {
- ITextViewerExtension e= (ITextViewerExtension) sourceViewer;
- e.prependVerifyKeyListener(this);
- } else {
- StyledText text= sourceViewer.getTextWidget();
- text.addVerifyKeyListener(this);
- }
-
- fKeyBindingService= getEditorSite().getKeyBindingService();
- fIsInstalled= true;
- }
- }
-
- /**
- * Uninstalls this trigger from the editor's text widget.
- * @since 2.0
- */
- public void uninstall() {
- if (fIsInstalled) {
-
- if (sourceViewer instanceof ITextViewerExtension) {
- ITextViewerExtension e= (ITextViewerExtension) sourceViewer;
- e.removeVerifyKeyListener(this);
- } else if (sourceViewer != null) {
- StyledText text= sourceViewer.getTextWidget();
- if (text != null && !text.isDisposed())
- text.removeVerifyKeyListener(fActivationCodeTrigger);
- }
-
- fIsInstalled= false;
- fKeyBindingService= null;
- }
- }
-
- /**
- * Registers the given action for key activation.
- * @param action the action to be registered
- * @since 2.0
- */
- public void registerActionForKeyActivation(IAction action) {
- if (action.getActionDefinitionId() != null)
- fKeyBindingService.registerAction(action);
- }
-
- /**
- * The given action is no longer available for key activation
- * @param action the action to be unregistered
- * @since 2.0
- */
- public void unregisterActionFromKeyActivation(IAction action) {
- if (action.getActionDefinitionId() != null)
- fKeyBindingService.unregisterAction(action);
- }
-
- /**
- * Sets the key binding scopes for this editor.
- * @param keyBindingScopes the key binding scopes
- * @since 2.1
- */
- public void setScopes(String[] keyBindingScopes) {
- if (keyBindingScopes != null && keyBindingScopes.length > 0)
- fKeyBindingService.setScopes(keyBindingScopes);
- }
- }
-
- /**
- * Representation of action activation codes.
- */
- static class ActionActivationCode {
-
- /** The action id. */
- public String fActionId;
- /** The character. */
- public char fCharacter;
- /** The key code. */
- public int fKeyCode= -1;
- /** The state mask. */
- public int fStateMask= SWT.DEFAULT;
-
- /**
- * Creates a new action activation code for the given action id.
- * @param actionId the action id
- */
- public ActionActivationCode(String actionId) {
- fActionId= actionId;
- }
-
- /**
- * Returns <code>true</code> if this activation code matches the given verify event.
- * @param event the event to test for matching
- * @return whether this activation code matches <code>event</code>
- */
- public boolean matches(VerifyEvent event) {
- return (event.character == fCharacter &&
- (fKeyCode == -1 || event.keyCode == fKeyCode) &&
- (fStateMask == SWT.DEFAULT || event.stateMask == fStateMask));
- }
- }
-
-}
diff --git a/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/RichTextEditorForm.java b/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/RichTextEditorForm.java
deleted file mode 100644
index aebc146cf72..00000000000
--- a/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/RichTextEditorForm.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-//------------------------------------------------------------------------------
-// Copyright (c) 2005, 2006 IBM Corporation 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:
-// IBM Corporation - initial implementation
-//------------------------------------------------------------------------------
-package org.eclipse.epf.richtext;
-
-import org.eclipse.swt.custom.ViewForm;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.forms.widgets.FormToolkit;
-
-/**
- * A composite for laying out the default rich text editor in an Eclipse form.
- *
- * @author Kelvin Low
- * @since 1.0
- */
-public class RichTextEditorForm extends ViewForm {
-
- /**
- * Creates a new instance.
- *
- * @param parent
- * the parent control
- * @param style
- * the style for this control
- */
- public RichTextEditorForm(Composite parent, int style) {
- super(parent, style);
- }
-
- /**
- * @see org.eclipse.swt.widgets#getData(String key)
- */
- public Object getData(String key) {
- if (key != null && key.equals(FormToolkit.KEY_DRAW_BORDER)) {
- // Return a text border to get the FormToolkit's BorderPainter to
- // paint a border for the rich text editor.
- return FormToolkit.TEXT_BORDER;
- }
- return super.getData();
- }
-
-}
diff --git a/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/RichTextFormToolkit.java b/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/RichTextFormToolkit.java
deleted file mode 100644
index 7809c45f4f3..00000000000
--- a/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/RichTextFormToolkit.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-//------------------------------------------------------------------------------
-// Copyright (c) 2005, 2006 IBM Corporation 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:
-// IBM Corporation - initial implementation
-//------------------------------------------------------------------------------
-package org.eclipse.epf.richtext;
-
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.IEditorSite;
-import org.eclipse.ui.forms.widgets.FormToolkit;
-
-/**
- * A helper toolkit for creating a rich text control and editor that can be
- * added to an Eclipse form.
- *
- * @author Kelvin Low
- * @since 1.0
- */
-public class RichTextFormToolkit {
-
- /**
- * Creates a rich text control and adapts it to be used in a form.
- *
- * @param toolkit
- * the form toolkit
- * @param parent
- * the parent control
- * @param text
- * the initial text for the viewer
- * @param style
- * the initial style for the viewer
- * @param basePath
- * the base path used for resolving hrefs
- * @return a new <code>IRichText</code> instance
- */
- public static IRichText createRichText(FormToolkit toolkit,
- Composite parent, String text, int style) {
- IRichText richText = new RichText(parent, toolkit.getBorderStyle()
- | style | toolkit.getOrientation());
- richText.getControl().setData(FormToolkit.KEY_DRAW_BORDER,
- FormToolkit.TEXT_BORDER);
- if (text != null) {
- richText.setText(text);
- }
- return richText;
- }
-
- /**
- * Creates a rich text editor and adapts it to be used in a form.
- *
- * @param toolkit
- * the form toolkit
- * @param parent
- * the parent control
- * @param text
- * the initial text for the viewer
- * @param style
- * the initial style for the viewer
- * @param basePath
- * the base path used for resolving hrefs
- * @return a new <code>IRichText</code> instance
- */
- public static IRichTextEditor createRichTextEditor(FormToolkit toolkit,
- Composite parent, String text, int style, IEditorSite editorSite) {
- IRichTextEditor richTextEditor = new RichTextEditor(parent, toolkit
- .getBorderStyle()
- | style | toolkit.getOrientation(), editorSite);
- richTextEditor.getControl().setData(FormToolkit.KEY_DRAW_BORDER,
- FormToolkit.TEXT_BORDER);
- if (text != null) {
- richTextEditor.setInitialText(text);
- }
- return richTextEditor;
- }
-
-}
diff --git a/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/RichTextImages.java b/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/RichTextImages.java
deleted file mode 100644
index db51e92f1f7..00000000000
--- a/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/RichTextImages.java
+++ /dev/null
@@ -1,475 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-//------------------------------------------------------------------------------
-// Copyright (c) 2005, 2006 IBM Corporation 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:
-// IBM Corporation - initial implementation
-//------------------------------------------------------------------------------
-package org.eclipse.epf.richtext;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.swt.graphics.Image;
-
-/**
- * Shared images used by the default rich text editor.
- *
- * @author Kelvin Low
- * @since 1.0
- */
-public class RichTextImages {
-
- private static final String ETOOL16 = "full/etool16/"; //$NON-NLS-1$
-
- private static final String DTOOL16 = "full/dtool16/"; //$NON-NLS-1$
-
- private static final RichTextPlugin richTextPlugin = RichTextPlugin
- .getDefault();
-
- public static final String IMG_PATH_ADD_IMAGE = ETOOL16 + "AddImage.gif"; //$NON-NLS-1$
-
- public static final String IMG_PATH_ADD_LINE = ETOOL16 + "AddLine.gif"; //$NON-NLS-1$
-
- public static final String IMG_PATH_ADD_LINK = ETOOL16 + "AddLink.gif"; //$NON-NLS-1$
-
- public static final String IMG_PATH_ADD_ORDERED_LIST = ETOOL16
- + "AddOrderedList.gif"; //$NON-NLS-1$
-
- public static final String IMG_PATH_ADD_TABLE = ETOOL16 + "AddTable.gif"; //$NON-NLS-1$
-
- public static final String IMG_PATH_ADD_UNORDERED_LIST = ETOOL16
- + "AddUnorderedList.gif"; //$NON-NLS-1$
-
- public static final String IMG_PATH_BOLD = ETOOL16 + "Bold.gif"; //$NON-NLS-1$
-
- public static final String IMG_PATH_CLEAR_CONTENT = ETOOL16
- + "ClearContent.gif"; //$NON-NLS-1$
-
- public static final String IMG_PATH_COPY = ETOOL16 + "Copy.gif"; //$NON-NLS-1$
-
- public static final String IMG_PATH_CUT = ETOOL16 + "Cut.gif"; //$NON-NLS-1$
-
- public static final String IMG_PATH_FIND_REPLACE = ETOOL16
- + "FindReplace.gif"; //$NON-NLS-1$
-
- public static final String IMG_PATH_INDENT = ETOOL16 + "Indent.gif"; //$NON-NLS-1$
-
- public static final String IMG_PATH_ITALIC = ETOOL16 + "Italic.gif"; //$NON-NLS-1$
-
- public static final String IMG_PATH_JUSTIFY_CENTER = ETOOL16
- + "JustifyCenter.gif"; //$NON-NLS-1$
-
- public static final String IMG_PATH_JUSTIFY_FULL = ETOOL16
- + "JustifyFull.gif"; //$NON-NLS-1$
-
- public static final String IMG_PATH_JUSTIFY_LEFT = ETOOL16
- + "JustifyLeft.gif"; //$NON-NLS-1$
-
- public static final String IMG_PATH_JUSTIFY_RIGHT = ETOOL16
- + "JustifyRight.gif"; //$NON-NLS-1$
-
- public static final String IMG_PATH_OUTDENT = ETOOL16 + "Outdent.gif"; //$NON-NLS-1$
-
- public static final String IMG_PATH_PASTE = ETOOL16 + "Paste.gif"; //$NON-NLS-1$
-
- public static final String IMG_PATH_PASTE_PLAIN_TEXT = ETOOL16 + "PastePlainText.gif"; //$NON-NLS-1$
-
- public static final String IMG_PATH_STRIKE_THROUGH = ETOOL16
- + "StrikeThrough.gif"; //$NON-NLS-1$
-
- public static final String IMG_PATH_SUBSCRIPT = ETOOL16 + "Subscript.gif"; //$NON-NLS-1$
-
- public static final String IMG_PATH_SUPERSCRIPT = ETOOL16
- + "Superscript.gif"; //$NON-NLS-1$
-
- public static final String IMG_PATH_UNDERLINE = ETOOL16 + "Underline.gif"; //$NON-NLS-1$
-
- public static final String IMG_PATH_TIDY = ETOOL16 + "TidyHTML.gif"; //$NON-NLS-1$
-
- public static final String IMG_PATH_ADD_CODE = ETOOL16 + "AddCode.gif"; //$NON-NLS-1$
-
- public static final Image IMG_ADD_IMAGE = richTextPlugin
- .getSharedImage(IMG_PATH_ADD_IMAGE);
-
- public static final Image IMG_ADD_LINE = richTextPlugin
- .getSharedImage(IMG_PATH_ADD_LINE);
-
- public static final Image IMG_ADD_LINK = richTextPlugin
- .getSharedImage(IMG_PATH_ADD_LINK);
-
- public static final Image IMG_ADD_ORDERED_LIST = richTextPlugin
- .getSharedImage(IMG_PATH_ADD_ORDERED_LIST);
-
- public static final Image IMG_ADD_TABLE = richTextPlugin
- .getSharedImage(IMG_PATH_ADD_TABLE);
-
- public static final Image IMG_ADD_UNORDERED_LIST = richTextPlugin
- .getSharedImage(IMG_PATH_ADD_UNORDERED_LIST);
-
- public static final Image IMG_BOLD = richTextPlugin
- .getSharedImage(IMG_PATH_BOLD);
-
- public static final Image IMG_CLEAR_CONTENT = richTextPlugin
- .getSharedImage(IMG_PATH_CLEAR_CONTENT);
-
- public static final Image IMG_COPY = richTextPlugin
- .getSharedImage(IMG_PATH_COPY);
-
- public static final Image IMG_CUT = richTextPlugin
- .getSharedImage(IMG_PATH_CUT);
-
- public static final Image IMG_FIND_REPLACE = richTextPlugin
- .getSharedImage(IMG_PATH_FIND_REPLACE);
-
- public static final Image IMG_INDENT = richTextPlugin
- .getSharedImage(IMG_PATH_INDENT);
-
- public static final Image IMG_ITALIC = richTextPlugin
- .getSharedImage(IMG_PATH_ITALIC);
-
- public static final Image IMG_JUSTIFY_CENTER = richTextPlugin
- .getSharedImage(IMG_PATH_JUSTIFY_CENTER);
-
- public static final Image IMG_JUSTIFY_FULL = richTextPlugin
- .getSharedImage(IMG_PATH_JUSTIFY_FULL);
-
- public static final Image IMG_JUSTIFY_LEFT = richTextPlugin
- .getSharedImage(IMG_PATH_JUSTIFY_LEFT);
-
- public static final Image IMG_JUSTIFY_RIGHT = richTextPlugin
- .getSharedImage(IMG_PATH_JUSTIFY_RIGHT);
-
- public static final Image IMG_OUTDENT = richTextPlugin
- .getSharedImage(IMG_PATH_OUTDENT);
-
- public static final Image IMG_PASTE = richTextPlugin
- .getSharedImage(IMG_PATH_PASTE);
-
- public static final Image IMG_PASTE_PLAIN_TEXT = richTextPlugin
- .getSharedImage(IMG_PATH_PASTE_PLAIN_TEXT);
-
- public static final Image IMG_STRIKE_THROUGH = richTextPlugin
- .getSharedImage(IMG_PATH_STRIKE_THROUGH);
-
- public static final Image IMG_SUBSCRIPT = richTextPlugin
- .getSharedImage(IMG_PATH_SUBSCRIPT);
-
- public static final Image IMG_SUPERSCRIPT = richTextPlugin
- .getSharedImage(IMG_PATH_SUPERSCRIPT);
-
- public static final Image IMG_UNDERLINE = richTextPlugin
- .getSharedImage(IMG_PATH_UNDERLINE);
- public static final Image IMG_TIDY = richTextPlugin
- .getSharedImage(IMG_PATH_TIDY);
-
- public static final ImageDescriptor IMG_DESC_ADD_IMAGE = richTextPlugin
- .getImageDescriptor(IMG_PATH_ADD_IMAGE);
-
- public static final ImageDescriptor IMG_DESC_ADD_LINE = richTextPlugin
- .getImageDescriptor(IMG_PATH_ADD_LINE);
-
- public static final ImageDescriptor IMG_DESC_ADD_LINK = richTextPlugin
- .getImageDescriptor(IMG_PATH_ADD_LINK);
-
- public static final ImageDescriptor IMG_DESC_ADD_ORDERED_LIST = richTextPlugin
- .getImageDescriptor(IMG_PATH_ADD_ORDERED_LIST);
-
- public static final ImageDescriptor IMG_DESC_ADD_TABLE = richTextPlugin
- .getImageDescriptor(IMG_PATH_ADD_TABLE);
-
- public static final ImageDescriptor IMG_DESC_ADD_UNORDERED_LIST = richTextPlugin
- .getImageDescriptor(IMG_PATH_ADD_UNORDERED_LIST);
-
- public static final ImageDescriptor IMG_DESC_BOLD = richTextPlugin
- .getImageDescriptor(IMG_PATH_BOLD);
-
- public static final ImageDescriptor IMG_DESC_CLEAR_CONTENT = richTextPlugin
- .getImageDescriptor(IMG_PATH_CLEAR_CONTENT);
-
- public static final ImageDescriptor IMG_DESC_COPY = richTextPlugin
- .getImageDescriptor(IMG_PATH_COPY);
-
- public static final ImageDescriptor IMG_DESC_CUT = richTextPlugin
- .getImageDescriptor(IMG_PATH_CUT);
-
- public static final ImageDescriptor IMG_DESC_FIND_REPLACE = richTextPlugin
- .getImageDescriptor(IMG_PATH_FIND_REPLACE);
-
- public static final ImageDescriptor IMG_DESC_INDENT = richTextPlugin
- .getImageDescriptor(IMG_PATH_INDENT);
-
- public static final ImageDescriptor IMG_DESC_ITALIC = richTextPlugin
- .getImageDescriptor(IMG_PATH_ITALIC);
-
- public static final ImageDescriptor IMG_DESC_JUSTIFY_CENTER = richTextPlugin
- .getImageDescriptor(IMG_PATH_JUSTIFY_CENTER);
-
- public static final ImageDescriptor IMG_DESC_JUSTIFY_FULL = richTextPlugin
- .getImageDescriptor(IMG_PATH_JUSTIFY_FULL);
-
- public static final ImageDescriptor IMG_DESC_JUSTIFY_LEFT = richTextPlugin
- .getImageDescriptor(IMG_PATH_JUSTIFY_LEFT);
-
- public static final ImageDescriptor IMG_DESC_JUSTIFY_RIGHT = richTextPlugin
- .getImageDescriptor(IMG_PATH_JUSTIFY_RIGHT);
-
- public static final ImageDescriptor IMG_DESC_OUTDENT = richTextPlugin
- .getImageDescriptor(IMG_PATH_OUTDENT);
-
- public static final ImageDescriptor IMG_DESC_PASTE = richTextPlugin
- .getImageDescriptor(IMG_PATH_PASTE);
-
- public static final ImageDescriptor IMG_DESC_PASTE_PLAIN_TEXT = richTextPlugin
- .getImageDescriptor(IMG_PATH_PASTE_PLAIN_TEXT);
-
- public static final ImageDescriptor IMG_DESC_STRIKE_THROUGH = richTextPlugin
- .getImageDescriptor(IMG_PATH_STRIKE_THROUGH);
-
- public static final ImageDescriptor IMG_DESC_SUBSCRIPT = richTextPlugin
- .getImageDescriptor(IMG_PATH_SUBSCRIPT);
-
- public static final ImageDescriptor IMG_DESC_SUPERSCRIPT = richTextPlugin
- .getImageDescriptor(IMG_PATH_SUPERSCRIPT);
-
- public static final ImageDescriptor IMG_DESC_UNDERLINE = richTextPlugin
- .getImageDescriptor(IMG_PATH_UNDERLINE);
-
- public static final ImageDescriptor IMG_DESC_TIDY = richTextPlugin
- .getImageDescriptor(IMG_PATH_TIDY);
-
- public static final ImageDescriptor IMG_DESC_ADD_CODE = richTextPlugin
- .getImageDescriptor(IMG_PATH_ADD_CODE);
-
-
- public static final String DISABLED_IMG_PATH_ADD_IMAGE = DTOOL16
- + "AddImage.gif"; //$NON-NLS-1$
-
-// public static final String DISABLED_IMG_PATH_ADD_LINE = DTOOL16
-// + "AddLine.gif"; //$NON-NLS-1$
-
- public static final String DISABLED_IMG_PATH_ADD_LINK = DTOOL16
- + "AddLink.gif"; //$NON-NLS-1$
-
- public static final String DISABLED_IMG_PATH_ADD_ORDERED_LIST = DTOOL16
- + "AddOrderedList.gif"; //$NON-NLS-1$
-
- public static final String DISABLED_IMG_PATH_ADD_TABLE = DTOOL16
- + "AddTable.gif"; //$NON-NLS-1$
-
- public static final String DISABLED_IMG_PATH_ADD_UNORDERED_LIST = DTOOL16
- + "AddUnorderedList.gif"; //$NON-NLS-1$
-
- public static final String DISABLED_IMG_PATH_BOLD = DTOOL16 + "Bold.gif"; //$NON-NLS-1$
-
- public static final String DISABLED_IMG_PATH_CLEAR_CONTENT = DTOOL16
- + "ClearContent.gif"; //$NON-NLS-1$
-
- public static final String DISABLED_IMG_PATH_COPY = DTOOL16 + "Copy.gif"; //$NON-NLS-1$
-
- public static final String DISABLED_IMG_PATH_CUT = DTOOL16 + "Cut.gif"; //$NON-NLS-1$
-
- public static final String DISABLED_IMG_PATH_FIND_REPLACE = DTOOL16
- + "FindReplace.gif"; //$NON-NLS-1$
-
- public static final String DISABLED_IMG_PATH_INDENT = DTOOL16
- + "Indent.gif"; //$NON-NLS-1$
-
- public static final String DISABLED_IMG_PATH_ITALIC = DTOOL16
- + "Italic.gif"; //$NON-NLS-1$
-
-// public static final String DISABLED_IMG_PATH_JUSTIFY_CENTER = DTOOL16
-// + "JustifyCenter.gif"; //$NON-NLS-1$
-//
-// public static final String DISABLED_IMG_PATH_JUSTIFY_FULL = DTOOL16
-// + "JustifyFull.gif"; //$NON-NLS-1$
-//
-// public static final String DISABLED_IMG_PATH_JUSTIFY_LEFT = DTOOL16
-// + "JustifyLeft.gif"; //$NON-NLS-1$
-//
-// public static final String DISABLED_IMG_PATH_JUSTIFY_RIGHT = DTOOL16
-// + "JustifyRight.gif"; //$NON-NLS-1$
-
- public static final String DISABLED_IMG_PATH_OUTDENT = DTOOL16
- + "Outdent.gif"; //$NON-NLS-1$
-
- public static final String DISABLED_IMG_PATH_PASTE = DTOOL16 + "Paste.gif"; //$NON-NLS-1$
-
- public static final String DISABLED_IMG_PATH_PASTE_PLAIN_TEXT = DTOOL16 + "PastePlainText.gif"; //$NON-NLS-1$
-
-// public static final String DISABLED_IMG_PATH_STRIKE_THROUGH = DTOOL16
-// + "StrikeThrough.gif"; //$NON-NLS-1$
-
- public static final String DISABLED_IMG_PATH_SUBSCRIPT = DTOOL16
- + "Subscript.gif"; //$NON-NLS-1$
-
- public static final String DISABLED_IMG_PATH_SUPERSCRIPT = DTOOL16
- + "Superscript.gif"; //$NON-NLS-1$
-
- private static String DISABLED_IMG_PATH_TIDY = DTOOL16 + "TidyHTML.gif"; //$NON-NLS-1$
-
- public static final String DISABLED_IMG_PATH_UNDERLINE = DTOOL16
- + "Underline.gif"; //$NON-NLS-1$
-
- public static final String DISABLED_IMG_PATH_ADD_CODE = DTOOL16
- + "AddCode.gif"; //$NON-NLS-1$
-
- public static final Image DISABLED_IMG_ADD_IMAGE = richTextPlugin
- .getSharedImage(DISABLED_IMG_PATH_ADD_IMAGE);
-
-// public static final Image DISABLED_IMG_ADD_LINE = richTextPlugin
-// .getSharedImage(DISABLED_IMG_PATH_ADD_LINE);
-
- public static final Image DISABLED_IMG_ADD_LINK = richTextPlugin
- .getSharedImage(DISABLED_IMG_PATH_ADD_LINK);
-
- public static final Image DISABLED_IMG_ADD_ORDERED_LIST = richTextPlugin
- .getSharedImage(DISABLED_IMG_PATH_ADD_ORDERED_LIST);
-
- public static final Image DISABLED_IMG_ADD_TABLE = richTextPlugin
- .getSharedImage(DISABLED_IMG_PATH_ADD_TABLE);
-
- public static final Image DISABLED_IMG_ADD_UNORDERED_LIST = richTextPlugin
- .getSharedImage(DISABLED_IMG_PATH_ADD_UNORDERED_LIST);
-
- public static final Image DISABLED_IMG_BOLD = richTextPlugin
- .getSharedImage(DISABLED_IMG_PATH_BOLD);
-
- public static final Image DISABLED_IMG_CLEAR_CONTENT = richTextPlugin
- .getSharedImage(DISABLED_IMG_PATH_CLEAR_CONTENT);
-
- public static final Image DISABLED_IMG_COPY = richTextPlugin
- .getSharedImage(DISABLED_IMG_PATH_COPY);
-
- public static final Image DISABLED_IMG_CUT = richTextPlugin
- .getSharedImage(DISABLED_IMG_PATH_CUT);
-
- public static final Image DISABLED_IMG_FIND_REPLACE = richTextPlugin
- .getSharedImage(DISABLED_IMG_PATH_FIND_REPLACE);
-
- public static final Image DISABLED_IMG_INDENT = richTextPlugin
- .getSharedImage(DISABLED_IMG_PATH_INDENT);
-
- public static final Image DISABLED_IMG_ITALIC = richTextPlugin
- .getSharedImage(DISABLED_IMG_PATH_ITALIC);
-
-// public static final Image DISABLED_IMG_JUSTIFY_CENTER = richTextPlugin
-// .getSharedImage(DISABLED_IMG_PATH_JUSTIFY_CENTER);
-//
-// public static final Image DISABLED_IMG_JUSTIFY_FULL = richTextPlugin
-// .getSharedImage(DISABLED_IMG_PATH_JUSTIFY_FULL);
-//
-// public static final Image DISABLED_IMG_JUSTIFY_LEFT = richTextPlugin
-// .getSharedImage(DISABLED_IMG_PATH_JUSTIFY_LEFT);
-//
-// public static final Image DISABLED_IMG_JUSTIFY_RIGHT = richTextPlugin
-// .getSharedImage(DISABLED_IMG_PATH_JUSTIFY_RIGHT);
-
- public static final Image DISABLED_IMG_OUTDENT = richTextPlugin
- .getSharedImage(DISABLED_IMG_PATH_OUTDENT);
-
- public static final Image DISABLED_IMG_PASTE = richTextPlugin
- .getSharedImage(DISABLED_IMG_PATH_PASTE);
-
-// public static final Image DISABLED_IMG_STRIKE_THROUGH = richTextPlugin
-// .getSharedImage(DISABLED_IMG_PATH_STRIKE_THROUGH);
-
- public static final Image DISABLED_IMG_SUBSCRIPT = richTextPlugin
- .getSharedImage(DISABLED_IMG_PATH_SUBSCRIPT);
-
- public static final Image DISABLED_IMG_SUPERSCRIPT = richTextPlugin
- .getSharedImage(DISABLED_IMG_PATH_SUPERSCRIPT);
-
- public static final Image DISABLED_IMG_UNDERLINE = richTextPlugin
- .getSharedImage(DISABLED_IMG_PATH_UNDERLINE);
-
- public static final ImageDescriptor DISABLED_IMG_DESC_ADD_IMAGE = richTextPlugin
- .getImageDescriptor(DISABLED_IMG_PATH_ADD_IMAGE);
-
-// public static final ImageDescriptor DISABLED_IMG_DESC_ADD_LINE = richTextPlugin
-// .getImageDescriptor(DISABLED_IMG_PATH_ADD_LINE);
-
- public static final ImageDescriptor DISABLED_IMG_DESC_ADD_LINK = richTextPlugin
- .getImageDescriptor(DISABLED_IMG_PATH_ADD_LINK);
-
- public static final ImageDescriptor DISABLED_IMG_DESC_ADD_ORDERED_LIST = richTextPlugin
- .getImageDescriptor(DISABLED_IMG_PATH_ADD_ORDERED_LIST);
-
- public static final ImageDescriptor DISABLED_IMG_DESC_ADD_TABLE = richTextPlugin
- .getImageDescriptor(DISABLED_IMG_PATH_ADD_TABLE);
-
- public static final ImageDescriptor DISABLED_IMG_DESC_ADD_UNORDERED_LIST = richTextPlugin
- .getImageDescriptor(DISABLED_IMG_PATH_ADD_UNORDERED_LIST);
-
- public static final ImageDescriptor DISABLED_IMG_DESC_BOLD = richTextPlugin
- .getImageDescriptor(DISABLED_IMG_PATH_BOLD);
-
- public static final ImageDescriptor DISABLED_IMG_DESC_CLEAR_CONTENT = richTextPlugin
- .getImageDescriptor(DISABLED_IMG_PATH_CLEAR_CONTENT);
-
- public static final ImageDescriptor DISABLED_IMG_DESC_COPY = richTextPlugin
- .getImageDescriptor(DISABLED_IMG_PATH_COPY);
-
- public static final ImageDescriptor DISABLED_IMG_DESC_CUT = richTextPlugin
- .getImageDescriptor(DISABLED_IMG_PATH_CUT);
-
- public static final ImageDescriptor DISABLED_IMG_DESC_FIND_REPLACE = richTextPlugin
- .getImageDescriptor(DISABLED_IMG_PATH_FIND_REPLACE);
-
- public static final ImageDescriptor DISABLED_IMG_DESC_INDENT = richTextPlugin
- .getImageDescriptor(DISABLED_IMG_PATH_INDENT);
-
- public static final ImageDescriptor DISABLED_IMG_DESC_ITALIC = richTextPlugin
- .getImageDescriptor(DISABLED_IMG_PATH_ITALIC);
-
-// public static final ImageDescriptor DISABLED_IMG_DESC_JUSTIFY_CENTER = richTextPlugin
-// .getImageDescriptor(DISABLED_IMG_PATH_JUSTIFY_CENTER);
-//
-// public static final ImageDescriptor DISABLED_IMG_DESC_JUSTIFY_FULL = richTextPlugin
-// .getImageDescriptor(DISABLED_IMG_PATH_JUSTIFY_FULL);
-//
-// public static final ImageDescriptor DISABLED_IMG_DESC_JUSTIFY_LEFT = richTextPlugin
-// .getImageDescriptor(DISABLED_IMG_PATH_JUSTIFY_LEFT);
-//
-// public static final ImageDescriptor DISABLED_IMG_DESC_JUSTIFY_RIGHT = richTextPlugin
-// .getImageDescriptor(DISABLED_IMG_PATH_JUSTIFY_RIGHT);
-
- public static final ImageDescriptor DISABLED_IMG_DESC_OUTDENT = richTextPlugin
- .getImageDescriptor(DISABLED_IMG_PATH_OUTDENT);
-
- public static final ImageDescriptor DISABLED_IMG_DESC_PASTE = richTextPlugin
- .getImageDescriptor(DISABLED_IMG_PATH_PASTE);
-
- public static final ImageDescriptor DISABLED_IMG_DESC_PASTE_PLAIN_TEXT = richTextPlugin
- .getImageDescriptor(DISABLED_IMG_PATH_PASTE_PLAIN_TEXT);
-
-// public static final ImageDescriptor DISABLED_IMG_DESC_STRIKE_THROUGH = richTextPlugin
-// .getImageDescriptor(DISABLED_IMG_PATH_STRIKE_THROUGH);
-
- public static final ImageDescriptor DISABLED_IMG_DESC_SUBSCRIPT = richTextPlugin
- .getImageDescriptor(DISABLED_IMG_PATH_SUBSCRIPT);
-
- public static final ImageDescriptor DISABLED_IMG_DESC_SUPERSCRIPT = richTextPlugin
- .getImageDescriptor(DISABLED_IMG_PATH_SUPERSCRIPT);
-
- public static final ImageDescriptor DISABLED_IMG_DESC_UNDERLINE = richTextPlugin
- .getImageDescriptor(DISABLED_IMG_PATH_UNDERLINE);
-
- public static final ImageDescriptor DISABLED_IMG_DESC_TIDY = richTextPlugin
- .getImageDescriptor(DISABLED_IMG_PATH_TIDY);
-
- public static final ImageDescriptor DISABLED_IMG_DESC_ADD_CODE = richTextPlugin
- .getImageDescriptor(DISABLED_IMG_PATH_ADD_CODE);
-
-}
diff --git a/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/RichTextListener.java b/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/RichTextListener.java
deleted file mode 100644
index 8e6116ab635..00000000000
--- a/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/RichTextListener.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-//------------------------------------------------------------------------------
-// Copyright (c) 2005, 2006 IBM Corporation 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:
-// IBM Corporation - initial implementation
-//------------------------------------------------------------------------------
-package org.eclipse.epf.richtext;
-
-import org.eclipse.swt.widgets.Listener;
-
-/**
- * Listens to a rich text editing event.
- *
- * @author Kelvin Low
- * @since 1.0
- */
-public class RichTextListener {
-
- private int eventType;
-
- private Listener listener;
-
- /**
- * Creates a new instance.
- *
- * @param eventType
- * the event type
- * @param listener
- * the event listener
- */
- public RichTextListener(int eventType, Listener listener) {
- this.eventType = eventType;
- this.listener = listener;
- }
-
- /**
- * Returns the event type.
- *
- * @return the event type
- */
- public int getEventType() {
- return eventType;
- }
-
- /**
- * Returns the event listener.
- */
- public Listener getListener() {
- return listener;
- }
-
-}
diff --git a/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/RichTextPlugin.java b/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/RichTextPlugin.java
deleted file mode 100644
index b204b83a44b..00000000000
--- a/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/RichTextPlugin.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-//------------------------------------------------------------------------------
-// Copyright (c) 2005, 2006 IBM Corporation 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:
-// IBM Corporation - initial implementation
-//------------------------------------------------------------------------------
-package org.eclipse.epf.richtext;
-
-import java.util.Date;
-
-import org.eclipse.epf.common.ui.AbstractPlugin;
-import org.osgi.framework.BundleContext;
-
-/**
- * The Rich Text plug-in class.
- *
- * @author Kelvin Low
- * @since 1.0
- */
-public class RichTextPlugin extends AbstractPlugin {
-
- // The shared plug-in instance.
- private static RichTextPlugin plugin;
-
- // The date and time when this plug-in was started.
- private Date startTime;
-
- /**
- * Default constructor.
- */
- public RichTextPlugin() {
- super();
- plugin = this;
- }
-
- /**
- * @see AbstractPlugin#start(BundleContext)
- */
- public void start(BundleContext context) throws Exception {
- super.start(context);
- startTime = new Date();
- }
-
- /**
- * @see AbstractPlugin#stop(BundleContext)
- */
- public void stop(BundleContext context) throws Exception {
- super.stop(context);
- plugin = null;
- }
-
- /**
- * Returns the shared plug-in instance.
- */
- public static RichTextPlugin getDefault() {
- return plugin;
- }
-
- /**
- * Returns the date and time when this plug-in was started.
- */
- public Date getStartTime() {
- return startTime;
- }
-
-}
diff --git a/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/RichTextResources.java b/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/RichTextResources.java
deleted file mode 100644
index 0dc234b29f3..00000000000
--- a/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/RichTextResources.java
+++ /dev/null
@@ -1,148 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-//------------------------------------------------------------------------------
-// Copyright (c) 2005, 2007 IBM Corporation 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:
-// IBM Corporation - initial implementation
-//------------------------------------------------------------------------------
-package org.eclipse.epf.richtext;
-
-import org.eclipse.osgi.util.NLS;
-
-/**
- * The RichText resources.
- *
- * @author Kelvin Low
- * @author Jeff Hardy
- * @since 1.0
- */
-public final class RichTextResources extends NLS {
-
- private static String BUNDLE_NAME = RichTextResources.class
- .getPackage().getName() + ".Resources"; //$NON-NLS-1$
-
- private RichTextResources() {
- // Do not instantiate.
- }
-
- public static String fontNameAction_CSS_Default;
- public static String fontNameAction_CSS_Default_Mozilla;
- public static String fontNameAction_DefaultFontName;
- public static String fontStyle_normal;
- public static String fontStyle_sectionHeading;
- public static String fontStyle_subsectionHeading;
- public static String fontStyle_subSubsectionHeading;
- public static String fontStyle_quote;
- public static String fontStyle_codeSample;
- public static String blockTag_paragraph;
- public static String blockTag_heading1;
- public static String blockTag_heading2;
- public static String blockTag_heading3;
- public static String blockTag_heading4;
- public static String blockTag_heading5;
- public static String blockTag_heading6;
- public static String blockTag_address;
- public static String blockTag_preformattedText;
- public static String fontName_default;
- public static String fontName_arial;
- public static String fontName_courierNew;
- public static String fontName_timesNewRoman;
- public static String fontName_verdana;
- public static String addHorizontalBarAction_toolTipText;
- public static String addImageAction_toolTipText;
- public static String addLineAction_toolTipText;
- public static String addLinkAction_toolTipText;
- public static String addOrderedListAction_toolTipText;
- public static String addTableAction_toolTipText;
- public static String addUnorderedListAction_toolTipText;
- public static String boldAction_toolTipText;
- public static String clearContentAction_toolTipText;
- public static String copyAction_toolTipText;
- public static String cutAction_toolTipText;
- public static String findReplaceAction_toolTipText;
- public static String indentAction_toolTipText;
- public static String italicAction_toolTipText;
- public static String justifyCenterAction_toolTipText;
- public static String justifyFullAction_toolTipText;
- public static String justifyLeftAction_toolTipText;
- public static String justifyRightAction_toolTipText;
- public static String outdentAction_toolTipText;
- public static String pasteAction_toolTipText;
- public static String pastePlainTextAction_toolTipText;
- public static String subscriptAction_toolTipText;
- public static String superscriptAction_toolTipText;
- public static String underlineAction_toolTipText;
- public static String fontStyleAction_toolTipText;
- public static String blockTagAction_toolTipText;
- public static String fontNameAction_toolTipText;
- public static String fontSizeAction_toolTipText;
- public static String cutAction_text;
- public static String copyAction_text;
- public static String pasteAction_text;
- public static String pastePlainTextAction_text;
- public static String richTextTab_text;
- public static String richTextTab_toolTipText;
- public static String htmlTab_text;
- public static String htmlTab_toolTipText;
- public static String addImageDialog_title;
- public static String addLinkDialog_title;
- public static String addTableDialog_title;
- public static String findReplaceDialog_title;
- public static String urlDisplayNameLabel_text;
- public static String urlLabel_text;
- public static String summaryLabel_text;
- public static String captionLabel_text;
- public static String rowsLabel_text;
- public static String columnsLabel_text;
- public static String widthLabel_text;
- public static String tableStyleLabel_text;
- public static String tableHeaderNone_text;
- public static String tableHeaderCols_text;
- public static String tableHeaderRows_text;
- public static String tableHeaderBoth_text;
- public static String browseButton_text;
- public static String clearContentDialog_title;
- public static String clearContentDialog_text;
- public static String findLabel_text;
- public static String replaceLabel_text;
- public static String optionsGroup_text;
- public static String caseSensitiveCheckbox_text;
- public static String wholeWordCheckbox_text;
- public static String directionGroup_text;
- public static String forwardRadioButton_text;
- public static String backwardRadioButton_text;
- public static String findButton_text;
- public static String replaceButton_text;
- public static String replaceFindButton_text;
- public static String replaceallButton_text;
- public static String FindReplace_Status_noMatch_label;
- public static String maxCharsPerLineLabel_text;
- public static String indentHTMLCheckbox_text;
- public static String indentSizeLabel_text;
- public static String tidy_clean_text;
- public static String tidy_cleaner_text;
- public static String tidy_cleanest_text;
- public static String tidy_clean_toolTipText;
- public static String tidy_cleaner_toolTipText;
- public static String tidy_cleanest_toolTipText;
- public static String addCodeAction_toolTipText;
- public static String addCodeDialog_title;
- public static String addCodeDialog_Msg;
-
- static {
- NLS.initializeMessages(BUNDLE_NAME, RichTextResources.class);
- }
-} \ No newline at end of file
diff --git a/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/RichTextSelection.java b/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/RichTextSelection.java
deleted file mode 100644
index ee9c7671704..00000000000
--- a/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/RichTextSelection.java
+++ /dev/null
@@ -1,150 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-//------------------------------------------------------------------------------
-// Copyright (c) 2005, 2007 IBM Corporation 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:
-// IBM Corporation - initial implementation
-//------------------------------------------------------------------------------
-package org.eclipse.epf.richtext;
-
-/**
- * Models a text selection in a rich text control and editor.
- *
- * @author Jeff Hardy
- * @since 1.2
- */
-public class RichTextSelection {
-
- // The control's text selection.
- protected String text = ""; //$NON-NLS-1$
-
- // The control's text selection offset
- protected int offsetStart = 0;
-
- // The control's text selection font
- protected String fontName = ""; //$NON-NLS-1$
-
- // The control's text selection font size
- // could be in point size (12pt), or HTML size (1-7)
- protected String fontSize = ""; //$NON-NLS-1$
-
- // The control's text current style
- protected String blockStyle = ""; //$NON-NLS-1$
-
- // The control's text current flags
- protected int flags = 0;
-
- // Text status flags
- public static final int BOLD = 1;
-
- public static final int ITALIC = BOLD << 1;
-
- public static final int UNDERLINE = ITALIC << 1;
-
- public static final int SUBSCRIPT = UNDERLINE << 1;
-
- public static final int SUPERSCRIPT = SUBSCRIPT << 1;
-
- public String getBlockStyle() {
- return blockStyle;
- }
-
- public void setBlockStyle(String blockStyle) {
- this.blockStyle = blockStyle;
- }
-
- public int getFlags() {
- return flags;
- }
-
- public void setFlags(int flags) {
- this.flags = flags;
- }
-
- public String getFontName() {
- return fontName;
- }
-
- public void setFontName(String fontName) {
- this.fontName = fontName;
- }
-
- public String getFontSize() {
- return fontSize;
- }
-
- public void setFontSize(String fontSize) {
- this.fontSize = fontSize;
- }
-
- public int getOffsetStart() {
- return offsetStart;
- }
-
- public void setOffsetStart(int offsetStart) {
- this.offsetStart = offsetStart;
- }
-
- public String getText() {
- return text;
- }
-
- public void setText(String text) {
- this.text = text;
- }
-
- public boolean isBold() {
- return (flags & BOLD) != 0;
- }
-
- public boolean isItalic() {
- return (flags & ITALIC) != 0;
- }
-
- public boolean isUnderLine() {
- return (flags & UNDERLINE) != 0;
- }
-
- public boolean isSubscript() {
- return (flags & SUBSCRIPT) != 0;
- }
-
- public boolean isSuperscript() {
- return (flags & SUPERSCRIPT) != 0;
- }
-
- /**
- * Clears the selection info
- */
- public void clear() {
- text = ""; //$NON-NLS-1$
- offsetStart = 0;
- fontName = ""; //$NON-NLS-1$
- fontSize = ""; //$NON-NLS-1$
- blockStyle = ""; //$NON-NLS-1$
- flags = 0;
- }
-
- public String toString() {
- String str = "Text: " + text + "\n"; //$NON-NLS-1$ //$NON-NLS-2$
- str += "fontName: " + fontName + "\n"; //$NON-NLS-1$ //$NON-NLS-2$
- str += "fontSize: " + fontSize + "\n"; //$NON-NLS-1$ //$NON-NLS-2$
- str += "blockStyle: " + blockStyle + "\n"; //$NON-NLS-1$ //$NON-NLS-2$
- str += "flags: " + flags + "\n"; //$NON-NLS-1$ //$NON-NLS-2$
- return str;
- }
-
-}
diff --git a/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/RichTextToolBar.java b/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/RichTextToolBar.java
deleted file mode 100644
index 70252607447..00000000000
--- a/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/RichTextToolBar.java
+++ /dev/null
@@ -1,191 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-//------------------------------------------------------------------------------
-// Copyright (c) 2005, 2007 IBM Corporation 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:
-// IBM Corporation - initial implementation
-//------------------------------------------------------------------------------
-package org.eclipse.epf.richtext;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.epf.richtext.actions.IRichTextAction;
-import org.eclipse.epf.richtext.actions.RichTextAction;
-import org.eclipse.epf.richtext.actions.RichTextComboAction;
-import org.eclipse.jface.action.ActionContributionItem;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.action.Separator;
-import org.eclipse.jface.action.ToolBarManager;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.ToolItem;
-
-/**
- * The default rich text tool bar implementation.
- *
- * Split into 2 toolbars (one for CCombos, one for buttons) for tabbing purposes.
- *
- * @author Kelvin Low
- * @author Jeff Hardy
- * @since 1.0
- */
-public class RichTextToolBar implements IRichTextToolBar {
-
- // The parent rich text control.
- private IRichText richText;
-
- // If true, add a new tool bar.
- private boolean addToolBar = true;
-
- // The current tool bar manager used to populate the tool actions.
- private ToolBarManager toolbarMgr;
-
- // The current tool bar manager used to populate the tool actions.
- private ToolBarManager toolbarMgrCombo;
-
- // The action items in the tool bar(s).
- private List<Object> actionItems = new ArrayList<Object>();
-
- private static int lastWidth = -1;
-
- protected Composite parent;
-
- /**
- * Creates a new instance.
- *
- * @param parent
- * the parent composite
- * @param style
- * the tool bar style
- * @param richText
- * the parent rich text control
- */
- public RichTextToolBar(Composite parent, int style, IRichText richText) {
- this.parent = parent;
- this.richText = richText;
-
- addToolBar();
- }
-
- public void addAction(final IAction action) {
- if (action != null) {
- ActionContributionItem item = new ActionContributionItem(action);
- toolbarMgr.add(item);
- toolbarMgr.update(true);
- actionItems.add(item);
- }
- }
-
- /**
- * Adds a combo action to the tool bar.
- *
- * @param action
- * the action to add
- */
- public void addAction(final RichTextComboAction item) {
- if (item != null) {
- item.init();
- toolbarMgrCombo.add(item);
- toolbarMgrCombo.update(true);
- actionItems.add(item);
- }
- }
-
- /**
- * Adds a separator to the tool bar.
- */
- public void addSeparator() {
- toolbarMgr.add(new Separator());
- }
-
- /**
- * Updates the toolbar state.
- * <p>
- * Enables/disables actions depending on the currently selected
- * RichTextEditor tab (RichText vs. HTML)
- *
- * @param editable
- * specifies whether to enable non-ReadOnly commands
- */
- public void updateToolBar(boolean editable) {
- boolean richTextMode = true;
- if (richText instanceof RichTextEditor
- && ((RichTextEditor) richText).isHTMLTabSelected()) {
- richTextMode = false;
- }
- for (Iterator i = actionItems.iterator(); i.hasNext();) {
- Object item = i.next();
- if (item instanceof ToolItem) {
- boolean enabledToolItem = true;
- ToolItem toolItem = (ToolItem) item;
- IRichTextAction action = (IRichTextAction) toolItem.getData();
- if (action != null && !editable
- && action.disableInReadOnlyMode()) {
- enabledToolItem = false;
- }
- if (action != null && !richTextMode
- && action.disableInSourceMode()) {
- enabledToolItem = false;
- }
- toolItem.setEnabled(enabledToolItem);
- } else if (item instanceof Combo) {
- if (richTextMode && editable) {
- ((Combo) item).setEnabled(true);
- } else {
- ((Combo) item).setEnabled(false);
- }
- } else if (item instanceof ActionContributionItem) {
- boolean enabledToolItem = true;
- RichTextAction action = (RichTextAction) ((ActionContributionItem) item)
- .getAction();
- if (action != null && !editable
- && action.disableInReadOnlyMode()) {
- enabledToolItem = false;
- }
- if (action != null && !richTextMode
- && action.disableInSourceMode()) {
- enabledToolItem = false;
- }
- action.setEnabled(enabledToolItem);
- }
- }
- }
-
- /**
- * Adds a tool bar, if necessary, to contain a button action or separator.
- */
- protected void addToolBar() {
- if (addToolBar) {
- toolbarMgrCombo = new ToolBarManager(SWT.WRAP | SWT.FLAT | parent.getStyle());
- toolbarMgrCombo.createControl(parent);
- toolbarMgr = new ToolBarManager(SWT.WRAP | SWT.FLAT | parent.getStyle());
- toolbarMgr.createControl(parent);
- addToolBar = false;
- }
- }
-
- public ToolBarManager getToolbarMgr() {
- return toolbarMgr;
- }
-
- public ToolBarManager getToolbarMgrCombo() {
- return toolbarMgrCombo;
- }
-
-}
diff --git a/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/actions/AddCodeAction.java b/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/actions/AddCodeAction.java
deleted file mode 100644
index 49a63617e24..00000000000
--- a/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/actions/AddCodeAction.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
-* Licensed Materials - Property of IBM
-* (c) Copyright IBM Corporation 2007,2011. All Rights Reserved.
-*
-* Note to U.S. Government Users Restricted Rights:
-* Use, duplication or disclosure restricted by GSA ADP Schedule
-* Contract with IBM Corp.
-*******************************************************************************/
-
-package org.eclipse.epf.richtext.actions;
-
-import org.eclipse.epf.richtext.IRichText;
-import org.eclipse.epf.richtext.RichText;
-import org.eclipse.epf.richtext.RichTextCommand;
-import org.eclipse.epf.richtext.RichTextImages;
-import org.eclipse.epf.richtext.RichTextResources;
-import org.eclipse.epf.richtext.dialogs.AddCodeDialog;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.widgets.Display;
-
-public class AddCodeAction extends RichTextAction {
-
- public AddCodeAction(IRichText richText) {
- super(richText, IAction.AS_PUSH_BUTTON);
- setImageDescriptor(RichTextImages.IMG_DESC_ADD_CODE);
- setDisabledImageDescriptor(RichTextImages.DISABLED_IMG_DESC_ADD_CODE);
- setToolTipText(RichTextResources.addCodeAction_toolTipText);
- }
-
- public void execute(IRichText richText) {
- if (richText != null ) {
- AddCodeDialog dialog = new AddCodeDialog(Display.getCurrent().getActiveShell());
- dialog.open();
- if (dialog.getReturnCode() == Window.OK) {
- String html = RichText.workaroundForObjectParamNode(dialog.getCode());
- richText.executeCommand(RichTextCommand.ADD_HTML, html);
- }
- }
- }
-
-}
diff --git a/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/actions/AddImageAction.java b/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/actions/AddImageAction.java
deleted file mode 100644
index c5b9ece213b..00000000000
--- a/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/actions/AddImageAction.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-//------------------------------------------------------------------------------
-// Copyright (c) 2005, 2006 IBM Corporation 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:
-// IBM Corporation - initial implementation
-//------------------------------------------------------------------------------
-package org.eclipse.epf.richtext.actions;
-
-import org.eclipse.epf.richtext.IRichText;
-import org.eclipse.epf.richtext.RichTextCommand;
-import org.eclipse.epf.richtext.RichTextImages;
-import org.eclipse.epf.richtext.RichTextResources;
-import org.eclipse.epf.richtext.dialogs.AddImageDialog;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.widgets.Display;
-
-/**
- * Adds an image to a rich text control.
- *
- * @author Kelvin Low
- * @since 1.0
- */
-public class AddImageAction extends RichTextAction {
-
- /**
- * Creates a new instance.
- */
- public AddImageAction(IRichText richText) {
- super(richText, IAction.AS_PUSH_BUTTON);
- setImageDescriptor(RichTextImages.IMG_DESC_ADD_IMAGE);
- setDisabledImageDescriptor(RichTextImages.DISABLED_IMG_DESC_ADD_IMAGE);
- setToolTipText(RichTextResources.addImageAction_toolTipText);
- }
-
- /**
- * Executes the action.
- *
- * @param richText
- * a rich text control
- */
- public void execute(IRichText richText) {
- if (richText != null) {
- AddImageDialog dialog = new AddImageDialog(Display.getCurrent()
- .getActiveShell());
- dialog.open();
- if (dialog.getReturnCode() == Window.OK) {
- String imageURL = dialog.getImage().getURL();
- if (imageURL.length() > 0) {
- richText
- .executeCommand(RichTextCommand.ADD_IMAGE, imageURL);
- }
- }
- }
- }
-
- public boolean disableInSourceMode() {
- return false;
- }
-
-
-} \ No newline at end of file
diff --git a/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/actions/AddLineAction.java b/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/actions/AddLineAction.java
deleted file mode 100644
index 206e287bc88..00000000000
--- a/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/actions/AddLineAction.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-//------------------------------------------------------------------------------
-// Copyright (c) 2005, 2006 IBM Corporation 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:
-// IBM Corporation - initial implementation
-//------------------------------------------------------------------------------
-package org.eclipse.epf.richtext.actions;
-
-import org.eclipse.epf.richtext.IRichText;
-import org.eclipse.epf.richtext.RichTextCommand;
-import org.eclipse.epf.richtext.RichTextImages;
-import org.eclipse.epf.richtext.RichTextResources;
-import org.eclipse.jface.action.IAction;
-
-/**
- * Adds a horizontal bar to a rich text control.
- *
- * @author Kelvin Low
- * @since 1.0
- */
-public class AddLineAction extends RichTextAction {
-
- /**
- * Creates a new instance.
- */
- public AddLineAction(IRichText richText) {
- super(richText, IAction.AS_PUSH_BUTTON);
- setImageDescriptor(RichTextImages.IMG_DESC_ADD_LINE);
- setToolTipText(RichTextResources.addLineAction_toolTipText);
- }
-
- /**
- * Executes the action.
- *
- * @param richText
- * a rich text control
- */
- public void execute(IRichText richText) {
- if (richText != null) {
- richText.executeCommand(RichTextCommand.ADD_LINE);
- }
- }
-
-} \ No newline at end of file
diff --git a/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/actions/AddLinkAction.java b/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/actions/AddLinkAction.java
deleted file mode 100644
index 91d0ec0fba3..00000000000
--- a/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/actions/AddLinkAction.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-//------------------------------------------------------------------------------
-// Copyright (c) 2005, 2006 IBM Corporation 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:
-// IBM Corporation - initial implementation
-//------------------------------------------------------------------------------
-package org.eclipse.epf.richtext.actions;
-
-import org.eclipse.epf.richtext.IRichText;
-import org.eclipse.epf.richtext.RichTextCommand;
-import org.eclipse.epf.richtext.RichTextImages;
-import org.eclipse.epf.richtext.RichTextResources;
-import org.eclipse.epf.richtext.dialogs.AddLinkDialog;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.widgets.Display;
-
-/**
- * Adds a link to a rich text control.
- *
- * @author Kelvin Low
- * @since 1.0
- */
-public class AddLinkAction extends RichTextAction {
-
- /**
- * Creates a new instance.
- */
- public AddLinkAction(IRichText richText) {
- super(richText, IAction.AS_PUSH_BUTTON);
- setImageDescriptor(RichTextImages.IMG_DESC_ADD_LINK);
- setDisabledImageDescriptor(RichTextImages.DISABLED_IMG_DESC_ADD_LINK);
- setToolTipText(RichTextResources.addLinkAction_toolTipText);
- }
-
- /**
- * Executes the action.
- *
- * @param richText
- * a rich text control
- */
- public void execute(IRichText richText) {
- if (richText != null) {
- AddLinkDialog dialog = new AddLinkDialog(Display.getCurrent()
- .getActiveShell(), richText.getBasePath());
- dialog.open();
- if (dialog.getReturnCode() == Window.OK) {
- String linkURL = dialog.getLink().getURL();
- if (linkURL.length() > 0) {
- richText.executeCommand(RichTextCommand.ADD_LINK, linkURL);
- }
- }
- }
- }
-
- public boolean disableInSourceMode() {
- return false;
- }
-
-} \ No newline at end of file
diff --git a/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/actions/AddOrderedListAction.java b/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/actions/AddOrderedListAction.java
deleted file mode 100644
index 60eca82eb26..00000000000
--- a/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/actions/AddOrderedListAction.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-//------------------------------------------------------------------------------
-// Copyright (c) 2005, 2006 IBM Corporation 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:
-// IBM Corporation - initial implementation
-//------------------------------------------------------------------------------
-package org.eclipse.epf.richtext.actions;
-
-import org.eclipse.epf.richtext.IRichText;
-import org.eclipse.epf.richtext.RichTextCommand;
-import org.eclipse.epf.richtext.RichTextImages;
-import org.eclipse.epf.richtext.RichTextResources;
-import org.eclipse.jface.action.IAction;
-
-/**
- * Adds an ordered list to a rich text control.
- *
- * @author Kelvin Low
- * @since 1.0
- */
-public class AddOrderedListAction extends RichTextAction {
-
- /**
- * Creates a new instance.
- */
- public AddOrderedListAction(IRichText richText) {
- super(richText, IAction.AS_PUSH_BUTTON);
- setImageDescriptor(RichTextImages.IMG_DESC_ADD_ORDERED_LIST);
- setDisabledImageDescriptor(RichTextImages.DISABLED_IMG_DESC_ADD_ORDERED_LIST);
- setToolTipText(RichTextResources.addOrderedListAction_toolTipText);
- }
-
- /**
- * Executes the action.
- *
- * @param richText
- * a rich text control
- */
- public void execute(IRichText richText) {
- if (richText != null) {
- richText.executeCommand(RichTextCommand.ADD_ORDERED_LIST);
- }
- }
-
-}
diff --git a/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/actions/AddTableAction.java b/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/actions/AddTableAction.java
deleted file mode 100644
index e3d68dab496..00000000000
--- a/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/actions/AddTableAction.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-//------------------------------------------------------------------------------
-// Copyright (c) 2005, 2006 IBM Corporation 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:
-// IBM Corporation - initial implementation
-//------------------------------------------------------------------------------
-package org.eclipse.epf.richtext.actions;
-
-import org.eclipse.epf.richtext.IRichText;
-import org.eclipse.epf.richtext.RichTextCommand;
-import org.eclipse.epf.richtext.RichTextImages;
-import org.eclipse.epf.richtext.RichTextResources;
-import org.eclipse.epf.richtext.dialogs.AddTableDialog;
-import org.eclipse.epf.richtext.html.Table;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.widgets.Display;
-
-/**
- * Adds a table to a rich text control.
- *
- * @author Kelvin Low
- * @since 1.0
- */
-public class AddTableAction extends RichTextAction {
-
- /**
- * Creates a new instance.
- */
- public AddTableAction(IRichText richText) {
- super(richText, IAction.AS_PUSH_BUTTON);
- setImageDescriptor(RichTextImages.IMG_DESC_ADD_TABLE);
- setDisabledImageDescriptor(RichTextImages.DISABLED_IMG_DESC_ADD_TABLE);
- setToolTipText(RichTextResources.addTableAction_toolTipText);
- }
-
- /**
- * Executes the action.
- *
- * @param richText
- * a rich text control
- */
- public void execute(IRichText richText) {
- if (richText != null) {
- AddTableDialog dialog = new AddTableDialog(Display.getCurrent()
- .getActiveShell());
- dialog.open();
- if (dialog.getReturnCode() == Window.OK) {
- Table table = dialog.getTable();
- int rows = table.getRows();
- int cols = table.getColumns();
- String width = table.getWidth();
- int tableheaders = table.getTableHeaders();
- String summary = table.getSummary();
- String caption = table.getCaption();
- if (rows > 0 && cols > 0) {
- richText
- .executeCommand(
- RichTextCommand.ADD_TABLE,
- new String[] {
- "" + rows, "" + cols, "" + width, summary, caption, "" + tableheaders }); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- }
- }
- }
- }
-
-} \ No newline at end of file
diff --git a/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/actions/AddUnorderedListAction.java b/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/actions/AddUnorderedListAction.java
deleted file mode 100644
index fa9c0b8fcef..00000000000
--- a/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/actions/AddUnorderedListAction.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-//------------------------------------------------------------------------------
-// Copyright (c) 2005, 2006 IBM Corporation 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:
-// IBM Corporation - initial implementation
-//------------------------------------------------------------------------------
-package org.eclipse.epf.richtext.actions;
-
-import org.eclipse.epf.richtext.IRichText;
-import org.eclipse.epf.richtext.RichTextCommand;
-import org.eclipse.epf.richtext.RichTextImages;
-import org.eclipse.epf.richtext.RichTextResources;
-import org.eclipse.jface.action.IAction;
-
-/**
- * Adds an unordered list to a rich text control.
- *
- * @author Kelvin Low
- * @since 1.0
- */
-public class AddUnorderedListAction extends RichTextAction {
-
- /**
- * Creates a new instance.
- */
- public AddUnorderedListAction(IRichText richText) {
- super(richText, IAction.AS_PUSH_BUTTON);
- setImageDescriptor(RichTextImages.IMG_DESC_ADD_UNORDERED_LIST);
- setDisabledImageDescriptor(RichTextImages.DISABLED_IMG_DESC_ADD_UNORDERED_LIST);
- setToolTipText(RichTextResources.addUnorderedListAction_toolTipText);
- }
-
- /**
- * Executes the action.
- *
- * @param richText
- * a rich text control
- */
- public void execute(IRichText richText) {
- if (richText != null) {
- richText.executeCommand(RichTextCommand.ADD_UNORDERED_LIST);
- }
- }
-
-}
diff --git a/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/actions/BaseRichTextAction.java b/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/actions/BaseRichTextAction.java
deleted file mode 100644
index e5024d72520..00000000000
--- a/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/actions/BaseRichTextAction.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-//------------------------------------------------------------------------------
-// Copyright (c) 2005, 2006 IBM Corporation 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:
-// IBM Corporation - initial implementation
-//------------------------------------------------------------------------------
-package org.eclipse.epf.richtext.actions;
-
-/**
- * The abstract base class for all rich text action.
- *
- * @author Kelvin Low
- * @since 1.0
- */
-public abstract class BaseRichTextAction implements IBaseRichTextAction {
-
- protected String toolTipText;
-
- protected boolean enabled = true;
-
- /**
- * Creates a new instance.
- *
- * @param richText
- * a rich text control
- */
- public BaseRichTextAction() {
- }
-
- /**
- * Returns the tool tip for the action.
- *
- * @return the tool tip text
- */
- public String getToolTipText() {
- return toolTipText;
- }
-
- /**
- * Sets the tool tip for the action.
- *
- * @param toolTipText
- * the tool tip text
- */
- public void setToolTipText(String toolTipText) {
- this.toolTipText = toolTipText;
- }
-
- /**
- * Returns the enabled status of the action.
- *
- * @return <code>true</code> if enabled, <code>false</code> if not
- */
- public boolean getEnabled() {
- return enabled;
- }
-
- /**
- * Enables or disables the action.
- *
- * @param enabled
- * if <code>true</code>, enable the action. if
- * <code>false</code>, disable it.
- */
- public void setEnabled(boolean enabled) {
- this.enabled = enabled;
- }
-
-}
diff --git a/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/actions/BlockTagAction.java b/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/actions/BlockTagAction.java
deleted file mode 100644
index 92dd320a3a2..00000000000
--- a/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/actions/BlockTagAction.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-//------------------------------------------------------------------------------
-// Copyright (c) 2005, 2006 IBM Corporation 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:
-// IBM Corporation - initial implementation
-//------------------------------------------------------------------------------
-package org.eclipse.epf.richtext.actions;
-
-import java.util.ArrayList;
-import java.util.Collection;
-
-import org.eclipse.epf.richtext.IRichText;
-import org.eclipse.epf.richtext.RichTextCommand;
-import org.eclipse.epf.richtext.RichTextResources;
-import org.eclipse.epf.richtext.html.BlockTag;
-
-/**
- * Sets the font name for the selected text in a rich text control.
- *
- * @author Kelvin Low
- * @since 1.0
- */
-public class BlockTagAction extends RichTextComboAction {
-
- /**
- * Creates a new instance.
- */
- public BlockTagAction(final IRichText richText) {
- super(richText);
- setToolTipText(RichTextResources.blockTagAction_toolTipText);
- }
-
- @Override
- public Collection<String> getInput() {
- Collection<String> returnList = new ArrayList<String>();
-
- returnList.add(BlockTag.PARAGRAPH.getName());
- returnList.add(BlockTag.HEADING_1.getName());
- returnList.add(BlockTag.HEADING_2.getName());
- returnList.add(BlockTag.HEADING_3.getName());
- returnList.add(BlockTag.HEADING_4.getName());
- returnList.add(BlockTag.HEADING_5.getName());
- returnList.add(BlockTag.HEADING_6.getName());
- returnList.add(BlockTag.ADDRESS.getName());
- returnList.add(BlockTag.PREFORMATTED_TEXT.getName());
-
- return returnList;
- }
-
-
-
- /**
- * Executes the action.
- *
- * @param richText
- * a rich text control
- * @param index
- * the index of the selected item
- */
- public void execute(IRichText richText) {
- if (richText != null) {
- String selected = getCComboSelection();
- richText.executeCommand(RichTextCommand.FORMAT_BLOCK, selected);
- }
- }
-
-} \ No newline at end of file
diff --git a/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/actions/BoldAction.java b/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/actions/BoldAction.java
deleted file mode 100644
index be193e621d1..00000000000
--- a/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/actions/BoldAction.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-//------------------------------------------------------------------------------
-// Copyright (c) 2005, 2006 IBM Corporation 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:
-// IBM Corporation - initial implementation
-//------------------------------------------------------------------------------
-package org.eclipse.epf.richtext.actions;
-
-import org.eclipse.epf.richtext.IRichText;
-import org.eclipse.epf.richtext.RichTextCommand;
-import org.eclipse.epf.richtext.RichTextImages;
-import org.eclipse.epf.richtext.RichTextResources;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Listener;
-
-/**
- * Toggles the 'bold' attribute of the selected text in a rich text control.
- *
- * @author Kelvin Low
- * @since 1.0
- */
-public class BoldAction extends RichTextAction {
-
- /**
- * Creates a new instance.
- */
- public BoldAction(final IRichText richText) {
- super(richText, IAction.AS_CHECK_BOX);
- setImageDescriptor(RichTextImages.IMG_DESC_BOLD);
- setDisabledImageDescriptor(RichTextImages.DISABLED_IMG_DESC_BOLD);
- setToolTipText(RichTextResources.boldAction_toolTipText);
- // add listener
- richText.addListener(SWT.SELECTED, new Listener() {
- public void handleEvent(Event event) {
- setChecked(richText.getSelected().isBold());
- }
- });
- }
-
- /**
- * Executes the action.
- *
- * @param richText
- * a rich text control
- */
- public void execute(IRichText richText) {
- if (richText != null) {
- richText.executeCommand(RichTextCommand.BOLD);
- }
- }
-}
diff --git a/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/actions/ClearContentAction.java b/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/actions/ClearContentAction.java
deleted file mode 100644
index a6a6d0dc676..00000000000
--- a/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/actions/ClearContentAction.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-//------------------------------------------------------------------------------
-// Copyright (c) 2005, 2006 IBM Corporation 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:
-// IBM Corporation - initial implementation
-//------------------------------------------------------------------------------
-package org.eclipse.epf.richtext.actions;
-
-import org.eclipse.epf.richtext.IRichText;
-import org.eclipse.epf.richtext.RichTextCommand;
-import org.eclipse.epf.richtext.RichTextImages;
-import org.eclipse.epf.richtext.RichTextPlugin;
-import org.eclipse.epf.richtext.RichTextResources;
-import org.eclipse.jface.action.IAction;
-
-/**
- * Clears the content of a rich text control.
- *
- * @author Kelvin Low
- * @since 1.0
- */
-public class ClearContentAction extends RichTextAction {
-
- /**
- * Creates a new instance.
- */
- public ClearContentAction(IRichText richText) {
- super(richText, IAction.AS_PUSH_BUTTON);
- setImageDescriptor(RichTextImages.IMG_DESC_CLEAR_CONTENT);
- setDisabledImageDescriptor(RichTextImages.DISABLED_IMG_DESC_CLEAR_CONTENT);
- setToolTipText(RichTextResources.clearContentAction_toolTipText);
- }
-
- /**
- * Executes the action.
- *
- * @param richText
- * s rich text control
- */
- public void execute(IRichText richText) {
- if (richText != null) {
- if (RichTextPlugin.getDefault().getMsgDialog().displayPrompt(
- RichTextResources.clearContentDialog_title,
- RichTextResources.clearContentDialog_text)) {
- richText.executeCommand(RichTextCommand.CLEAR_CONTENT);
- }
- }
- }
-
-}
diff --git a/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/actions/CopyAction.java b/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/actions/CopyAction.java
deleted file mode 100644
index e8796f6e854..00000000000
--- a/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/actions/CopyAction.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-//------------------------------------------------------------------------------
-// Copyright (c) 2005, 2006 IBM Corporation 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:
-// IBM Corporation - initial implementation
-//------------------------------------------------------------------------------
-package org.eclipse.epf.richtext.actions;
-
-import org.eclipse.epf.richtext.IRichText;
-import org.eclipse.epf.richtext.RichTextCommand;
-import org.eclipse.epf.richtext.RichTextEditor;
-import org.eclipse.epf.richtext.RichTextImages;
-import org.eclipse.epf.richtext.RichTextResources;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.swt.custom.StyledText;
-
-/**
- * Copies the selected text in a rich text control to the clipboard.
- *
- * @author Kelvin Low
- * @since 1.0
- */
-public class CopyAction extends RichTextAction {
-
- /**
- * Creates a new instance.
- */
- public CopyAction(IRichText richText) {
- super(richText, IAction.AS_PUSH_BUTTON);
- setImageDescriptor(RichTextImages.IMG_DESC_COPY);
- setDisabledImageDescriptor(RichTextImages.DISABLED_IMG_DESC_COPY);
- setToolTipText(RichTextResources.copyAction_toolTipText);
- }
-
- /**
- * Returns <code>true</code> if this action should be disabled when the
- * rich text editor is in readonly mode.
- */
- public boolean disableInReadOnlyMode() {
- return false;
- }
-
- /**
- * Returns <code>true</code> if this action should be disabled when the
- * rich text editor is in source edit mode.
- */
- public boolean disableInSourceMode() {
- return false;
- }
-
- /**
- * Executes the action.
- *
- * @param richText
- * a rich text control
- */
- public void execute(IRichText richText) {
- if (richText != null) {
- if (richText instanceof RichTextEditor
- && ((RichTextEditor) richText).isHTMLTabSelected()) {
- StyledText styledText = ((RichTextEditor) richText).getSourceEdit();
- styledText.copy();
- } else {
- richText.setCopyURL();
- richText.executeCommand(RichTextCommand.COPY);
- }
- }
- }
-
-}
diff --git a/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/actions/CutAction.java b/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/actions/CutAction.java
deleted file mode 100644
index 4e03e253654..00000000000
--- a/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/actions/CutAction.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-//------------------------------------------------------------------------------
-// Copyright (c) 2005, 2006 IBM Corporation 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:
-// IBM Corporation - initial implementation
-//------------------------------------------------------------------------------
-package org.eclipse.epf.richtext.actions;
-
-import org.eclipse.epf.richtext.IRichText;
-import org.eclipse.epf.richtext.RichTextCommand;
-import org.eclipse.epf.richtext.RichTextEditor;
-import org.eclipse.epf.richtext.RichTextImages;
-import org.eclipse.epf.richtext.RichTextResources;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.swt.custom.StyledText;
-
-/**
- * Cuts the selected text in the rich text control to the clipboard.
- *
- * @author Kelvin Low
- * @since 1.0
- */
-public class CutAction extends RichTextAction {
-
- /**
- * Creates a new instance.
- */
- public CutAction(IRichText richText) {
- super(richText, IAction.AS_PUSH_BUTTON);
- setImageDescriptor(RichTextImages.IMG_DESC_CUT);
- setDisabledImageDescriptor(RichTextImages.DISABLED_IMG_DESC_CUT);
- setToolTipText(RichTextResources.cutAction_toolTipText);
- }
-
- /**
- * Returns <code>true</code> if this action should be disabled when the
- * rich text editor is in source edit mode.
- */
- public boolean disableInSourceMode() {
- return false;
- }
-
- /**
- * Executes the action.
- *
- * @param richText
- * a rich text control
- */
- public void execute(IRichText richText) {
- if (richText != null) {
- if (richText instanceof RichTextEditor
- && ((RichTextEditor) richText).isHTMLTabSelected()) {
- StyledText styledText = ((RichTextEditor) richText)
- .getSourceEdit();
- styledText.cut();
- } else {
- richText.setCopyURL();
- richText.executeCommand(RichTextCommand.CUT);
- }
- }
- }
-}
diff --git a/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/actions/FindReplaceAction.java b/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/actions/FindReplaceAction.java
deleted file mode 100644
index 267d7b97465..00000000000
--- a/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/actions/FindReplaceAction.java
+++ /dev/null
@@ -1,388 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-//------------------------------------------------------------------------------
-// Copyright (c) 2005, 2006 IBM Corporation 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:
-// IBM Corporation - initial implementation
-//------------------------------------------------------------------------------
-package org.eclipse.epf.richtext.actions;
-
-import org.eclipse.epf.common.utils.XMLUtil;
-import org.eclipse.epf.richtext.IRichText;
-import org.eclipse.epf.richtext.RichTextCommand;
-import org.eclipse.epf.richtext.RichTextEditor;
-import org.eclipse.epf.richtext.RichTextImages;
-import org.eclipse.epf.richtext.RichTextPlugin;
-import org.eclipse.epf.richtext.RichTextResources;
-import org.eclipse.epf.richtext.dialogs.FindReplaceDialog;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.swt.custom.StyledText;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.widgets.Display;
-
-/**
- * Finds and replaces text in a rich text control.
- *
- * @author Kelvin Low
- * @since 1.0
- */
-public class FindReplaceAction extends RichTextAction {
-
- /**
- * Finds text sub action.
- */
- public static final int FIND_TEXT = 1;
-
- /**
- * Replaces text sub action.
- */
- public static final int REPLACE_TEXT = 2;
-
- /**
- * Replaces and finds text sub action.
- */
- public static final int REPLACE_FIND_TEXT = 3;
-
- /**
- * Replaces all sub action.
- */
- public static final int REPLACE_ALL_TEXT = 4;
-
- /**
- * Find match in a forward direction.
- */
- public static final int FORWARD_MATCH = 1;
-
- /**
- * Find match in a backward direction.
- */
- public static final int BACKWARD_MATCH = -1;
-
- /**
- * Whole word match.
- */
- public static final int WHOLE_WORD_MATCH = 2;
-
- /**
- * Case sensitive match.
- */
- public static final int CASE_SENSITIVE_MATCH = 4;
-
- // Encoded single quote.
- protected static final String ENCODED_SINGLE_QUOTE = "%sq%"; //$NON-NLS-1$
-
- protected IRichText richText;
-
- protected StyledText styledText;
-
- protected boolean foundMatch = false;
-
- // the dialog instance
- protected FindReplaceDialog dialog;
-
- /**
- * Creates a new instance.
- */
- public FindReplaceAction(IRichText richText) {
- super(richText, IAction.AS_PUSH_BUTTON);
- setImageDescriptor(RichTextImages.IMG_DESC_FIND_REPLACE);
- setDisabledImageDescriptor(RichTextImages.DISABLED_IMG_DESC_FIND_REPLACE);
- setToolTipText(RichTextResources.findReplaceAction_toolTipText);
- }
-
- /**
- * Returns <code>true</code> if this action should be disabled when the
- * rich text editor is in readonly mode.
- */
- public boolean disableInReadOnlyMode() {
- return false;
- }
-
- /**
- * Returns <code>true</code> if this action should be disabled when the
- * rich text editor is in source edit mode.
- */
- public boolean disableInSourceMode() {
- return false;
- }
-
- /**
- * Executes the action.
- *
- * @param richText
- * a rich text control
- */
- public void execute(IRichText richText) {
- if (this.richText == null)
- this.richText = richText;
- if (this.richText != null) {
- try {
- if (dialog != null) {
- dialog.setFindOnly(!this.richText.getEditable());
- dialog.open();
- } else {
- dialog = new FindReplaceDialog(Display
- .getCurrent().getActiveShell(), this, !this.richText
- .getEditable());
- dialog.open();
- }
- } catch (Exception e) {
- RichTextPlugin.getDefault().getLogger().logError(e);
- }
- }
- }
-
- /**
- * Returns <code>true</code> if a match is found.
- *
- * @return <code>true</code> if a match is found.
- */
- public boolean getFoundMatch() {
- return foundMatch;
- }
-
- /**
- * Executes the action.
- *
- * @param subAction
- * the sub action to execute
- * @param findText
- * the find text
- * @param replaceText
- * the replace text
- * @param matchDir
- * the match direction; the value can either be
- * <code>FIND_FORWARD</code> or <code>FIND_BACKWARD</code>.
- * @param matchOptions
- * the match options
- */
- public void run(int subAction, String findText, String replaceText,
- int matchDir, int matchOptions) {
- styledText = null;
- if (richText instanceof RichTextEditor
- && ((RichTextEditor) richText).isHTMLTabSelected()) {
- styledText = ((RichTextEditor) richText).getSourceEdit();
- }
- if (styledText == null) {
- if (findText.indexOf("'") != -1) { //$NON-NLS-1$
- findText = findText.replaceAll("'", ENCODED_SINGLE_QUOTE); //$NON-NLS-1$
- }
- if (replaceText.indexOf("'") != -1) { //$NON-NLS-1$
- replaceText = replaceText.replaceAll("'", ENCODED_SINGLE_QUOTE); //$NON-NLS-1$
- }
- }
- try {
- foundMatch = false;
- int status = 0;
- switch (subAction) {
- case FIND_TEXT:
- status = findText(findText, matchDir, matchOptions);
- break;
- case REPLACE_TEXT:
- status = replaceText(replaceText, matchDir, matchOptions);
- break;
- case REPLACE_FIND_TEXT:
- status = replaceFindText(findText, replaceText, matchDir,
- matchOptions);
- break;
- case REPLACE_ALL_TEXT:
- replaceAll(findText, replaceText, matchOptions);
- break;
- }
- if (status > 0)
- foundMatch = true;
- } catch (Exception e) {
- RichTextPlugin.getDefault().getLogger().logError(e);
- }
- }
-
- /**
- * Escapes the given text.
- *
- * @param text
- * text to be escaped
- */
- protected static String escape(String text) {
- if (text == null || text.length() == 0)
- return ""; //$NON-NLS-1$
- StringBuffer sb = new StringBuffer();
- int textSize = text.length();
- for (int i = 0; i < textSize; i++) {
- char ch = text.charAt(i);
- switch (ch) {
- case '<':
- sb.append(XMLUtil.XML_LT);
- break;
- case '>':
- sb.append(XMLUtil.XML_GT);
- break;
- case '&':
- sb.append(XMLUtil.XML_AMP);
- break;
- default:
- sb.append(ch);
- break;
- }
- }
- return sb.toString();
- }
-
- protected int findText(String findText, int matchDir, int matchOptions) {
- int status = 0;
- if (styledText != null) {
- status = styledTextFindTextAndSelect(findText, matchDir,
- matchOptions);
- } else {
- status = richText
- .executeCommand(RichTextCommand.FIND_TEXT, new String[] {
- findText, "" + matchDir, "" + matchOptions }); //$NON-NLS-1$ //$NON-NLS-2$
- }
- return status;
- }
-
- protected int replaceText(String replaceText, int matchDir, int matchOptions) {
- int status = 0;
- if (styledText != null) {
- status = styledTextReplaceTextAndSelect(replaceText);
- } else {
- status = richText.executeCommand(RichTextCommand.REPLACE_TEXT,
- new String[] { replaceText,
- "" + matchDir, "" + matchOptions }); //$NON-NLS-1$ //$NON-NLS-2$
- }
- return status;
- }
-
- protected int replaceFindText(String findText, String replaceText,
- int matchDir, int matchOptions) {
- int status = 0;
- if (styledText != null) {
- styledTextReplaceTextAndSelect(replaceText);
- status = styledTextFindTextAndSelect(findText, matchDir,
- matchOptions);
- } else {
- richText.executeCommand(RichTextCommand.REPLACE_TEXT, new String[] {
- replaceText, "" + matchDir, "" + matchOptions }); //$NON-NLS-1$ //$NON-NLS-2$
- status = richText
- .executeCommand(RichTextCommand.FIND_TEXT, new String[] {
- findText, "" + matchDir, "" + matchOptions }); //$NON-NLS-1$ //$NON-NLS-2$
- }
- return status;
- }
-
- protected void replaceAll(String findText, String replaceText,
- int matchOptions) {
- if (styledText != null) {
- styledTextReplaceAll(findText, replaceText, matchOptions);
- } else {
- richText.executeCommand(RichTextCommand.REPLACE_ALL_TEXT,
- new String[] { escape(findText), escape(replaceText),
- "" + matchOptions }); //$NON-NLS-1$
- }
- }
-
- protected int styledTextFindTextAndSelect(String findText, int matchDir,
- int matchOptions) {
- Point selectionOffset = styledText.getSelectionRange();
- int firstSelectedOffset = selectionOffset.x;
- int lastSelectedOffset = selectionOffset.x + selectionOffset.y - 1;
- String htmlText = styledText.getText();
- int indexOfMatch = -1;
- if ((matchOptions & CASE_SENSITIVE_MATCH) == 0) {
- // TODO: use toUpperCase(Locale) once library has locale attribute
- htmlText = htmlText.toUpperCase();
- findText = findText.toUpperCase();
- }
- do {
- if (indexOfMatch != -1) {
- lastSelectedOffset = indexOfMatch + 1;
- firstSelectedOffset = indexOfMatch - 1;
- }
- if (matchDir == FORWARD_MATCH) {
- indexOfMatch = htmlText.indexOf(findText,
- lastSelectedOffset + 1);
- } else {
- indexOfMatch = htmlText.lastIndexOf(findText,
- firstSelectedOffset - 1);
- }
- } while (indexOfMatch != -1
- && ((matchOptions & WHOLE_WORD_MATCH) == WHOLE_WORD_MATCH)
- && isPartOfWord(htmlText, indexOfMatch, findText.length()));
- if (indexOfMatch != -1) {
- styledText.setSelectionRange(indexOfMatch, findText.length());
- styledText.showSelection();
- } else {
- String selectedText = styledText.getSelectionText();
- if ((matchOptions & CASE_SENSITIVE_MATCH) == 0) {
- selectedText = selectedText.toUpperCase();
- }
- if (selectedText.equals(findText)) {
- indexOfMatch = styledText.getSelectionRange().x;
- }
- }
- return indexOfMatch;
-
- }
-
- protected int styledTextReplaceTextAndSelect(String replaceText) {
- Point selectionOffset = styledText.getSelectionRange();
- styledText.replaceTextRange(selectionOffset.x, selectionOffset.y,
- replaceText);
- styledText.setSelectionRange(selectionOffset.x, replaceText.length());
-
- return 1;
- }
-
- protected void styledTextReplaceAll(String findText, String replaceText,
- int matchOptions) {
- styledText.setSelectionRange(0, 0);
- while (styledTextFindTextAndSelect(findText, FORWARD_MATCH,
- matchOptions) != -1) {
- styledTextReplaceTextAndSelect(replaceText);
- }
- }
-
- protected boolean isWordChar(char c) {
- if (Character.isLetterOrDigit(c))
- return true;
- return false;
- }
-
- protected boolean isPartOfWord(String text, int index, int length) {
- if (index > 0)
- if (isWordChar(text.charAt(index - 1)))
- return true;
- if (text.length() >= index + length)
- if (isWordChar(text.charAt(index + length)))
- return true;
- return false;
- }
-
- public IRichText getRichText() {
- return richText;
- }
-
- public void setRichText(IRichText richText) {
- this.richText = richText;
- }
-
- public void dispose() {
- if (dialog != null) {
- dialog.close();
- dialog = null;
- }
- }
-
-}
diff --git a/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/actions/FontNameAction.java b/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/actions/FontNameAction.java
deleted file mode 100644
index 94de2201f6a..00000000000
--- a/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/actions/FontNameAction.java
+++ /dev/null
@@ -1,121 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-//------------------------------------------------------------------------------
-// Copyright (c) 2005, 2007 IBM Corporation 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:
-// IBM Corporation - initial implementation
-//------------------------------------------------------------------------------
-package org.eclipse.epf.richtext.actions;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.SortedSet;
-import java.util.TreeSet;
-
-import org.eclipse.epf.richtext.IRichText;
-import org.eclipse.epf.richtext.RichTextCommand;
-import org.eclipse.epf.richtext.RichTextResources;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.FontData;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Listener;
-
-/**
- * Sets the font name for the selected text in a rich text control.
- *
- * @author Kelvin Low
- * @author Jeff Hardy
- * @since 1.0
- */
-public class FontNameAction extends RichTextComboAction {
-
- /**
- * Creates a new instance.
- */
- public FontNameAction(final IRichText richText) {
- super(richText);
- setToolTipText(RichTextResources.fontNameAction_toolTipText);
- // get system fonts
- SortedSet<String> fontSet = new TreeSet<String>();
- FontData[] fonts = Display.getCurrent().getFontList(null, true);
- for (int i = 0; i < fonts.length; i++) {
- fontSet.add(((FontData) fonts[i]).getName());
- }
- input = new ArrayList<String>();
- input.add(RichTextResources.fontNameAction_DefaultFontName);
- for (Iterator<String> iter = fontSet.iterator(); iter.hasNext();) {
- String fontName = iter.next();
- input.add(fontName);
- }
-
- // add listener
- richText.addListener(SWT.SELECTED, new Listener() {
- public void handleEvent(Event event) {
- String fontName = richText.getSelected().getFontName();
- if (fontName
- .equals(RichTextResources.fontNameAction_CSS_Default)
- || fontName
- .equals(RichTextResources.fontNameAction_CSS_Default_Mozilla)
- || fontName.equals("default")) { //$NON-NLS-1$
- fontName = RichTextResources.fontNameAction_DefaultFontName;
- }
- int index = findFontNameInItems(fontName);
- setNotifyListeners(false);
- getCCombo().select(index);
- setNotifyListeners(true);
- }
- });
- }
-
- private int findFontNameInItems(String fontName) {
- int index = -1;
- for (Iterator<String> iter = input.iterator(); iter.hasNext();) {
- String font = iter.next();
- index++;
- if (font.equalsIgnoreCase(fontName)) {
- return index;
- }
- }
- return -1;
- }
-
- /**
- * Executes the action.
- *
- * @param richText
- * a rich text control
- * @param index
- * the index of the selected item
- */
- public void execute(IRichText richText) {
- if (richText != null) {
- String selected = getCComboSelection();
- if (selected.equals(RichTextResources.fontNameAction_DefaultFontName)) {
- richText.executeCommand(RichTextCommand.SET_FONT_NAME, ""); //$NON-NLS-1$
- } else {
- richText.executeCommand(RichTextCommand.SET_FONT_NAME, selected);
- }
- }
- }
-
- @Override
- public Collection<String> getInput() {
- return input;
- }
-
-} \ No newline at end of file
diff --git a/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/actions/FontSizeAction.java b/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/actions/FontSizeAction.java
deleted file mode 100644
index f0629c017f4..00000000000
--- a/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/actions/FontSizeAction.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-//------------------------------------------------------------------------------
-// Copyright (c) 2005, 2007 IBM Corporation 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:
-// IBM Corporation - initial implementation
-//------------------------------------------------------------------------------
-package org.eclipse.epf.richtext.actions;
-
-import java.util.ArrayList;
-import java.util.Collection;
-
-import org.eclipse.epf.richtext.IRichText;
-import org.eclipse.epf.richtext.RichTextCommand;
-import org.eclipse.epf.richtext.RichTextResources;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Listener;
-
-/**
- * Sets the font size for the selected text in a rich text control.
- *
- * @author Kelvin Low
- * @author Jeff Hardy
- * @since 1.0
- */
-public class FontSizeAction extends RichTextComboAction {
-
- /**
- * Creates a new instance.
- */
- public FontSizeAction(final IRichText richText) {
- super(richText);
- setToolTipText(RichTextResources.fontSizeAction_toolTipText);
- input = new ArrayList<String>();
-
- input.add("Default"); //$NON-NLS-1$
- input.add("1"); //$NON-NLS-1$
- input.add("2"); //$NON-NLS-1$
- input.add("3"); //$NON-NLS-1$
- input.add("4"); //$NON-NLS-1$
- input.add("5"); //$NON-NLS-1$
- input.add("6"); //$NON-NLS-1$
- input.add("7"); //$NON-NLS-1$
- // add listener
- richText.addListener(SWT.SELECTED, new Listener() {
- public void handleEvent(Event event) {
- // mozilla returns "default" if no size is applied
- // IE returns 2 if no size is applied
- String fontSize = richText.getSelected().getFontSize();
- int index = -1;
- if (fontSize.equals("default")) { //$NON-NLS-1$
- index = 0;
- } else {
- try {
- index = Integer.parseInt(fontSize);
- } catch (NumberFormatException e) {
- // leave index at -1 so nothing is selected
- }
- }
- setNotifyListeners(false);
- getCCombo().select(index);
- setNotifyListeners(true);
- }
- });
- }
-
- /**
- * Executes the action.
- *
- * @param richText
- * a rich text control
- * @param index
- * the index of the selected item
- */
- public void execute(IRichText richText) {
- if (richText != null) {
- String selected = getCComboSelection();
- if ("Default".equals(selected)) { //$NON-NLS-1$
- richText.executeCommand(RichTextCommand.SET_FONT_SIZE, ""); //$NON-NLS-1$
- } else {
- richText.executeCommand(RichTextCommand.SET_FONT_SIZE,
- selected);
- }
- }
- }
-
- @Override
- public Collection<String> getInput() {
- return input;
- }
-
-} \ No newline at end of file
diff --git a/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/actions/FontStyleAction.java b/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/actions/FontStyleAction.java
deleted file mode 100644
index b0ed90fdc55..00000000000
--- a/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/actions/FontStyleAction.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-//------------------------------------------------------------------------------
-// Copyright (c) 2005, 2007 IBM Corporation 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:
-// IBM Corporation - initial implementation
-//------------------------------------------------------------------------------
-package org.eclipse.epf.richtext.actions;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-
-import org.eclipse.epf.richtext.IRichText;
-import org.eclipse.epf.richtext.RichTextCommand;
-import org.eclipse.epf.richtext.RichTextResources;
-import org.eclipse.epf.richtext.html.FontStyle;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Listener;
-
-/**
- * Sets the font style for the selected text in a rich text control.
- *
- * @author Kelvin Low
- * @author Jeff Hardy
- * @since 1.0
- */
-public class FontStyleAction extends RichTextComboAction {
-
- /**
- * Creates a new instance.
- */
- public FontStyleAction(final IRichText richText) {
- super(richText);
- setToolTipText(RichTextResources.fontStyleAction_toolTipText);
-
- input = new ArrayList<String>();
- input.add(FontStyle.NORMAL.getName());
- input.add(FontStyle.SECTION_HEADING.getName());
- input.add(FontStyle.SUBSECTION_HEADING.getName());
- input.add(FontStyle.SUB_SUBSECTION_HEADING.getName());
- input.add(FontStyle.QUOTE.getName());
- input.add(FontStyle.CODE_SAMPLE.getName());
- // add listener
- richText.addListener(SWT.SELECTED, new Listener() {
- public void handleEvent(Event event) {
- String blockStyle = richText.getSelected().getBlockStyle();
- String name = FontStyle.getFontStyleName(blockStyle);
-
- int index = ((List<String>)input).indexOf(name);
- setNotifyListeners(false);
- getCCombo().select(index);
- setNotifyListeners(true);
- }
- });
- }
-
- /**
- * Executes the action.
- *
- * @param richText
- * a rich text control
- * @param index
- * the index of the selected item
- */
- public void execute(IRichText richText) {
- if (richText != null) {
- String selected = getCComboSelection();
- String value = FontStyle.getFontStyleValue(selected);
- richText.executeCommand(RichTextCommand.SET_FONT_STYLE, value);
- }
- }
-
- @Override
- public Collection<String> getInput() {
- return input;
- }
-
-
-} \ No newline at end of file
diff --git a/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/actions/IBaseRichTextAction.java b/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/actions/IBaseRichTextAction.java
deleted file mode 100644
index 0566ceef0d7..00000000000
--- a/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/actions/IBaseRichTextAction.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-//------------------------------------------------------------------------------
-// Copyright (c) 2005, 2006 IBM Corporation 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:
-// IBM Corporation - initial implementation
-//------------------------------------------------------------------------------
-package org.eclipse.epf.richtext.actions;
-
-/**
- * The base interface for a rich text action.
- *
- * @author Kelvin Low
- * @since 1.0
- */
-public interface IBaseRichTextAction {
-
- /**
- * Returns the tool tip for the action.
- *
- * @return the tool tip text
- */
- public String getToolTipText();
-
- /**
- * Sets the tool tip for the action.
- *
- * @param toolTipText
- * the tool tip text
- */
- public void setToolTipText(String toolTipText);
-
- /**
- * Returns the enabled status of the action.
- *
- * @return <code>true</code> if enabled, <code>false</code> if not
- */
- public boolean getEnabled();
-
- /**
- * Enables or disables the action.
- *
- * @param enabled
- * If <code>true</code>, enable the action. if
- * <code>false</code>, disable it
- */
- public void setEnabled(boolean enabled);
-
-}
diff --git a/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/actions/IRichTextAction.java b/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/actions/IRichTextAction.java
deleted file mode 100644
index 572a2b640a0..00000000000
--- a/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/actions/IRichTextAction.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-//------------------------------------------------------------------------------
-// Copyright (c) 2005, 2007 IBM Corporation 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:
-// IBM Corporation - initial implementation
-//------------------------------------------------------------------------------
-package org.eclipse.epf.richtext.actions;
-
-import org.eclipse.epf.richtext.IRichText;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.ToolItem;
-
-/**
- * The interface for a rich text button action.
- *
- * @author Kelvin Low
- * @author Jeff Hardy
- * @since 1.0
- */
-public interface IRichTextAction extends IBaseRichTextAction {
-
- /**
- * Returns the image for the action.
- *
- * @return the image for the action
- */
- public Image getImage();
-
- /**
- * Sets the image for the action.
- *
- * @param image
- * the image for the action
- */
- public void setImage(Image image);
-
- /**
- * Returns the disabled image for the action.
- *
- * @return the disabled image for the action
- */
- public Image getDisabledImage();
-
- /**
- * Sets the disabled image for the action.
- *
- * @param image
- * the disabled image for the action
- */
- public void setDisabledImage(Image image);
-
- /**
- * Returns <code>true</code> if this action should be disabled when the
- * rich text editor is in readonly mode.
- */
- public boolean disableInReadOnlyMode();
-
- /**
- * Returns <code>true</code> if this action should be disabled when the
- * rich text editor is in source edit mode.
- */
- public boolean disableInSourceMode();
-
- /**
- * Executes the action.
- *
- * @param richText
- * a rich text control
- */
- public void execute(IRichText richText);
-
- /**
- * Sets the action's ToolItem
- * @param toolItem
- */
- public void setToolItem(ToolItem toolItem);
-
- /**
- * Gets the SWT ToolItem Style to be used for this action
- */
- public int getStyle();
-
-}
diff --git a/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/actions/IRichTextComboAction.java b/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/actions/IRichTextComboAction.java
deleted file mode 100644
index baeaf167cc7..00000000000
--- a/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/actions/IRichTextComboAction.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-//------------------------------------------------------------------------------
-// Copyright (c) 2005, 2007 IBM Corporation 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:
-// IBM Corporation - initial implementation
-//------------------------------------------------------------------------------
-package org.eclipse.epf.richtext.actions;
-
-import org.eclipse.epf.common.ui.actions.CComboContributionItem;
-import org.eclipse.epf.richtext.IRichText;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-
-/**
- * The interface for a rich text combo action.
- *
- * @author Kelvin Low
- * @author Jeff Hardy
- * @since 1.0
- *
- * @deprecated unused
- */
-public interface IRichTextComboAction extends IBaseRichTextAction {
-
-// /**
-// * Adds an item.
-// *
-// * @param item
-// * the item to be added
-// */
-// public void addItem(String item);
-//
-// /**
-// * Returns all items.
-// *
-// * @return an array of items
-// */
-// public String[] getItems();
-
- /**
- * Executes the action.
- *
- * @param richText
- * a rich text control
- * @param index
- * the index of the selected item
- */
- public void execute(IRichText richText, int index);
-
- public IStructuredContentProvider getContentProvider();
-
- public ILabelProvider getLabelProvider();
-
- public Object getInput();
-
- /**
- * Sets the action's ContributionItem
- *
- */
- public void setContributionItem(CComboContributionItem item);
-
-}
diff --git a/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/actions/IndentAction.java b/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/actions/IndentAction.java
deleted file mode 100644
index 7bd985a7b13..00000000000
--- a/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/actions/IndentAction.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-//------------------------------------------------------------------------------
-// Copyright (c) 2005, 2006 IBM Corporation 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:
-// IBM Corporation - initial implementation
-//------------------------------------------------------------------------------
-package org.eclipse.epf.richtext.actions;
-
-import org.eclipse.epf.richtext.IRichText;
-import org.eclipse.epf.richtext.RichTextCommand;
-import org.eclipse.epf.richtext.RichTextImages;
-import org.eclipse.epf.richtext.RichTextResources;
-import org.eclipse.jface.action.IAction;
-
-/**
- * Indents the selected text in a rich text control.
- *
- * @author Kelvin Low
- * @since 1.0
- */
-public class IndentAction extends RichTextAction {
-
- /**
- * Creates a new instance.
- */
- public IndentAction(IRichText richText) {
- super(richText, IAction.AS_PUSH_BUTTON);
- setImageDescriptor(RichTextImages.IMG_DESC_INDENT);
- setDisabledImageDescriptor(RichTextImages.DISABLED_IMG_DESC_INDENT);
- setToolTipText(RichTextResources.indentAction_toolTipText);
- }
-
- /**
- * Executes the action.
- *
- * @param richText
- * a rich text control
- */
- public void execute(IRichText richText) {
- if (richText != null) {
- richText.executeCommand(RichTextCommand.INDENT);
- }
- }
-
-}
diff --git a/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/actions/ItalicAction.java b/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/actions/ItalicAction.java
deleted file mode 100644
index aae6fc1fe6d..00000000000
--- a/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/actions/ItalicAction.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-//------------------------------------------------------------------------------
-// Copyright (c) 2005, 2007 IBM Corporation 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:
-// IBM Corporation - initial implementation
-//------------------------------------------------------------------------------
-package org.eclipse.epf.richtext.actions;
-
-import org.eclipse.epf.richtext.IRichText;
-import org.eclipse.epf.richtext.RichTextCommand;
-import org.eclipse.epf.richtext.RichTextImages;
-import org.eclipse.epf.richtext.RichTextResources;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Listener;
-
-/**
- * Toggles the 'italic' attribute of the selected text in a rich text control.
- *
- * @author Kelvin Low
- * @author Jeff Hardy
- * @since 1.0
- */
-public class ItalicAction extends RichTextAction {
-
- /**
- * Creates a new instance.
- */
- public ItalicAction(final IRichText richText) {
- super(richText, IAction.AS_CHECK_BOX);
- setImageDescriptor(RichTextImages.IMG_DESC_ITALIC);
- setToolTipText(RichTextResources.italicAction_toolTipText);
- // add listener
- richText.addListener(SWT.SELECTED, new Listener() {
- public void handleEvent(Event event) {
- setChecked(richText.getSelected().isItalic());
- }
- });
- }
-
- /**
- * Executes the action.
- *
- * @param richText
- * a rich text control
- */
- public void execute(IRichText richText) {
- if (richText != null) {
- richText.executeCommand(RichTextCommand.ITALIC);
- }
- }
-}
diff --git a/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/actions/JustifyCenterAction.java b/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/actions/JustifyCenterAction.java
deleted file mode 100644
index 74b6b86fbe6..00000000000
--- a/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/actions/JustifyCenterAction.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-//------------------------------------------------------------------------------
-// Copyright (c) 2005, 2006 IBM Corporation 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:
-// IBM Corporation - initial implementation
-//------------------------------------------------------------------------------
-package org.eclipse.epf.richtext.actions;
-
-import org.eclipse.epf.richtext.IRichText;
-import org.eclipse.epf.richtext.RichTextCommand;
-import org.eclipse.epf.richtext.RichTextImages;
-import org.eclipse.epf.richtext.RichTextResources;
-import org.eclipse.jface.action.IAction;
-
-/**
- * Center justifies the selected text in a rich text control.
- *
- * @author Kelvin Low
- * @since 1.0
- */
-public class JustifyCenterAction extends RichTextAction {
-
- /**
- * Creates a new instance.
- */
- public JustifyCenterAction(IRichText richText) {
- super(richText, IAction.AS_PUSH_BUTTON);
- setImageDescriptor(RichTextImages.IMG_DESC_JUSTIFY_CENTER);
- setToolTipText(RichTextResources.justifyCenterAction_toolTipText);
- }
-
- /**
- * Executes the action.
- *
- * @param richText
- * a rich text control
- */
- public void execute(IRichText richText) {
- if (richText != null) {
- richText.executeCommand(RichTextCommand.JUSTIFY_CENTER);
- }
- }
-
-}
diff --git a/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/actions/JustifyFullAction.java b/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/actions/JustifyFullAction.java
deleted file mode 100644
index ca1a4e06d4f..00000000000
--- a/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/actions/JustifyFullAction.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-//------------------------------------------------------------------------------
-// Copyright (c) 2005, 2006 IBM Corporation 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:
-// IBM Corporation - initial implementation
-//------------------------------------------------------------------------------
-package org.eclipse.epf.richtext.actions;
-
-import org.eclipse.epf.richtext.IRichText;
-import org.eclipse.epf.richtext.RichTextCommand;
-import org.eclipse.epf.richtext.RichTextImages;
-import org.eclipse.epf.richtext.RichTextResources;
-import org.eclipse.jface.action.IAction;
-
-/**
- * Fully justifies the selected text in a rich text control.
- *
- * @author Kelvin Low
- * @since 1.0
- */
-public class JustifyFullAction extends RichTextAction {
-
- /**
- * Creates a new instance.
- */
- public JustifyFullAction(IRichText richText) {
- super(richText, IAction.AS_PUSH_BUTTON);
- setImageDescriptor(RichTextImages.IMG_DESC_JUSTIFY_FULL);
- setToolTipText(RichTextResources.justifyFullAction_toolTipText);
- }
-
- /**
- * Executes the action.
- *
- * @param richText
- * a rich text control
- */
- public void execute(IRichText richText) {
- if (richText != null) {
- richText.executeCommand(RichTextCommand.JUSTIFY_FULL);
- }
- }
-
-}
diff --git a/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/actions/JustifyLeftAction.java b/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/actions/JustifyLeftAction.java
deleted file mode 100644
index 7da611fa759..00000000000
--- a/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/actions/JustifyLeftAction.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-//------------------------------------------------------------------------------
-// Copyright (c) 2005, 2006 IBM Corporation 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:
-// IBM Corporation - initial implementation
-//------------------------------------------------------------------------------
-package org.eclipse.epf.richtext.actions;
-
-import org.eclipse.epf.richtext.IRichText;
-import org.eclipse.epf.richtext.RichTextCommand;
-import org.eclipse.epf.richtext.RichTextImages;
-import org.eclipse.epf.richtext.RichTextResources;
-import org.eclipse.jface.action.IAction;
-
-/**
- * Left justifies the selected text in a rich text control.
- *
- * @author Kelvin Low
- * @since 1.0
- */
-public class JustifyLeftAction extends RichTextAction {
-
- /**
- * Creates a new instance.
- */
- public JustifyLeftAction(IRichText richText) {
- super(richText, IAction.AS_PUSH_BUTTON);
- setImageDescriptor(RichTextImages.IMG_DESC_JUSTIFY_LEFT);
- setToolTipText(RichTextResources.justifyLeftAction_toolTipText);
- }
-
- /**
- * Executes the action.
- *
- * @param richText
- * a rich text control
- */
- public void execute(IRichText richText) {
- if (richText != null) {
- richText.executeCommand(RichTextCommand.JUSTIFY_LEFT);
- }
- }
-
-}
diff --git a/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/actions/JustifyRightAction.java b/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/actions/JustifyRightAction.java
deleted file mode 100644
index e53aba5e31e..00000000000
--- a/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/actions/JustifyRightAction.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-//------------------------------------------------------------------------------
-// Copyright (c) 2005, 2006 IBM Corporation 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:
-// IBM Corporation - initial implementation
-//------------------------------------------------------------------------------
-package org.eclipse.epf.richtext.actions;
-
-import org.eclipse.epf.richtext.IRichText;
-import org.eclipse.epf.richtext.RichTextCommand;
-import org.eclipse.epf.richtext.RichTextImages;
-import org.eclipse.epf.richtext.RichTextResources;
-import org.eclipse.jface.action.IAction;
-
-/**
- * Right justifies the selected text in a rich text control.
- *
- * @author Kelvin Low
- * @since 1.0
- */
-public class JustifyRightAction extends RichTextAction {
-
- /**
- * Creates a new instance.
- */
- public JustifyRightAction(IRichText richText) {
- super(richText, IAction.AS_PUSH_BUTTON);
- setImageDescriptor(RichTextImages.IMG_DESC_JUSTIFY_RIGHT);
- setToolTipText(RichTextResources.justifyRightAction_toolTipText);
- }
-
- /**
- * Executes the action.
- *
- * @param richText
- * a rich text control
- */
- public void execute(IRichText richText) {
- if (richText != null) {
- richText.executeCommand(RichTextCommand.JUSTIFY_RIGHT);
- }
- }
-
-}
diff --git a/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/actions/OutdentAction.java b/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/actions/OutdentAction.java
deleted file mode 100644
index a2c642a06c4..00000000000
--- a/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/actions/OutdentAction.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-//------------------------------------------------------------------------------
-// Copyright (c) 2005, 2006 IBM Corporation 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:
-// IBM Corporation - initial implementation
-//------------------------------------------------------------------------------
-package org.eclipse.epf.richtext.actions;
-
-import org.eclipse.epf.richtext.IRichText;
-import org.eclipse.epf.richtext.RichTextCommand;
-import org.eclipse.epf.richtext.RichTextImages;
-import org.eclipse.epf.richtext.RichTextResources;
-import org.eclipse.jface.action.IAction;
-
-/**
- * Indents the selected text in a rich text control.
- *
- * @author Kelvin Low
- * @since 1.0
- */
-public class OutdentAction extends RichTextAction {
-
- /**
- * Creates a new instance.
- */
- public OutdentAction(IRichText richText) {
- super(richText, IAction.AS_PUSH_BUTTON);
- setImageDescriptor(RichTextImages.IMG_DESC_OUTDENT);
- setDisabledImageDescriptor(RichTextImages.DISABLED_IMG_DESC_OUTDENT);
- setToolTipText(RichTextResources.outdentAction_toolTipText);
- }
-
- /**
- * Executes the action.
- *
- * @param richText
- * a rich text control
- */
- public void execute(IRichText richText) {
- if (richText != null) {
- richText.executeCommand(RichTextCommand.OUTDENT);
- }
- }
-
-}
diff --git a/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/actions/PasteAction.java b/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/actions/PasteAction.java
deleted file mode 100644
index 7affed86025..00000000000
--- a/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/actions/PasteAction.java
+++ /dev/null
@@ -1,247 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-//------------------------------------------------------------------------------
-// Copyright (c) 2005, 2007 IBM Corporation 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:
-// IBM Corporation - initial implementation
-//------------------------------------------------------------------------------
-package org.eclipse.epf.richtext.actions;
-
-import java.io.File;
-import java.net.URL;
-import java.util.Stack;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-import org.eclipse.epf.common.serviceability.Logger;
-import org.eclipse.epf.common.ui.util.ClipboardUtil;
-import org.eclipse.epf.common.utils.FileUtil;
-import org.eclipse.epf.common.utils.NetUtil;
-import org.eclipse.epf.richtext.IRichText;
-import org.eclipse.epf.richtext.RichTextCommand;
-import org.eclipse.epf.richtext.RichTextEditor;
-import org.eclipse.epf.richtext.RichTextImages;
-import org.eclipse.epf.richtext.RichTextPlugin;
-import org.eclipse.epf.richtext.RichTextResources;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.swt.custom.StyledText;
-import org.eclipse.swt.dnd.Clipboard;
-import org.eclipse.swt.dnd.HTMLTransfer;
-import org.eclipse.swt.widgets.Display;
-
-/**
- * Pastes text from the clipboard onto a rich text control.
- *
- * @author Kelvin Low
- * @since 1.0
- */
-public class PasteAction extends RichTextAction {
-
- private static final String SOURCE_URL = "SourceURL:"; //$NON-NLS-1$
-
- private static final String HTM_EXT = ".htm"; //$NON-NLS-1$
-
- private static final String HTML_EXT = ".html"; //$NON-NLS-1$
-
- private static final Pattern HREF_REFERENCES = Pattern
- .compile(
- "href\\s*=\\s*\"(.*?)\"", Pattern.CASE_INSENSITIVE | Pattern.DOTALL); //$NON-NLS-1$
-
- protected static final Pattern p_image_ref = Pattern
- .compile(
- "(<(img|iframe).*?src\\s*=\\s*\")(.*?)(\")", Pattern.CASE_INSENSITIVE | Pattern.DOTALL); //$NON-NLS-1$
-
- protected static String sourceURLStr = ""; //$NON-NLS-1$
-
- private Logger logger;
-
- private static String RESOURCES = "resources"; //$NON-NLS-1$
-
- /**
- * Creates a new instance.
- */
- public PasteAction(IRichText richText) {
- super(richText, IAction.AS_PUSH_BUTTON);
- setImageDescriptor(RichTextImages.IMG_DESC_PASTE);
- setDisabledImageDescriptor(RichTextImages.DISABLED_IMG_DESC_PASTE);
- setToolTipText(RichTextResources.pasteAction_toolTipText);
- logger = RichTextPlugin.getDefault().getLogger();
- }
-
- /**
- * Returns <code>true</code> if this action should be disabled when the
- * rich text editor is in source edit mode.
- */
- public boolean disableInSourceMode() {
- return false;
- }
-
- /**
- * Executes the action.
- *
- * @param richText
- * a rich text control
- */
- public void execute(IRichText richText) {
- if (richText != null) {
- copyLinkResources(richText);
- if (richText instanceof RichTextEditor
- && ((RichTextEditor) richText).isHTMLTabSelected()) {
- StyledText styledText = ((RichTextEditor) richText)
- .getSourceEdit();
- styledText.paste();
- } else {
- richText.executeCommand(RichTextCommand.PASTE, sourceURLStr);
- }
- }
- }
-
- /**
- * Copies the link resources.
- *
- * @param richText
- * a rich text control
- */
- protected void copyLinkResources(IRichText richText) {
- try {
- sourceURLStr = ClipboardUtil.getHTMLSourceURL();
- Clipboard clipboard = new Clipboard(Display.getCurrent());
- String html = (String) clipboard.getContents(HTMLTransfer
- .getInstance());
- if (html != null && html.length() > 0) {
- String basePath = richText.getBasePath();
- URL sourceURL = null;
- if (sourceURLStr == null || sourceURLStr.length() == 0
- || sourceURLStr.equals("about:blank")) { //$NON-NLS-1$
- sourceURL = richText.getCopyURL();
- } else {
- sourceURL = new URL(sourceURLStr);
- }
-
- Matcher matcher = HREF_REFERENCES.matcher(html);
- while (matcher.find()) {
- String href = NetUtil.decodeURL(matcher.group(1));
- try {
- URL hrefURL = new URL(sourceURL, href);
- String scheme = hrefURL.getProtocol();
- if (scheme != null
- && scheme
- .equalsIgnoreCase(NetUtil.FILE_SCHEME)) {
- String url = hrefURL.getPath();
- File srcFile = new File(NetUtil.decodeURL(url));
- File tgtFile = null;
- File tgtDir = null;
- if (href.startsWith("#") || sourceURL.sameFile(hrefURL)) { //$NON-NLS-1$
- continue;
- } else if (href.startsWith(RESOURCES) || href.startsWith("./" + RESOURCES)) { //$NON-NLS-1$
- tgtFile = new File(basePath, href);
- tgtDir = tgtFile.getParentFile();
- } else {
- String resPath = getSubdirectoryOfResources(href);
- tgtFile = new File(basePath + RESOURCES, resPath);
- tgtDir = tgtFile;
- }
- tgtDir.mkdirs();
- FileUtil.copyFile(srcFile, tgtDir);
- }
- } catch (Exception e) {
- logger.logError(e);
- }
- }
-
- matcher = p_image_ref.matcher(html);
- while (matcher.find()) {
- String src = NetUtil.decodeURL(matcher.group(3));
- try {
- URL srcURL = new URL(sourceURL, src);
- String scheme = srcURL.getProtocol();
- if (scheme != null
- && scheme.equalsIgnoreCase(NetUtil.FILE_SCHEME)) {
- File srcFile = null;
- String authority = srcURL.getAuthority();
- if (authority != null) {
- srcFile = new File(NetUtil.decodeURL(authority + srcURL.getPath()));
- } else {
- srcFile = new File(NetUtil.decodeURL(srcURL.getPath()));
- }
- File tgtFile = null;
- File tgtDir = null;
- if (src.startsWith(RESOURCES) || src.startsWith("./" + RESOURCES)) { //$NON-NLS-1$
- tgtFile = new File(basePath, src);
- tgtDir = tgtFile.getParentFile();
- } else {
- String resPath = getSubdirectoryOfResources(src);
- tgtFile = new File(basePath + RESOURCES, resPath);
- tgtDir = tgtFile;
- }
- tgtDir.mkdirs();
- FileUtil.copyFile(srcFile, tgtDir);
- }
- } catch (Exception e) {
- logger.logError(e);
- }
- }
- }
- } catch (Exception e) {
- logger.logError(e);
- }
- }
-
- /**
- * Parses the given HTML content from the clipboard and returns the source
- * URL.
- *
- * @param htmlContent
- * the HTML content from the clipboard
- * @return the source URL or <code>null</code>
- */
- protected String getSourceURL(String htmlContent) {
- String sourceURL = null;
- int sourceURLIndex = htmlContent.indexOf(SOURCE_URL);
- if (sourceURLIndex > 0) {
- sourceURL = htmlContent.substring(sourceURLIndex
- + SOURCE_URL.length());
- sourceURL = sourceURL.substring(0, sourceURL
- .indexOf(FileUtil.LINE_SEP));
- if (sourceURL.toLowerCase().endsWith(HTM_EXT)
- || sourceURL.toLowerCase().endsWith(HTML_EXT)) {
- sourceURL = sourceURL.substring(0, sourceURL.indexOf(FileUtil
- .getFileName(sourceURL)) - 1);
- sourceURL = sourceURL.replace('\\', '/');
- }
- sourceURL = FileUtil.appendSeparator(sourceURL, "/"); //$NON-NLS-1$
- }
- return sourceURL;
- }
-
- protected String getSubdirectoryOfResources(String path) {
- String result = ""; //$NON-NLS-1$
- int res_idx = path.indexOf(RESOURCES);
- if (res_idx != -1) {
- Stack<String> stack = new Stack<String>();
- File relative = new File(path).getParentFile();
- while (!relative.getName().equals(RESOURCES)) {
- stack.push(relative.getName());
- relative = relative.getParentFile();
- }
- while (!stack.isEmpty()) {
- result = result + (String)stack.pop() + File.separator;
- }
- }
- return result;
- }
-
-}
diff --git a/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/actions/PastePlainTextAction.java b/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/actions/PastePlainTextAction.java
deleted file mode 100644
index 3f797dc66c3..00000000000
--- a/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/actions/PastePlainTextAction.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.epf.richtext.actions;
-
-import org.eclipse.epf.common.utils.StrUtil;
-import org.eclipse.epf.richtext.IRichText;
-import org.eclipse.epf.richtext.RichTextCommand;
-import org.eclipse.epf.richtext.RichTextEditor;
-import org.eclipse.epf.richtext.RichTextImages;
-import org.eclipse.epf.richtext.RichTextResources;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.swt.dnd.Clipboard;
-import org.eclipse.swt.dnd.TextTransfer;
-import org.eclipse.swt.widgets.Display;
-
-public class PastePlainTextAction extends RichTextAction {
-
- /**
- * Creates a new instance.
- */
- public PastePlainTextAction(IRichText richText) {
- super(richText, IAction.AS_PUSH_BUTTON);
- setImageDescriptor(RichTextImages.IMG_DESC_PASTE_PLAIN_TEXT);
- setDisabledImageDescriptor(RichTextImages.DISABLED_IMG_DESC_PASTE_PLAIN_TEXT);
- setToolTipText(RichTextResources.pastePlainTextAction_toolTipText);
- setEnabled(true);
- }
-
- /**
- * Returns <code>true</code> if this action should be disabled when the
- * rich text editor is in source edit mode.
- */
- public boolean disableInSourceMode() {
- return false;
- }
-
- public void execute(IRichText richText) {
- if (richText != null) {
- // get text from clipboard
- Clipboard clipboard = new Clipboard(Display.getCurrent());
- String text = (String) clipboard.getContents(TextTransfer
- .getInstance());
- if (text != null && text.length() > 0) {
- text = StrUtil.convertNewlinesToHTML(text);
- if (richText instanceof RichTextEditor) {
- ((RichTextEditor)richText).addHTML(text);
- } else {
- richText.executeCommand(RichTextCommand.ADD_HTML, text);
- }
- }
- }
- }
-
-}
diff --git a/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/actions/RichTextAction.java b/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/actions/RichTextAction.java
deleted file mode 100644
index 3dfa39996ae..00000000000
--- a/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/actions/RichTextAction.java
+++ /dev/null
@@ -1,158 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-//------------------------------------------------------------------------------
-// Copyright (c) 2005, 2007 IBM Corporation 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:
-// IBM Corporation - initial implementation
-//------------------------------------------------------------------------------
-package org.eclipse.epf.richtext.actions;
-
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.LinkedHashSet;
-
-import org.eclipse.epf.richtext.IRichText;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.ActionContributionItem;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.action.IContributionItem;
-import org.eclipse.jface.action.IMenuCreator;
-import org.eclipse.jface.action.MenuManager;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.swt.widgets.ToolItem;
-
-/**
- * The abstract implementation of a rich text action.
- *
- * @author Kelvin Low
- * @author Jeff Hardy
- * @since 1.0
- */
-public abstract class RichTextAction extends Action {
-
- protected IRichText richText;
-
- protected ToolItem toolItem;
-
- protected Collection<IAction> fMenuActions = new LinkedHashSet<IAction>();
-
- protected IMenuCreator menuCreator = new IMenuCreator() {
-
- private MenuManager dropDownMenuMgr;
-
- /**
- * Creates the menu manager for the drop-down.
- */
- private void createDropDownMenuMgr() {
- if (dropDownMenuMgr == null) {
- dropDownMenuMgr = new MenuManager();
- for (Iterator<IAction> iter = getMenuActions().iterator();iter.hasNext();) {
- IAction item = iter.next();
- dropDownMenuMgr.add(item);
- }
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.action.IMenuCreator#getMenu(org.eclipse.swt.widgets.Control)
- */
- public Menu getMenu(Control parent) {
- createDropDownMenuMgr();
- return dropDownMenuMgr.createContextMenu(parent);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.action.IMenuCreator#getMenu(org.eclipse.swt.widgets.Menu)
- */
- public Menu getMenu(Menu parent) {
- createDropDownMenuMgr();
- Menu menu = new Menu(parent);
- IContributionItem[] items = dropDownMenuMgr.getItems();
- for (int i = 0; i < items.length; i++) {
- IContributionItem item = items[i];
- IContributionItem newItem = item;
- if (item instanceof ActionContributionItem) {
- newItem = new ActionContributionItem(
- ((ActionContributionItem) item).getAction());
- }
- newItem.fill(menu, -1);
- }
- return menu;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.action.IMenuCreator#dispose()
- */
- public void dispose() {
- if (dropDownMenuMgr != null) {
- dropDownMenuMgr.dispose();
- dropDownMenuMgr = null;
- }
- }
- };
-
- /**
- * Creates a new instance.
- *
- * @param richText
- * a rich text control
- */
- public RichTextAction(IRichText richText, int style) {
- super(null, style);
- this.richText = richText;
- }
-
- /**
- * Returns <code>true</code> if this action should be disabled when the
- * rich text editor is in readonly mode.
- */
- public boolean disableInReadOnlyMode() {
- return true;
- }
-
- /**
- * Returns <code>true</code> if this action should be disabled when the
- * rich text editor is in source edit mode.
- */
- public boolean disableInSourceMode() {
- return true;
- }
-
- public void setToolItem(ToolItem toolItem) {
- this.toolItem = toolItem;
- }
-
- @Override
- public void run() {
- execute(richText);
- }
-
- @Override
- public String getId() {
- return getClass().getCanonicalName();
- }
-
- public Collection<IAction> getMenuActions() {
- return fMenuActions;
- }
-
- public void addActionToMenu(IAction action) {
- fMenuActions.add(action);
- }
-
- public abstract void execute(IRichText richText);
-}
diff --git a/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/actions/RichTextComboAction.java b/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/actions/RichTextComboAction.java
deleted file mode 100644
index d000ee26a3f..00000000000
--- a/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/actions/RichTextComboAction.java
+++ /dev/null
@@ -1,148 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-//------------------------------------------------------------------------------
-// Copyright (c) 2005, 2007 IBM Corporation 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:
-// IBM Corporation - initial implementation
-//------------------------------------------------------------------------------
-package org.eclipse.epf.richtext.actions;
-
-import java.util.Collection;
-
-import org.eclipse.epf.common.ui.actions.CComboContributionItem;
-import org.eclipse.epf.richtext.IRichText;
-import org.eclipse.swt.SWT;
-
-/**
- * The abstract implementation of a rich text combo action.
- *
- * @author Kelvin Low
- * @author Jeff Hardy
- * @since 1.0
- */
-public abstract class RichTextComboAction extends CComboContributionItem {
-
- protected IRichText richText;
-
- protected String toolTipText;
-
- protected boolean enabled = true;
-
- protected boolean notifyListeners = false;
-
-
- /**
- * Creates a new instance.
- *
- * @param richText
- * a rich text control
- */
- public RichTextComboAction(IRichText richText) {
- super(SWT.READ_ONLY | SWT.FLAT | SWT.BORDER);
- this.richText = richText;
- }
-
- /**
- * Creates a new instance.
- *
- * @param richText
- * a rich text control
- */
- public RichTextComboAction(IRichText richText, int style) {
- super(SWT.READ_ONLY | SWT.FLAT | SWT.BORDER | style);
- this.richText = richText;
- }
-
-
- /**
- * Executes the action.
- *
- * @param richText
- * a rich text control
- * @param index
- * the index of the selected item
- */
- public abstract void execute(IRichText richText);
-
- public abstract Collection<String> getInput();
-
- public void init() {
- setInput(getInput());
- setNotifyListeners(true);
- }
-
- protected String getCComboSelection() {
- if (getCCombo() != null) {
- int index = getSelectionIndex();
- return getCCombo().getItem(index);
- }
- return null;
- }
-
- /**
- * Returns the tool tip for the action.
- *
- * @return the tool tip text
- */
- public String getToolTipText() {
- return toolTipText;
- }
-
- /**
- * Sets the tool tip for the action.
- *
- * @param toolTipText
- * the tool tip text
- */
- public void setToolTipText(String toolTipText) {
- this.toolTipText = toolTipText;
- }
-
- /**
- * Returns the enabled status of the action.
- *
- * @return <code>true</code> if enabled, <code>false</code> if not
- */
- public boolean getEnabled() {
- return enabled;
- }
-
- /**
- * Enables or disables the action.
- *
- * @param enabled
- * if <code>true</code>, enable the action. if
- * <code>false</code>, disable it.
- */
- public void setEnabled(boolean enabled) {
- this.enabled = enabled;
- }
-
- @Override
- protected void performSelectionChanged() {
- if (notifyListeners) {
- execute(richText);
- }
- }
-
- public boolean isNotifyListeners() {
- return notifyListeners;
- }
-
- public void setNotifyListeners(boolean notifyListeners) {
- this.notifyListeners = notifyListeners;
- }
-}
diff --git a/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/actions/SubscriptAction.java b/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/actions/SubscriptAction.java
deleted file mode 100644
index 4dd42bf05c2..00000000000
--- a/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/actions/SubscriptAction.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-//------------------------------------------------------------------------------
-// Copyright (c) 2005, 2007 IBM Corporation 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:
-// IBM Corporation - initial implementation
-//------------------------------------------------------------------------------
-package org.eclipse.epf.richtext.actions;
-
-import org.eclipse.epf.richtext.IRichText;
-import org.eclipse.epf.richtext.RichTextCommand;
-import org.eclipse.epf.richtext.RichTextImages;
-import org.eclipse.epf.richtext.RichTextResources;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Listener;
-
-/**
- * Toggles the subscript attribute of the selected text in a rich text control.
- *
- * @author Kelvin Low
- * @author Jeff Hardy
- * @since 1.0
- */
-public class SubscriptAction extends RichTextAction {
-
- /**
- * Creates a new instance.
- */
- public SubscriptAction(final IRichText richText) {
- super(richText, IAction.AS_CHECK_BOX);
- setImageDescriptor(RichTextImages.IMG_DESC_SUBSCRIPT);
- setDisabledImageDescriptor(RichTextImages.DISABLED_IMG_DESC_SUBSCRIPT);
- setToolTipText(RichTextResources.subscriptAction_toolTipText);
- // add listener
- richText.addListener(SWT.SELECTED, new Listener() {
- public void handleEvent(Event event) {
- setChecked(richText.getSelected().isSubscript());
- }
- });
- }
-
- /**
- * Executes the action.
- *
- * @param richText
- * a rich text control
- */
- public void execute(IRichText richText) {
- if (richText != null) {
- richText.executeCommand(RichTextCommand.SUBSCRIPT);
- }
- }
-}
diff --git a/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/actions/SuperscriptAction.java b/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/actions/SuperscriptAction.java
deleted file mode 100644
index d5a1a294c3a..00000000000
--- a/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/actions/SuperscriptAction.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-//------------------------------------------------------------------------------
-// Copyright (c) 2005, 2007 IBM Corporation 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:
-// IBM Corporation - initial implementation
-//------------------------------------------------------------------------------
-package org.eclipse.epf.richtext.actions;
-
-import org.eclipse.epf.richtext.IRichText;
-import org.eclipse.epf.richtext.RichTextCommand;
-import org.eclipse.epf.richtext.RichTextImages;
-import org.eclipse.epf.richtext.RichTextResources;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Listener;
-
-/**
- * Toggles the superscript attribute of the selected text in a rich text
- * control.
- *
- * @author Kelvin Low
- * @author Jeff Hardy
- * @since 1.0
- */
-public class SuperscriptAction extends RichTextAction {
-
- /**
- * Creates a new instance.
- */
- public SuperscriptAction(final IRichText richText) {
- super(richText, IAction.AS_CHECK_BOX);
- setImageDescriptor(RichTextImages.IMG_DESC_SUPERSCRIPT);
- setDisabledImageDescriptor(RichTextImages.DISABLED_IMG_DESC_SUPERSCRIPT);
- setToolTipText(RichTextResources.superscriptAction_toolTipText);
- // add listener
- richText.addListener(SWT.SELECTED, new Listener() {
- public void handleEvent(Event event) {
- setChecked(richText.getSelected().isSuperscript());
- }
- });
- }
-
- /**
- * Executes the action.
- *
- * @param richText
- * a rich text control
- */
- public void execute(IRichText richText) {
- if (richText != null) {
- richText.executeCommand(RichTextCommand.SUPERSCRIPT);
- }
- }
-}
diff --git a/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/actions/TidyAction.java b/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/actions/TidyAction.java
deleted file mode 100644
index 7ad78fb9190..00000000000
--- a/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/actions/TidyAction.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-//------------------------------------------------------------------------------
-// Copyright (c) 2005, 2006 IBM Corporation 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:
-// IBM Corporation - initial implementation
-//------------------------------------------------------------------------------
-package org.eclipse.epf.richtext.actions;
-
-import java.io.UnsupportedEncodingException;
-
-import org.eclipse.epf.common.CommonPlugin;
-import org.eclipse.epf.common.IHTMLFormatter;
-import org.eclipse.epf.common.utils.ExtensionHelper;
-import org.eclipse.epf.richtext.IRichText;
-import org.eclipse.epf.richtext.RichTextEditor;
-import org.eclipse.epf.richtext.RichTextImages;
-import org.eclipse.epf.richtext.RichTextPlugin;
-import org.eclipse.jface.action.IAction;
-
-/**
- * Runs JTidy on the HTML
- *
- * @author Jeff Hardy
- * @since 1.2
- */
-public class TidyAction extends RichTextAction {
-
- boolean forceOutput = false;
- boolean makeBare = false;
- boolean word2000 = false;
-
- // The HTML source formatter.
- protected IHTMLFormatter htmlFormatter;
-
-
-
- /**
- * Creates a new instance.
- */
- public TidyAction(IRichText richText, boolean forceOutput, boolean makeBare, boolean word2000) {
- super(richText, IAction.AS_PUSH_BUTTON);
- this.forceOutput = forceOutput;
- this.makeBare = makeBare;
- this.word2000 = word2000;
- setImageDescriptor(RichTextImages.IMG_DESC_TIDY);
- setDisabledImageDescriptor(RichTextImages.DISABLED_IMG_DESC_TIDY);
-// htmlFormatter = new HTMLFormatter();
- htmlFormatter = (IHTMLFormatter) ExtensionHelper.createExtensionForJTidy(
- CommonPlugin.getDefault().getId(), "htmlFormatter"); //$NON-NLS-1$
- }
-
- @Override
- public void execute(IRichText richText) {
- // get current text
- String html;
- if (richText instanceof RichTextEditor) {
- html = ((RichTextEditor)richText).getText();
- } else {
- html = richText.getText();
- }
- // call JTidy with the options
- try {
- html = htmlFormatter.formatHTML(html, false, forceOutput, makeBare, word2000);
- } catch (UnsupportedEncodingException e) {
- RichTextPlugin.getDefault().getLogger().logError(e);
- }
- // set text
- if (richText instanceof RichTextEditor) {
- ((RichTextEditor)richText).setText(html);
- } else {
- richText.setText(html);
- }
- richText.checkModify();
-
- }
-
- @Override
- public boolean disableInSourceMode() {
- return false;
- }
-}
diff --git a/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/actions/TidyActionGroup.java b/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/actions/TidyActionGroup.java
deleted file mode 100644
index 0624bbdf76f..00000000000
--- a/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/actions/TidyActionGroup.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-//------------------------------------------------------------------------------
-// Copyright (c) 2005, 2006 IBM Corporation 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:
-// IBM Corporation - initial implementation
-//------------------------------------------------------------------------------
-package org.eclipse.epf.richtext.actions;
-
-import org.eclipse.epf.richtext.IRichText;
-import org.eclipse.epf.richtext.RichTextImages;
-import org.eclipse.epf.richtext.RichTextResources;
-import org.eclipse.jface.action.IAction;
-
-/**
- * Runs JTidy on the HTML
- *
- * @author Jeff Hardy
- * @since 1.2
- */
-public class TidyActionGroup extends RichTextAction {
-
- TidyAction tidyActionDefault;
- TidyAction tidyActionCleanMS;
- TidyAction tidyActionCleanWord2000;
-
- public TidyActionGroup(IRichText richText) {
- super(richText, IAction.AS_DROP_DOWN_MENU);
- // TODO need image
- setImageDescriptor(RichTextImages.IMG_DESC_TIDY);
- // TODO need image
-// setDisabledImageDescriptor(RichTextImages.DISABLED_IMG_DESC_PASTE);
- setToolTipText(RichTextResources.tidy_clean_text);
-
- createActions();
- setMenuCreator(menuCreator);
- }
-
- private void createActions() {
- tidyActionDefault = new TidyAction(richText, true, false, false);
- tidyActionDefault.setText(RichTextResources.tidy_clean_text);
- tidyActionDefault.setToolTipText(RichTextResources.tidy_clean_toolTipText);
- tidyActionCleanMS = new TidyAction(richText, true, true, false);
- tidyActionCleanMS.setText(RichTextResources.tidy_cleaner_text);
- tidyActionCleanMS.setToolTipText(RichTextResources.tidy_cleaner_toolTipText);
- tidyActionCleanWord2000 = new TidyAction(richText, true, true, true);
- tidyActionCleanWord2000.setText(RichTextResources.tidy_cleanest_text);
- tidyActionCleanWord2000.setToolTipText(RichTextResources.tidy_cleanest_toolTipText);
- addActionToMenu(tidyActionDefault);
- addActionToMenu(tidyActionCleanMS);
- addActionToMenu(tidyActionCleanWord2000);
- }
-
- @Override
- public void execute(IRichText richText) {
- // TODO Auto-generated method stub
-
- // call normal clean
- tidyActionDefault.execute(richText);
-
- }
-
- @Override
- public boolean disableInSourceMode() {
- return false;
- }
-
-
-}
diff --git a/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/actions/UnderlineAction.java b/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/actions/UnderlineAction.java
deleted file mode 100644
index 27825aca080..00000000000
--- a/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/actions/UnderlineAction.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-//------------------------------------------------------------------------------
-// Copyright (c) 2005, 2007 IBM Corporation 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:
-// IBM Corporation - initial implementation
-//------------------------------------------------------------------------------
-package org.eclipse.epf.richtext.actions;
-
-import org.eclipse.epf.richtext.IRichText;
-import org.eclipse.epf.richtext.RichTextCommand;
-import org.eclipse.epf.richtext.RichTextImages;
-import org.eclipse.epf.richtext.RichTextResources;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Listener;
-
-/**
- * Toggles the underline attribute of the selected text in a rich text control.
- *
- * @author Kelvin Low
- * @author Jeff Hardy
- * @since 1.0
- */
-public class UnderlineAction extends RichTextAction {
-
- /**
- * Creates a new instance.
- */
- public UnderlineAction(final IRichText richText) {
- super(richText, IAction.AS_CHECK_BOX);
- setImageDescriptor(RichTextImages.IMG_DESC_UNDERLINE);
- setDisabledImageDescriptor(RichTextImages.DISABLED_IMG_DESC_UNDERLINE);
- setToolTipText(RichTextResources.underlineAction_toolTipText);
- // add listener
- richText.addListener(SWT.SELECTED, new Listener() {
- public void handleEvent(Event event) {
- setChecked(richText.getSelected().isUnderLine());
- }
- });
- }
-
- /**
- * Executes the action.
- *
- * @param richText
- * a rich text control
- */
- public void execute(IRichText richText) {
- if (richText != null) {
- richText.executeCommand(RichTextCommand.UNDERLINE);
- }
- }
-}
diff --git a/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/actions/package.html b/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/actions/package.html
deleted file mode 100644
index 8e923674e79..00000000000
--- a/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/actions/package.html
+++ /dev/null
@@ -1,5 +0,0 @@
-<html>
-<body>
-Provides editing actions for the rich text control and editor.
-</body>
-</html> \ No newline at end of file
diff --git a/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/dialogs/AddCodeDialog.java b/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/dialogs/AddCodeDialog.java
deleted file mode 100644
index 982efb716c3..00000000000
--- a/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/dialogs/AddCodeDialog.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*******************************************************************************
-* Licensed Materials - Property of IBM
-* (c) Copyright IBM Corporation 2007,2011. All Rights Reserved.
-*
-* Note to U.S. Government Users Restricted Rights:
-* Use, duplication or disclosure restricted by GSA ADP Schedule
-* Contract with IBM Corp.
-*******************************************************************************/
-
-package org.eclipse.epf.richtext.dialogs;
-
-import org.eclipse.epf.richtext.RichTextResources;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-
-public class AddCodeDialog extends BaseDialog {
- private Text html;
- private String htmlStr;
-
- public AddCodeDialog(Shell parent) {
- super(parent);
- }
-
- protected Control createDialogArea(Composite parent) {
- Composite composite = (Composite) super.createDialogArea(parent);
-
- Label label = new Label(composite, SWT.NONE);
- label.setText(RichTextResources.addCodeDialog_Msg);
- {
- GridData gd = new GridData(GridData.FILL_HORIZONTAL);
- gd.horizontalSpan = 2;
- label.setLayoutData(gd);
- }
-
- html = new Text(composite, SWT.MULTI | SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
- {
- GridData gd = new GridData(GridData.FILL_BOTH);
- gd.horizontalSpan = 2;
- gd.widthHint = 300;
- gd.heightHint = 200;
- html.setLayoutData(gd);
- }
- html.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- okButton.setEnabled(html.getText().trim().length() > 0);
- }
- });
-
- super.getShell().setText(RichTextResources.addCodeDialog_title);
-
- return composite;
- }
-
- protected void createButtonsForButtonBar(Composite parent) {
- super.createButtonsForButtonBar(parent);
- okButton.setEnabled(false);
- }
-
- protected void okPressed() {
- //add the extra "<br/>" to avoid Jtidy problem
- String br = "<br/>"; //$NON-NLS-1$
- String customHtml = html.getText().trim();
- htmlStr = br + customHtml;
-
- super.okPressed();
- }
-
- public String getCode() {
- return htmlStr;
- }
-
-}
diff --git a/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/dialogs/AddImageDialog.java b/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/dialogs/AddImageDialog.java
deleted file mode 100644
index 2d2ec28b782..00000000000
--- a/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/dialogs/AddImageDialog.java
+++ /dev/null
@@ -1,143 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-//------------------------------------------------------------------------------
-// Copyright (c) 2005, 2007 IBM Corporation 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:
-// IBM Corporation - initial implementation
-//------------------------------------------------------------------------------
-package org.eclipse.epf.richtext.dialogs;
-
-import java.io.File;
-
-import org.eclipse.epf.richtext.RichTextResources;
-import org.eclipse.epf.richtext.html.Image;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.FileDialog;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-
-/**
- * Prompts the user to specify the image that will be used to create a HTML
- * &lt;image&gt; tag in the rich text editor.
- *
- * @author Kelvin Low
- * @since 1.0
- */
-public class AddImageDialog extends BaseDialog {
-
- protected Image image = new Image();
-
- protected Text urlText;
-
- protected Button browseButton;
-
- protected SelectionAdapter browseSelectionAdapter = new SelectionAdapter() {
- public void widgetSelected(SelectionEvent event) {
- FileDialog dialog = new FileDialog(Display.getCurrent()
- .getActiveShell(), SWT.OPEN);
- dialog
- .setFilterExtensions(new String[] {
- "*.gif", "*.jpg", "*.bmp" }); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- String imageFile = dialog.open();
- if (imageFile != null && imageFile.length() > 0) {
- File file = new File(imageFile);
- try {
- String url = file.toURL().toExternalForm();
- urlText.setText(url);
- } catch (Exception e) {
- logger.logError(e);
- }
- }
- }
- };
-
- protected ModifyListener urlTextListener = new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- if (okButton != null) {
- okButton.setEnabled(urlText.getText().trim().length() > 0);
- }
- }
- };
-
- /**
- * Creates a new instance.
- *
- * @param parent
- * the parent shell
- */
- public AddImageDialog(Shell parent) {
- super(parent);
- }
-
- @Override
- protected Control createDialogArea(Composite parent) {
- Composite composite = (Composite) super.createDialogArea(parent);
- GridLayout layout = (GridLayout) composite.getLayout();
- layout.numColumns = 3;
-
- Label urlLabel = new Label(composite, SWT.NONE);
- urlLabel.setText(RichTextResources.urlLabel_text);
- urlText = new Text(composite, SWT.BORDER);
- GridData gridData = new GridData(GridData.FILL_HORIZONTAL);
- gridData.widthHint = 300;
- urlText.setLayoutData(gridData);
- urlText.addModifyListener(urlTextListener);
-
- browseButton = new Button(composite, SWT.NONE);
- browseButton.setText(RichTextResources.browseButton_text);
- browseButton.addSelectionListener(browseSelectionAdapter);
-
- super.getShell().setText(RichTextResources.addImageDialog_title);
-
- return composite;
- }
-
- @Override
- protected void createButtonsForButtonBar(Composite parent) {
- super.createButtonsForButtonBar(parent);
- okButton.setEnabled(false);
- }
-
- @Override
- protected void okPressed() {
- String url = urlText.getText();
- if (url != null && url.length() > 0) {
- image.setURL(url);
- }
- super.okPressed();
- }
-
- /**
- * Gets the user specified image.
- *
- * @return an <code>Image</code> object
- */
- public Image getImage() {
- return image;
- }
-
-} \ No newline at end of file
diff --git a/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/dialogs/AddLinkDialog.java b/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/dialogs/AddLinkDialog.java
deleted file mode 100644
index 5a78077f933..00000000000
--- a/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/dialogs/AddLinkDialog.java
+++ /dev/null
@@ -1,126 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-//------------------------------------------------------------------------------
-// Copyright (c) 2005, 2007 IBM Corporation 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:
-// IBM Corporation - initial implementation
-//------------------------------------------------------------------------------
-package org.eclipse.epf.richtext.dialogs;
-
-import org.eclipse.epf.richtext.RichTextResources;
-import org.eclipse.epf.richtext.html.Link;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-
-/**
- * Prompts the user to specify the file that will be used to create a HTML
- * &lt;a&gt; tag in the rich text editor.
- *
- * @author Kelvin Low
- * @since 1.0
- */
-public class AddLinkDialog extends BaseDialog {
-
- protected Link link = new Link();
-
- protected Text urlText;
-
- protected String basePath;
-
- protected Composite composite;
-
- protected Label urlLabel;
-
- protected Text urlDisplayNameText;
-
- protected Label urlDisplayNameLabel;
-
- protected ModifyListener urlTextModifyListener = new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- if (okButton != null) {
- okButton.setEnabled(urlText.getText().trim().length() > 0);
- }
- }
- };
-
- /**
- * Creates a new instance.
- *
- * @param parent
- * the parent shell
- */
- public AddLinkDialog(Shell parent, String basePath) {
- super(parent);
- this.basePath = basePath;
- }
-
- @Override
- protected Control createDialogArea(Composite parent) {
- composite = (Composite) super.createDialogArea(parent);
-
- urlLabel = new Label(composite, SWT.NONE);
- urlLabel.setText(RichTextResources.urlLabel_text);
- urlText = new Text(composite, SWT.BORDER);
- GridData gridData = new GridData(GridData.FILL_HORIZONTAL);
- gridData.widthHint = 300;
- urlText.setLayoutData(gridData);
- urlText.addModifyListener(urlTextModifyListener);
-
- urlDisplayNameLabel = new Label(composite, SWT.NONE);
- urlDisplayNameLabel.setText(RichTextResources.urlDisplayNameLabel_text);
- urlDisplayNameText = new Text(composite, SWT.BORDER);
- GridData gridData2 = new GridData(GridData.FILL_HORIZONTAL);
- gridData2.widthHint = 300;
- urlDisplayNameText.setLayoutData(gridData2);
-
- super.getShell().setText(RichTextResources.addLinkDialog_title);
-
- return composite;
- }
-
- @Override
- protected void createButtonsForButtonBar(Composite parent) {
- super.createButtonsForButtonBar(parent);
- okButton.setEnabled(false);
- }
-
- @Override
- protected void okPressed() {
- String url = urlText.getText();
- if (url != null && url.length() > 0) {
- link.setURL(url);
- link.setName(urlDisplayNameText.getText());
- }
- super.okPressed();
- }
-
- /**
- * Gets the user specified link.
- *
- * @return an <code>Link</code> object
- */
- public Link getLink() {
- return link;
- }
-
-} \ No newline at end of file
diff --git a/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/dialogs/AddTableDialog.java b/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/dialogs/AddTableDialog.java
deleted file mode 100644
index 27832d5527b..00000000000
--- a/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/dialogs/AddTableDialog.java
+++ /dev/null
@@ -1,220 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-//------------------------------------------------------------------------------
-// Copyright (c) 2005, 2007 IBM Corporation 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:
-// IBM Corporation - initial implementation
-//------------------------------------------------------------------------------
-package org.eclipse.epf.richtext.dialogs;
-
-import org.eclipse.epf.richtext.RichTextResources;
-import org.eclipse.epf.richtext.html.Table;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-
-/**
- * Prompts the user to specify the attributes that will be used to create a HTML
- * &lt;table&gt; tag in the rich text editor.
- *
- * @author Kelvin Low
- * @since 1.0
- */
-public class AddTableDialog extends BaseDialog {
-
- private static final int DEFAULT_ROWS = 2;
-
- private static final int DEFAULT_COLUMNS = 2;
-
- private static final String DEFAULT_WIDTH = "85%"; //$NON-NLS-1$
-
- private static final String[] TABLE_STYLE_LABELS = {
- RichTextResources.tableHeaderNone_text,
- RichTextResources.tableHeaderCols_text,
- RichTextResources.tableHeaderRows_text,
- RichTextResources.tableHeaderBoth_text, };
-
- private Table table = new Table();
-
- private Text rowsText;
-
- private Text colsText;
-
- private Text widthText;
-
- private Combo tableTypeCombo;
-
- private Text summaryText;
-
- private Text captionText;
-
- private ModifyListener modifyListener = new ModifyListener() {
- public void modifyText(ModifyEvent event) {
- if (okButton != null) {
- try {
- int rows = Integer.parseInt(rowsText.getText().trim());
- int cols = Integer.parseInt(colsText.getText().trim());
- String width = widthText.getText().trim();
- okButton.setEnabled(rows > 0 && cols > 0
- && width.length() > 0);
- } catch (Exception e) {
- okButton.setEnabled(false);
- }
- }
- }
- };
-
- /**
- * Creates a new instance.
- *
- * @param parent
- * the parent shell
- */
- public AddTableDialog(Shell parent) {
- super(parent);
- }
-
- @Override
- protected Control createDialogArea(Composite parent) {
- Composite composite = (Composite) super.createDialogArea(parent);
-
- Label rowsLabel = new Label(composite, SWT.NONE);
- rowsLabel.setText(RichTextResources.rowsLabel_text);
-
- rowsText = new Text(composite, SWT.BORDER);
- rowsText.setTextLimit(2);
- rowsText.setText("" + DEFAULT_ROWS); //$NON-NLS-1$
- {
- GridData gridData = new GridData(GridData.FILL_HORIZONTAL
- | GridData.GRAB_HORIZONTAL);
- rowsText.setLayoutData(gridData);
- }
- rowsText.addModifyListener(modifyListener);
-
- Label colsLabel = new Label(composite, SWT.NONE);
- colsLabel.setText(RichTextResources.columnsLabel_text);
-
- colsText = new Text(composite, SWT.BORDER);
- colsText.setTextLimit(2);
- colsText.setText("" + DEFAULT_COLUMNS); //$NON-NLS-1$
- {
- GridData gridData = new GridData(GridData.FILL_HORIZONTAL
- | GridData.GRAB_HORIZONTAL);
- colsText.setLayoutData(gridData);
- }
- colsText.addModifyListener(modifyListener);
-
- Label widthLabel = new Label(composite, SWT.NONE);
- widthLabel.setText(RichTextResources.widthLabel_text);
-
- widthText = new Text(composite, SWT.BORDER);
- widthText.setText("" + DEFAULT_WIDTH); //$NON-NLS-1$
- {
- GridData gridData = new GridData(GridData.FILL_HORIZONTAL
- | GridData.GRAB_HORIZONTAL);
- widthText.setLayoutData(gridData);
- }
- widthText.addModifyListener(modifyListener);
-
- Label headerTypeLabel = new Label(composite, SWT.NONE);
- headerTypeLabel.setText(RichTextResources.tableStyleLabel_text);
-
- tableTypeCombo = new Combo(composite, SWT.BORDER | SWT.READ_ONLY);
- tableTypeCombo.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- tableTypeCombo.setItems(TABLE_STYLE_LABELS);
- tableTypeCombo.setText(TABLE_STYLE_LABELS[0]);
-
- Label summaryLabel = new Label(composite, SWT.NONE);
- summaryLabel.setText(RichTextResources.summaryLabel_text);
- summaryText = new Text(composite, SWT.BORDER);
- {
- GridData gridData = new GridData(GridData.FILL_HORIZONTAL
- | GridData.GRAB_HORIZONTAL);
- summaryText.setLayoutData(gridData);
- }
-
- Label captionLabel = new Label(composite, SWT.NONE);
- captionLabel.setText(RichTextResources.captionLabel_text);
- captionText = new Text(composite, SWT.BORDER);
- {
- GridData gridData = new GridData(GridData.FILL_HORIZONTAL
- | GridData.GRAB_HORIZONTAL);
- captionText.setLayoutData(gridData);
- }
-
- super.getShell().setText(RichTextResources.addTableDialog_title);
-
- return composite;
- }
-
- @Override
- protected void createButtonsForButtonBar(Composite parent) {
- super.createButtonsForButtonBar(parent);
- }
-
- @Override
- protected void okPressed() {
- String rowsValue = rowsText.getText();
- if (rowsValue != null && rowsValue.length() > 0) {
- try {
- int rows = Integer.parseInt(rowsValue);
- table.setRows(rows);
- } catch (Exception e) {
- table.setRows(DEFAULT_ROWS);
- }
- }
-
- String colsValue = colsText.getText();
- if (colsValue != null && colsValue.length() > 0) {
- try {
- int cols = Integer.parseInt(colsValue);
- table.setColumns(cols);
- } catch (Exception e) {
- table.setColumns(DEFAULT_COLUMNS);
- }
- }
-
- String widthValue = widthText.getText();
- if (widthValue != null && widthValue.length() > 0) {
- table.setWidth(widthValue);
- } else {
- table.setWidth(DEFAULT_WIDTH);
- }
-
- table.setSummary(summaryText.getText().trim());
- table.setCaption(captionText.getText().trim());
- table.setTableHeaders(tableTypeCombo.getSelectionIndex());
-
- super.okPressed();
- }
-
- /**
- * Gets the user specified table.
- *
- * @return an <code>Table</code> object
- */
- public Table getTable() {
- return table;
- }
-
-} \ No newline at end of file
diff --git a/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/dialogs/BaseDialog.java b/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/dialogs/BaseDialog.java
deleted file mode 100644
index ad92d9f2255..00000000000
--- a/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/dialogs/BaseDialog.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-//------------------------------------------------------------------------------
-// Copyright (c) 2005, 2007 IBM Corporation 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:
-// IBM Corporation - initial implementation
-//------------------------------------------------------------------------------
-package org.eclipse.epf.richtext.dialogs;
-
-import org.eclipse.epf.common.serviceability.Logger;
-import org.eclipse.epf.richtext.RichTextPlugin;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Shell;
-
-/**
- * The base class for all dialogs used by the rich text editor.
- *
- * @author Kelvin Low
- * @since 1.0
- */
-public class BaseDialog extends Dialog {
-
- // A logger for logging runtime warnings and errors.
- protected Logger logger;
-
- // The OK button.
- protected Button okButton;
-
- // The Cancel button.
- protected Button cancelButton;
-
- /**
- * Creates a new instance.
- *
- * @param parent
- * the parent shell
- */
- public BaseDialog(Shell parent) {
- super(parent);
- logger = RichTextPlugin.getDefault().getLogger();
- }
-
- @Override
- protected Control createDialogArea(Composite parent) {
- Composite composite = (Composite) super.createDialogArea(parent);
- GridLayout layout = (GridLayout) composite.getLayout();
- layout.marginWidth = 10;
- layout.marginHeight = 10;
- layout.numColumns = 2;
- GridData gridData = (GridData) composite.getLayoutData();
- gridData.verticalIndent = 10;
- return composite;
- }
-
- @Override
- protected void createButtonsForButtonBar(Composite parent) {
- // Create the OK button.
- createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL,
- true);
-
- // Create the Cancel button.
- createButton(parent, IDialogConstants.CANCEL_ID,
- IDialogConstants.CANCEL_LABEL, false);
-
- // Set help context for the OK button.
- okButton = super.getButton(IDialogConstants.OK_ID);
-
- // Set help context for the Cancel button.
- cancelButton = super.getButton(IDialogConstants.CANCEL_ID);
- }
-
-}
diff --git a/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/dialogs/FindReplaceDialog.java b/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/dialogs/FindReplaceDialog.java
deleted file mode 100644
index c03c6d75e3e..00000000000
--- a/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/dialogs/FindReplaceDialog.java
+++ /dev/null
@@ -1,337 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-//------------------------------------------------------------------------------
-// Copyright (c) 2005, 2007 IBM Corporation 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:
-// IBM Corporation - initial implementation
-//------------------------------------------------------------------------------
-package org.eclipse.epf.richtext.dialogs;
-
-import org.eclipse.epf.richtext.RichTextResources;
-import org.eclipse.epf.richtext.actions.FindReplaceAction;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-
-/**
- * Prompts the user to specify the search and replace strings and options.
- *
- * @author Kelvin Low
- * @since 1.0
- */
-public class FindReplaceDialog extends BaseDialog {
-
- private FindReplaceAction findReplaceAction;
-
- private boolean findOnly;
-
- private Text findText;
-
- private Text replaceText;
-
- private Button searchForwardRadioButton;
-
- private Button searchBackwardRadioButton;
-
- private Button caseSensitiveCheckbox;
-
- private Button wholeWordCheckbox;
-
- private Button findButton;
-
- private Button replaceButton;
-
- private Button replaceFindButton;
-
- private Button replaceAllButton;
-
- private Label statusLabel;
-
- /**
- * Creates a new instance.
- *
- * @param parent
- * the parent shell
- * @param findReplaceAction
- * the Find and Replace action
- * @param findOnly
- * if <code>true</code>, disable the replace and replace all
- * functionalities
- */
- public FindReplaceDialog(Shell parent, FindReplaceAction findReplaceAction,
- boolean findOnly) {
- super(parent);
- setShellStyle(SWT.DIALOG_TRIM | SWT.MODELESS | getDefaultOrientation());
- setBlockOnOpen(false);
- this.findReplaceAction = findReplaceAction;
- this.findOnly = findOnly;
- }
-
- @Override
- protected Control createDialogArea(Composite parent) {
- Composite composite = (Composite) super.createDialogArea(parent);
- GridLayout layout = (GridLayout) composite.getLayout();
- layout.numColumns = 1;
-
- Composite textComposite = new Composite(composite, SWT.NONE);
- textComposite.setLayout(new GridLayout(2, false));
- textComposite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
- Label findLabel = new Label(textComposite, SWT.NONE);
- findLabel.setText(RichTextResources.findLabel_text);
- findText = new Text(textComposite, SWT.BORDER);
- GridData gridData = new GridData(GridData.FILL_HORIZONTAL);
- gridData.widthHint = 200;
- findText.setLayoutData(gridData);
- findText.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- if (findButton != null) {
- findButton
- .setEnabled(findText.getText().trim().length() > 0);
- }
- if (replaceAllButton != null && !findOnly) {
- replaceAllButton.setEnabled(findText.getText().trim()
- .length() > 0);
- }
- }
- });
-
- Label replaceLabel = new Label(textComposite, SWT.NONE);
- replaceLabel.setText(RichTextResources.replaceLabel_text);
- replaceText = new Text(textComposite, SWT.BORDER);
- replaceText.setLayoutData(gridData);
- if (findOnly) {
- replaceText.setEnabled(false);
- } else {
- replaceText.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- if (replaceButton != null) {
- replaceButton.setEnabled(findReplaceAction
- .getFoundMatch());
- }
- if (replaceFindButton != null) {
- replaceFindButton.setEnabled(findReplaceAction
- .getFoundMatch());
- }
- }
- });
- }
-
- Composite optionsComposite = new Composite(composite, SWT.NONE);
- optionsComposite.setLayout(new GridLayout(2, true));
- optionsComposite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
- Group directionGroup = new Group(optionsComposite, SWT.NONE);
- directionGroup.setText(RichTextResources.directionGroup_text);
- directionGroup.setLayout(new GridLayout(1, false));
- directionGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- searchForwardRadioButton = new Button(directionGroup, SWT.RADIO);
- searchForwardRadioButton
- .setText(RichTextResources.forwardRadioButton_text);
- searchForwardRadioButton.setSelection(true);
- searchBackwardRadioButton = new Button(directionGroup, SWT.RADIO);
- searchBackwardRadioButton
- .setText(RichTextResources.backwardRadioButton_text);
-
- Group optionsGroup = new Group(optionsComposite, SWT.NONE);
- optionsGroup.setText(RichTextResources.optionsGroup_text);
- optionsGroup.setLayout(new GridLayout(1, false));
- optionsGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- caseSensitiveCheckbox = new Button(optionsGroup, SWT.CHECK);
- caseSensitiveCheckbox
- .setText(RichTextResources.caseSensitiveCheckbox_text);
- wholeWordCheckbox = new Button(optionsGroup, SWT.CHECK);
- wholeWordCheckbox.setText(RichTextResources.wholeWordCheckbox_text);
-
- statusLabel = new Label(composite, SWT.NONE);
- statusLabel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
- super.getShell().setText(RichTextResources.findReplaceDialog_title);
-
- return composite;
- }
-
- @Override
- protected void createButtonsForButtonBar(Composite parent) {
- createButton(parent, IDialogConstants.CLIENT_ID + 1,
- RichTextResources.findButton_text, true);
- findButton = super.getButton(IDialogConstants.CLIENT_ID + 1);
- findButton.addSelectionListener(new SelectionListener() {
- public void widgetSelected(SelectionEvent event) {
- findReplaceAction.run(FindReplaceAction.FIND_TEXT,
- getFindText(), getReplaceText(), getMatchDirection(),
- getMatchOptions());
- if (!findOnly) {
- replaceButton.setEnabled(findReplaceAction.getFoundMatch());
- replaceFindButton.setEnabled(findReplaceAction
- .getFoundMatch());
- }
- if (findReplaceAction.getFoundMatch()) {
- statusLabel.setText(""); //$NON-NLS-1$
- } else {
- statusLabel
- .setText(RichTextResources.FindReplace_Status_noMatch_label);
- }
- findButton.setFocus();
- }
-
- public void widgetDefaultSelected(SelectionEvent e) {
- }
- });
-
- createButton(parent, IDialogConstants.CLIENT_ID + 2,
- RichTextResources.replaceButton_text, false);
- replaceButton = super.getButton(IDialogConstants.CLIENT_ID + 2);
- if (!findOnly) {
- replaceButton.addSelectionListener(new SelectionListener() {
- public void widgetSelected(SelectionEvent event) {
- findReplaceAction.run(FindReplaceAction.REPLACE_TEXT,
- getFindText(), getReplaceText(),
- getMatchDirection(), getMatchOptions());
- replaceButton.setFocus();
- }
-
- public void widgetDefaultSelected(SelectionEvent e) {
- }
- });
- }
-
- createButton(parent, IDialogConstants.CLIENT_ID + 3,
- RichTextResources.replaceFindButton_text, false);
- replaceFindButton = super.getButton(IDialogConstants.CLIENT_ID + 3);
- if (!findOnly) {
- replaceFindButton.addSelectionListener(new SelectionListener() {
- public void widgetSelected(SelectionEvent event) {
- findReplaceAction.run(FindReplaceAction.REPLACE_FIND_TEXT,
- getFindText(), getReplaceText(),
- getMatchDirection(), getMatchOptions());
- replaceButton.setEnabled(findReplaceAction.getFoundMatch());
- replaceFindButton.setEnabled(findReplaceAction
- .getFoundMatch());
- replaceFindButton.setFocus();
- }
-
- public void widgetDefaultSelected(SelectionEvent e) {
- }
- });
- }
-
- createButton(parent, IDialogConstants.CLIENT_ID + 4,
- RichTextResources.replaceallButton_text, false);
- replaceAllButton = super.getButton(IDialogConstants.CLIENT_ID + 4);
- if (!findOnly) {
- replaceAllButton.addSelectionListener(new SelectionListener() {
- public void widgetSelected(SelectionEvent event) {
- findReplaceAction.run(FindReplaceAction.REPLACE_ALL_TEXT,
- getFindText(), getReplaceText(),
- getMatchDirection(), getMatchOptions());
- replaceButton.setEnabled(false);
- replaceFindButton.setEnabled(false);
- replaceAllButton.setFocus();
- }
-
- public void widgetDefaultSelected(SelectionEvent e) {
- }
- });
- }
-
- // Create the Cancel button.
- createButton(parent, IDialogConstants.CANCEL_ID,
- IDialogConstants.CANCEL_LABEL, false);
- cancelButton = super.getButton(IDialogConstants.CANCEL_ID);
-
- findButton.setEnabled(false);
- replaceButton.setEnabled(false);
- replaceFindButton.setEnabled(false);
- replaceAllButton.setEnabled(false);
- }
-
- /**
- * Gets the user specified find text.
- *
- * @return the find text
- */
- public String getFindText() {
- return findText.getText();
- }
-
- /**
- * Gets the user specified replace text.
- *
- * @return the replace text
- */
- public String getReplaceText() {
- return replaceText.getText();
- }
-
- /**
- * Gets the text match direction.
- *
- * @return <code>FIND_FORWARD</code> or <code>FIND_BACKWARD</code>
- */
- public int getMatchDirection() {
- return searchForwardRadioButton.getSelection() ? FindReplaceAction.FORWARD_MATCH
- : FindReplaceAction.BACKWARD_MATCH;
- }
-
- /**
- * Gets the text match options.
- *
- * @return the text match options
- */
- public int getMatchOptions() {
- int options = 0;
- if (wholeWordCheckbox.getSelection() == true) {
- options |= FindReplaceAction.WHOLE_WORD_MATCH;
- }
- if (caseSensitiveCheckbox.getSelection() == true) {
- options |= FindReplaceAction.CASE_SENSITIVE_MATCH;
- }
- return options;
- }
-
- /**
- * Checks the find only option.
- *
- * @return <code>true</code> if find only option is enabled
- */
- public boolean isFindOnly() {
- return findOnly;
- }
-
- /**
- * Sets the find only option.
- *
- * @param findOnly,
- * if <code>true</code>, enable the find only option
- */
- public void setFindOnly(boolean findOnly) {
- this.findOnly = findOnly;
- }
-
-} \ No newline at end of file
diff --git a/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/dialogs/package.html b/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/dialogs/package.html
deleted file mode 100644
index f2a46edb8e6..00000000000
--- a/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/dialogs/package.html
+++ /dev/null
@@ -1,5 +0,0 @@
-<html>
-<body>
-Provides editing dialogs for the rich text control and editor.
-</body>
-</html> \ No newline at end of file
diff --git a/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/html/BlockTag.java b/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/html/BlockTag.java
deleted file mode 100644
index 57c8433a6a6..00000000000
--- a/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/html/BlockTag.java
+++ /dev/null
@@ -1,195 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-//------------------------------------------------------------------------------
-// Copyright (c) 2005, 2007 IBM Corporation 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:
-// IBM Corporation - initial implementation
-//------------------------------------------------------------------------------
-package org.eclipse.epf.richtext.html;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.epf.richtext.RichTextResources;
-
-/**
- * Models a HTML block tag.
- *
- * @author Kelvin Low
- * @since 1.0
- */
-public class BlockTag {
-
- // The user friendly names.
- private static final String NAME_PARAGRAPH = RichTextResources.blockTag_paragraph;
-
- private static final String NAME_HEADING_1 = RichTextResources.blockTag_heading1;
-
- private static final String NAME_HEADING_2 = RichTextResources.blockTag_heading2;
-
- private static final String NAME_HEADING_3 = RichTextResources.blockTag_heading3;
-
- private static final String NAME_HEADING_4 = RichTextResources.blockTag_heading4;
-
- private static final String NAME_HEADING_5 = RichTextResources.blockTag_heading5;
-
- private static final String NAME_HEADING_6 = RichTextResources.blockTag_heading6;
-
- private static final String NAME_ADDRESS = RichTextResources.blockTag_address;
-
- private static final String NAME_PREFORMATTED_TEXT = RichTextResources.blockTag_preformattedText;
-
- // The internal values.
- private static final String VALUE_PARAGRAPH = "<p>"; //$NON-NLS-1$
-
- private static final String VALUE_HEADING_1 = "<h1>"; //$NON-NLS-1$
-
- private static final String VALUE_HEADING_2 = "<h2>"; //$NON-NLS-1$
-
- private static final String VALUE_HEADING_3 = "<h3>"; //$NON-NLS-1$
-
- private static final String VALUE_HEADING_4 = "<h4>"; //$NON-NLS-1$
-
- private static final String VALUE_HEADING_5 = "<h5>"; //$NON-NLS-1$
-
- private static final String VALUE_HEADING_6 = "<h6>"; //$NON-NLS-1$
-
- private static final String VALUE_ADDRESS = "<address>"; //$NON-NLS-1$
-
- private static final String VALUE_PREFORMATTED_TEXT = "<pre>"; //$NON-NLS-1$
-
- /**
- * The &lt;p&gt; tag.
- */
- static public final BlockTag PARAGRAPH = new BlockTag(NAME_PARAGRAPH,
- VALUE_PARAGRAPH);
-
- /**
- * &lt;h1&gt; tag.
- */
- static public final BlockTag HEADING_1 = new BlockTag(NAME_HEADING_1,
- VALUE_HEADING_1);
-
- /**
- * &lt;h2&gt; tag.
- */
- static public final BlockTag HEADING_2 = new BlockTag(NAME_HEADING_2,
- VALUE_HEADING_2);
-
- /**
- * &lt;h3&gt; tag.
- */
- static public final BlockTag HEADING_3 = new BlockTag(NAME_HEADING_3,
- VALUE_HEADING_3);
-
- /**
- * &lt;h4&gt; tag.
- */
- static public final BlockTag HEADING_4 = new BlockTag(NAME_HEADING_4,
- VALUE_HEADING_4);
-
- /**
- * &lt;h5&gt; tag.
- */
- static public final BlockTag HEADING_5 = new BlockTag(NAME_HEADING_5,
- VALUE_HEADING_5);
-
- /**
- * &lt;h6&gt; tag.
- */
- static public final BlockTag HEADING_6 = new BlockTag(NAME_HEADING_6,
- VALUE_HEADING_6);
-
- /**
- * &lt;address&gt; tag.
- */
- static public final BlockTag ADDRESS = new BlockTag(NAME_ADDRESS,
- VALUE_ADDRESS);
-
- /**
- * &lt;pre&gt; tag.
- */
- static public final BlockTag PREFORMATTED_TEXT = new BlockTag(
- NAME_PREFORMATTED_TEXT, VALUE_PREFORMATTED_TEXT);
-
- // A list of <code>BlockTag</code> objects.
- static private final List<BlockTag> BLOCK_TAGS = new ArrayList<BlockTag>();
- static {
- BLOCK_TAGS.add(PARAGRAPH);
- BLOCK_TAGS.add(HEADING_1);
- BLOCK_TAGS.add(HEADING_2);
- BLOCK_TAGS.add(HEADING_3);
- BLOCK_TAGS.add(HEADING_4);
- BLOCK_TAGS.add(HEADING_5);
- BLOCK_TAGS.add(HEADING_6);
- BLOCK_TAGS.add(ADDRESS);
- BLOCK_TAGS.add(PREFORMATTED_TEXT);
- }
-
- // The block tag name.
- private String name;
-
- // The block tag value.
- private String value;
-
- /**
- * Creates a new instance.
- *
- * @param name
- * the block tag name
- * @param value
- * the block tag value
- */
- public BlockTag(String name, String value) {
- this.name = name;
- this.value = value;
- }
-
- /**
- * Gets the block tag name.
- *
- * @return the block tag name
- */
- public String getName() {
- return name;
- }
-
- /**
- * Gets the block tag value.
- *
- * @return the block tag value
- */
- public String getValue() {
- return value;
- }
-
- /**
- * Gets the <code>BlockTag</code> object that is mapped to the given
- * index.
- *
- * @param index
- * an index into the <code>BlockTag</code> list
- * @return a <code>BlockTag</code> object
- */
- public static BlockTag getBlockTag(int index) {
- BlockTag result = (BlockTag) BLOCK_TAGS.get(index);
- if (result != null) {
- return result;
- }
- return PARAGRAPH;
- }
-
-} \ No newline at end of file
diff --git a/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/html/FontName.java b/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/html/FontName.java
deleted file mode 100644
index 48714736f1e..00000000000
--- a/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/html/FontName.java
+++ /dev/null
@@ -1,150 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-//------------------------------------------------------------------------------
-// Copyright (c) 2005, 2007 IBM Corporation 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:
-// IBM Corporation - initial implementation
-//------------------------------------------------------------------------------
-package org.eclipse.epf.richtext.html;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.epf.richtext.RichTextResources;
-
-/**
- * Models a HTML font name.
- *
- * @author Kelvin Low
- * @since 1.0
- */
-public class FontName {
-
- // The user friendly names.
- private static final String NAME_DEFAULT = RichTextResources.fontName_default;
-
- private static final String NAME_ARIAL = RichTextResources.fontName_arial;
-
- private static final String NAME_COURIER_NEW = RichTextResources.fontName_courierNew;
-
- private static final String NAME_TIMES_NEW_ROMAN = RichTextResources.fontName_timesNewRoman;
-
- private static final String NAME_VERDANA = RichTextResources.fontName_verdana;
-
- // The internal values.
- private static final String VALUE_DEFAULT = ""; //$NON-NLS-1$
-
- private static final String VALUE_ARIAL = "Arial, Helvetica, sans-serif"; //$NON-NLS-1$
-
- private static final String VALUE_COURIER_NEW = "Courier New, Courier, mono"; //$NON-NLS-1$
-
- private static final String VALUE_TIMES_NEW_ROMAN = "Times New Roman, Times, serif"; //$NON-NLS-1$
-
- private static final String VALUE_VERDANA = "Verdana, Arial, Helvetica, sans-serif"; //$NON-NLS-1$
-
- /**
- * Default font.
- */
- static public final FontName DEFAULT = new FontName(NAME_DEFAULT,
- VALUE_DEFAULT);
-
- /**
- * Arial font.
- */
- static public final FontName ARIAL = new FontName(NAME_ARIAL, VALUE_ARIAL);
-
- /**
- * Courier New font.
- */
- static public final FontName COURIER_NEW = new FontName(NAME_COURIER_NEW,
- VALUE_COURIER_NEW);
-
- /**
- * Times New Roman font.
- */
- static public final FontName TIMES_NEW_ROMAN = new FontName(
- NAME_TIMES_NEW_ROMAN, VALUE_TIMES_NEW_ROMAN);
-
- /**
- * Verdana font.
- */
- static public final FontName VERDANA = new FontName(NAME_VERDANA,
- VALUE_VERDANA);
-
- // A list of <code>FontName</code> objects.
- static private final List<FontName> FONT_NAMES = new ArrayList<FontName>();
- static {
- FONT_NAMES.add(DEFAULT);
- FONT_NAMES.add(ARIAL);
- FONT_NAMES.add(COURIER_NEW);
- FONT_NAMES.add(TIMES_NEW_ROMAN);
- FONT_NAMES.add(VERDANA);
- }
-
- // The font name.
- private String name;
-
- // The font value.
- private String value;
-
- /**
- * Creates a new instance.
- *
- * @param name
- * the font name
- * @param value
- * the font value
- */
- public FontName(String name, String value) {
- this.name = name;
- this.value = value;
- }
-
- /**
- * Gets the font name.
- *
- * @return the font name
- */
- public String getName() {
- return name;
- }
-
- /**
- * Gets the font value.
- *
- * @return the font value
- */
- public String getValue() {
- return value;
- }
-
- /**
- * Gets the <code>FontName</code> object that is mapped to the given
- * index.
- *
- * @param index
- * an index into the <code>FontName</code> list
- * @return a <code>FontName</code> object
- */
- public static FontName getFontName(int index) {
- FontName result = (FontName) FONT_NAMES.get(index);
- if (result != null) {
- return result;
- }
- return DEFAULT;
- }
-
-} \ No newline at end of file
diff --git a/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/html/FontStyle.java b/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/html/FontStyle.java
deleted file mode 100644
index 55211d74cbd..00000000000
--- a/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/html/FontStyle.java
+++ /dev/null
@@ -1,197 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-//------------------------------------------------------------------------------
-// Copyright (c) 2005, 2007 IBM Corporation 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:
-// IBM Corporation - initial implementation
-//------------------------------------------------------------------------------
-package org.eclipse.epf.richtext.html;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.epf.richtext.RichTextResources;
-
-/**
- * Models a HTML font style.
- *
- * @author Kelvin Low
- * @since 1.0
- */
-public class FontStyle {
-
- // The user friendly names.
- private static final String NAME_NORMAL = RichTextResources.fontStyle_normal;
-
- private static final String NAME_SECTION_HEADING = RichTextResources.fontStyle_sectionHeading;
-
- private static final String NAME_SUBSECTION_HEADING = RichTextResources.fontStyle_subsectionHeading;
-
- private static final String NAME_SUB_SUBSECTION_HEADING = RichTextResources.fontStyle_subSubsectionHeading;
-
- private static final String NAME_QUOTE = RichTextResources.fontStyle_quote;
-
- private static final String NAME_CODE_SAMPLE = RichTextResources.fontStyle_codeSample;
-
- // The internal values.
- private static final String VALUE_NORMAL = "<p>"; //$NON-NLS-1$
-
- private static final String VALUE_SECTION_HEADING = "<h3>"; //$NON-NLS-1$
-
- private static final String VALUE_SUBSECTION_HEADING = "<h4>"; //$NON-NLS-1$
-
- private static final String VALUE_SUB_SUBSECTION_HEADING = "<h5>"; //$NON-NLS-1$
-
- private static final String VALUE_QUOTE = "<quote>"; //$NON-NLS-1$
-
- private static final String VALUE_CODE_SAMPLE = "<code>"; //$NON-NLS-1$
-
- /**
- * Font style for normal text.
- */
- static public final FontStyle NORMAL = new FontStyle(NAME_NORMAL,
- VALUE_NORMAL);
-
- /**
- * Font style for section heading.
- */
- static public final FontStyle SECTION_HEADING = new FontStyle(
- NAME_SECTION_HEADING, VALUE_SECTION_HEADING);
-
- /**
- * Font style for sub section heading.
- */
- static public final FontStyle SUBSECTION_HEADING = new FontStyle(
- NAME_SUBSECTION_HEADING, VALUE_SUBSECTION_HEADING);
- /**
- * Font style for sub sub section heading.
- */
- static public final FontStyle SUB_SUBSECTION_HEADING = new FontStyle(
- NAME_SUB_SUBSECTION_HEADING, VALUE_SUB_SUBSECTION_HEADING);
-
- /**
- * Font style for quotations.
- */
- static public final FontStyle QUOTE = new FontStyle(NAME_QUOTE, VALUE_QUOTE);
-
- /**
- * Font style for displaying program codes.
- */
- static public final FontStyle CODE_SAMPLE = new FontStyle(NAME_CODE_SAMPLE,
- VALUE_CODE_SAMPLE);
-
- // A list of <code>FontStyle</code> objects.
- static private final List<FontStyle> FONT_STYLES = new ArrayList<FontStyle>();
- static {
- FONT_STYLES.add(NORMAL);
- FONT_STYLES.add(SECTION_HEADING);
- FONT_STYLES.add(SUBSECTION_HEADING);
- FONT_STYLES.add(SUB_SUBSECTION_HEADING);
- FONT_STYLES.add(QUOTE);
- FONT_STYLES.add(CODE_SAMPLE);
- }
-
- // The font style name.
- private String name;
-
- // The font style value.
- private String value;
-
- /**
- * Creates a new instance.
- *
- * @param name
- * the font style name
- * @param value
- * the font style value
- */
- public FontStyle(String name, String value) {
- this.name = name;
- this.value = value;
- }
-
- /**
- * Gets the font style name.
- *
- * @return the font style name
- */
- public String getName() {
- return name;
- }
-
- /**
- * Gets the font style value.
- *
- * @return the font style value
- */
- public String getValue() {
- return value;
- }
-
- /**
- * Gets the <code>FontStyle</code> object that is mapped to the given
- * index.
- *
- * @param index
- * an index into the <code>FontStyle</code> list
- * @return a <code>FontStyle</code> object
- */
- public static FontStyle getFontStyle(int index) {
- FontStyle result = (FontStyle) FONT_STYLES.get(index);
- if (result != null) {
- return result;
- }
- return NORMAL;
- }
-
- /**
- * Gets the display name of the <code>FontStyle</code> object with the
- * given value.
- *
- * @param value
- * one of the FontStyles
- * @return a display name of a FontStyle, or null if none found
- */
- public static String getFontStyleName(String value) {
- for (Iterator<FontStyle> iter = FONT_STYLES.iterator(); iter.hasNext();) {
- FontStyle style = iter.next();
- if (style.getValue().equals(value)) {
- return style.getName();
- }
- }
- return null;
- }
-
- /**
- * Gets the value of the <code>FontStyle</code> object with the
- * given display name.
- *
- * @param name
- * one of the FontStyles
- * @return a value of a FontStyle, or null if none found
- */
- public static String getFontStyleValue(String name) {
- for (Iterator<FontStyle> iter = FONT_STYLES.iterator(); iter.hasNext();) {
- FontStyle style = iter.next();
- if (style.getName().equals(name)) {
- return style.getValue();
- }
- }
- return null;
- }
-
-} \ No newline at end of file
diff --git a/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/html/Image.java b/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/html/Image.java
deleted file mode 100644
index 8a3a3a85e29..00000000000
--- a/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/html/Image.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-//------------------------------------------------------------------------------
-// Copyright (c) 2005, 2007 IBM Corporation 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:
-// IBM Corporation - initial implementation
-//------------------------------------------------------------------------------
-package org.eclipse.epf.richtext.html;
-
-/**
- * Models a simplified HTML &lt;image&gt; tag.
- *
- * @author Kelvin Low
- * @since 1.0
- */
-public class Image {
-
- // The image URL.
- private String url = ""; //$NON-NLS-1$
-
- /**
- * Creates a new instance.
- */
- public Image() {
- }
-
- /**
- * Gets the image URL.
- *
- * @return the image URL
- */
- public String getURL() {
- return url;
- }
-
- /**
- * Sets the image URL.
- *
- * @param url
- * the image URL
- */
- public void setURL(String url) {
- this.url = url;
- }
-
-}
diff --git a/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/html/Link.java b/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/html/Link.java
deleted file mode 100644
index 6c5573cc515..00000000000
--- a/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/html/Link.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-//------------------------------------------------------------------------------
-// Copyright (c) 2005, 2007 IBM Corporation 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:
-// IBM Corporation - initial implementation
-//------------------------------------------------------------------------------
-package org.eclipse.epf.richtext.html;
-
-/**
- * Models a simplified HTML &lt;link&gt; tag.
- *
- * @author Kelvin Low
- * @since 1.0
- */
-public class Link {
-
- // The link name.
- private String name = ""; //$NON-NLS-1$
-
- // The link URL.
- private String url = ""; //$NON-NLS-1$
-
- /**
- * Creates a new instance.
- */
- public Link() {
- }
-
- /**
- * Gets the link name.
- *
- * @return the link name.
- */
- public String getName() {
- return name;
- }
-
- /**
- * Sets the link name.
- *
- * @param name
- * the link name
- */
- public void setName(String name) {
- this.name = name;
- }
-
- /**
- * Gets the link URL.
- *
- * @return the link URL
- */
- public String getURL() {
- return url;
- }
-
- /**
- * Sets the link URL.
- *
- * @param url
- * the link URL
- */
- public void setURL(String url) {
- this.url = url;
- }
-
- /**
- * @Gets the HTML representation of this link.
- *
- * @return the HTML representation of this link
- */
- public String toHTML() {
- return null;
- }
-}
diff --git a/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/html/Table.java b/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/html/Table.java
deleted file mode 100644
index a02b28f89b4..00000000000
--- a/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/html/Table.java
+++ /dev/null
@@ -1,196 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-//------------------------------------------------------------------------------
-// Copyright (c) 2005, 2007 IBM Corporation 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:
-// IBM Corporation - initial implementation
-//------------------------------------------------------------------------------
-package org.eclipse.epf.richtext.html;
-
-/**
- * Models a simplified HTML &lt;table&gt; tag.
- *
- * @author Kelvin Low
- * @since 1.0
- */
-public class Table {
-
- /**
- * A table with no headers.
- */
- public static final int TABLE_HEADERS_NONE = 0;
-
- /**
- * A table with column headers.
- */
- public static final int TABLE_HEADERS_COLS = 1;
-
- /**
- * A table with row headers.
- */
- public static final int TABLE_HEADERS_ROWS = 2;
-
- /**
- * A table with both column and row headers.
- */
- public static final int TABLE_HEADERS_BOTH = 3;
-
- // The number of rows.
- private int rows = 2;
-
- // The number of columns.
- private int cols = 2;
-
- // The table width.
- private String width = "85%"; //$NON-NLS-1$
-
- // The type of tableheaders for this table.
- private int tableHeaders = 0;
-
- // The table summary.
- private String summary;
-
- // The table caption.
- private String caption;
-
- /**
- * Creates a new instance.
- */
- public Table() {
- }
-
- /**
- * Gets the number of rows in the table.
- *
- * @return the number of rows
- */
- public int getRows() {
- return rows;
- }
-
- /**
- * Sets the number of rows in the table.
- *
- * @param rows
- * the number of rows
- */
- public void setRows(int rows) {
- this.rows = rows;
- }
-
- /**
- * Gets the number of columns in the table.
- *
- * @return the number of columns
- */
- public int getColumns() {
- return cols;
- }
-
- /**
- * Sets the number of columns in the table.
- *
- * @param cols
- * the number of columns
- */
- public void setColumns(int cols) {
- this.cols = cols;
- }
-
- /**
- * Gets the table width.
- *
- * @return the width of the table
- */
- public String getWidth() {
- return width;
- }
-
- /**
- * Sets the table width.
- *
- * @param width
- * the width of the table
- */
- public void setWidth(String width) {
- this.width = width;
- }
-
- /**
- * Gets the table caption.
- *
- * @return the table caption
- */
- public String getCaption() {
- return caption;
- }
-
- /**
- * Sets the table caption.
- *
- * @para caption the table caption
- */
- public void setCaption(String caption) {
- this.caption = caption;
- }
-
- /**
- * Gets the table summary.
- *
- * @return the table summary
- */
- public String getSummary() {
- return summary;
- }
-
- /**
- * Sets the table summary.
- *
- * @param summary
- * the table summary
- */
- public void setSummary(String summary) {
- this.summary = summary;
- }
-
- /**
- * Gets the table headers style.
- *
- * @return the integer with value representing
- * <code>TABLE_HEADERS_NONE</code>,
- * <code>TABLE_HEADERS_COLS</code>,
- * <code>TABLE_HEADERS_ROWS</code> or
- * <code>TABLE_HEADERS_BOTH</code>
- */
- public int getTableHeaders() {
- return tableHeaders;
- }
-
- /**
- * Sets the table headers style.
- *
- * @param tableHeaders
- * an integer with value representing
- * <code>TABLE_HEADERS_NONE</code>,
- * <code>TABLE_HEADERS_COLS</code>,
- * <code>TABLE_HEADERS_ROWS</code> or
- * <code>TABLE_HEADERS_BOTH</code>
- */
- public void setTableHeaders(int tableHeaders) {
- this.tableHeaders = tableHeaders;
- }
-
-}
diff --git a/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/html/package.html b/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/html/package.html
deleted file mode 100644
index 7e143c8cf34..00000000000
--- a/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/html/package.html
+++ /dev/null
@@ -1,5 +0,0 @@
-<html>
-<body>
-Provides implementation support for the rich text control and editor.
-</body>
-</html> \ No newline at end of file
diff --git a/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/package.html b/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/package.html
deleted file mode 100644
index 0238fc370ea..00000000000
--- a/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/package.html
+++ /dev/null
@@ -1,5 +0,0 @@
-<html>
-<body>
-Provides the interfaces and implementation for the rich text control and editor.
-</body>
-</html> \ No newline at end of file
diff --git a/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/preferences/RichTextPreferencePage.java b/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/preferences/RichTextPreferencePage.java
deleted file mode 100644
index 6d3379fc763..00000000000
--- a/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/preferences/RichTextPreferencePage.java
+++ /dev/null
@@ -1,183 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-//------------------------------------------------------------------------------
-// Copyright (c) 2005, 2006 IBM Corporation 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:
-// IBM Corporation - initial implementation
-//------------------------------------------------------------------------------
-package org.eclipse.epf.richtext.preferences;
-
-import org.eclipse.epf.richtext.RichTextPlugin;
-import org.eclipse.epf.richtext.RichTextResources;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.preference.PreferencePage;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPreferencePage;
-
-/**
- * The Preference page for the rich text editor.
- *
- * @author Kelvin Low
- * @since 1.0
- */
-public class RichTextPreferencePage extends PreferencePage implements
- IWorkbenchPreferencePage, SelectionListener, ModifyListener {
-
- private IPreferenceStore store;
-
- private Text lineWidthText;
-
- private Button indentCheckbox;
-
- private Text indentSizeText;
-
- /**
- * @see org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench)
- */
- public void init(IWorkbench workbench) {
- store = RichTextPlugin.getDefault().getPreferenceStore();
- }
-
- /**
- * @see org.eclipse.jface.preference.PreferencePage#createContents(org.eclipse.swt.widgets.Composite)
- */
- protected Control createContents(Composite parent) {
- Composite composite = new Composite(parent, SWT.NONE);
- composite.setLayout(new GridLayout(1, false));
- composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
- Composite widthComposite = new Composite(composite, SWT.NONE);
- widthComposite.setLayout(new GridLayout(2, false));
- widthComposite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
- Label lineWidthLabel = new Label(widthComposite, SWT.NONE);
- lineWidthLabel.setText(RichTextResources.maxCharsPerLineLabel_text);
-
- lineWidthText = new Text(widthComposite, SWT.BORDER);
- lineWidthText.setText(store.getString(RichTextPreferences.LINE_WIDTH));
- lineWidthText.setTextLimit(3);
- GridData gridData = new GridData();
- gridData.widthHint = 25;
- lineWidthText.setLayoutData(gridData);
- lineWidthText.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- }
- });
-
- Composite indentComposite = new Composite(composite, SWT.NONE);
- indentComposite.setLayout(new GridLayout(2, false));
- indentComposite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
- indentCheckbox = new Button(indentComposite, SWT.CHECK);
- indentCheckbox.setText(RichTextResources.indentHTMLCheckbox_text);
- indentCheckbox.setSelection(store
- .getBoolean(RichTextPreferences.INDENT));
-
- new Label(indentComposite, SWT.NONE);
-
- Label indentSizeLabel = new Label(indentComposite, SWT.NONE);
- gridData = new GridData();
- gridData.horizontalIndent = 20;
- indentSizeLabel.setLayoutData(gridData);
- indentSizeLabel.setText(RichTextResources.indentSizeLabel_text);
-
- indentSizeText = new Text(indentComposite, SWT.BORDER);
- indentSizeText
- .setText(store.getString(RichTextPreferences.INDENT_SIZE));
- indentSizeText.setTextLimit(1);
- gridData = new GridData();
- gridData.widthHint = 10;
- indentSizeText.setLayoutData(gridData);
- indentSizeText.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- }
- });
-
- return composite;
- }
-
- /**
- * @see org.eclipse.jface.preference.PreferencePage.performDefaults
- */
- protected void performDefaults() {
- super.performDefaults();
- lineWidthText.setText(store
- .getDefaultString(RichTextPreferences.LINE_WIDTH));
- indentCheckbox.setSelection(store
- .getDefaultBoolean(RichTextPreferences.INDENT));
- indentSizeText.setText(store
- .getDefaultString(RichTextPreferences.INDENT_SIZE));
- }
-
- /**
- * @see org.eclipse.jface.preference.PreferencePage.performOk
- */
- public boolean performOk() {
- String lineWidthValue = lineWidthText.getText();
- if (lineWidthValue != null && lineWidthValue.length() > 0) {
- try {
- int lineWidth = Integer.parseInt(lineWidthValue);
- store.setValue(RichTextPreferences.LINE_WIDTH, lineWidth);
- } catch (Exception e) {
- }
- }
-
- boolean indentValue = indentCheckbox.getSelection();
- store.setValue(RichTextPreferences.INDENT, indentValue);
-
- String indentSizeValue = indentSizeText.getText();
- if (indentSizeValue != null && indentSizeValue.length() > 0) {
- try {
- int indentSize = Integer.parseInt(indentSizeValue);
- store.setValue(RichTextPreferences.INDENT_SIZE, indentSize);
- } catch (Exception e) {
- }
- }
-
- return true;
- }
-
- /**
- * @see org.eclipse.swt.events.SelectionListener#widgetSelected(SelectionEvent)
- */
- public void widgetSelected(SelectionEvent e) {
- }
-
- /**
- * @see org.eclipse.swt.events.SelectionListener#widgetDefaultSelected(SelectionEvent)
- */
- public void widgetDefaultSelected(SelectionEvent e) {
- }
-
- /**
- * @see org.eclipse.swt.events.ModifyListener#modifyText(ModifyEvent)
- */
- public void modifyText(ModifyEvent e) {
- }
-
-}
diff --git a/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/preferences/RichTextPreferences.java b/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/preferences/RichTextPreferences.java
deleted file mode 100644
index f593198c73f..00000000000
--- a/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/preferences/RichTextPreferences.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-//------------------------------------------------------------------------------
-// Copyright (c) 2005, 2006 IBM Corporation 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:
-// IBM Corporation - initial implementation
-//------------------------------------------------------------------------------
-package org.eclipse.epf.richtext.preferences;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-
-/**
- * Preferences for the rich text editor.
- *
- * @author Kelvin Low
- * @since 1.0
- */
-public class RichTextPreferences {
-
- /**
- * rich text Editor preference keys.
- */
- public static final String LINE_WIDTH = "htmlEditor.lineWidth"; //$NON-NLS-1$
-
- public static final String INDENT = "htmlEditor.indent"; //$NON-NLS-1$
-
- public static final String INDENT_SIZE = "htmlEditor.indentSize"; //$NON-NLS-1$
-
- /**
- * Initializes the default preferences.
- */
- public static void initializeDefaultPreferences(IPreferenceStore store) {
- store.setDefault(LINE_WIDTH, 120);
- store.setDefault(INDENT, true);
- store.setDefault(INDENT_SIZE, 4);
- }
-
-}
diff --git a/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/preferences/RichTextPreferencesInitializer.java b/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/preferences/RichTextPreferencesInitializer.java
deleted file mode 100644
index 8bdeb071fed..00000000000
--- a/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/preferences/RichTextPreferencesInitializer.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-//------------------------------------------------------------------------------
-// Copyright (c) 2005, 2006 IBM Corporation 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:
-// IBM Corporation - initial implementation
-//------------------------------------------------------------------------------
-package org.eclipse.epf.richtext.preferences;
-
-import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
-import org.eclipse.epf.richtext.RichTextPlugin;
-import org.eclipse.jface.preference.IPreferenceStore;
-
-/**
- * The rich text preferences initializer.
- *
- * @author Kelvin Low
- * @since 1.0
- */
-public class RichTextPreferencesInitializer extends
- AbstractPreferenceInitializer {
-
- /**
- * @see org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer#initializeDefaultPreferences()
- */
- public void initializeDefaultPreferences() {
- IPreferenceStore store = RichTextPlugin.getDefault()
- .getPreferenceStore();
- RichTextPreferences.initializeDefaultPreferences(store);
- }
-
-}
diff --git a/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/preferences/package.html b/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/preferences/package.html
deleted file mode 100644
index 292b3aeec02..00000000000
--- a/extraplugins/epf-richtext/org.eclipse.epf.richtext/src/org/eclipse/epf/richtext/preferences/package.html
+++ /dev/null
@@ -1,5 +0,0 @@
-<html>
-<body>
-Provides preference support for the rich text control and editor.
-</body>
-</html> \ No newline at end of file

Back to the top