htmltext

16:36:30.368 INFO  jd.cli.Main - Decompiling htmltext.jar
package org.eclipse.mylyn.htmltext.util;

import java.awt.Color;
import org.eclipse.swt.graphics.RGB;

public final class ColorConverter
{
  public static String convertRgbToHex(RGB rgb)
  {
    return toHex(red) + toHex(green) + toHex(blue);
  }
  
  private static String toHex(int color)
  {
    return new String(new char[] { "0123456789ABCDEF".charAt((color - color % 16) / 16), 
      "0123456789ABCDEF".charAt(color % 16) }, 0, 2);
  }
  
  public static RGB convertHexToRgb(String hex)
  {
    Color color = Color.decode("#" + hex);
    return new RGB(color.getRed(), color.getGreen(), color.getBlue());
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.htmltext.util.ColorConverter
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.htmltext;

import java.util.Iterator;
import java.util.List;
import java.util.Map;
import org.eclipse.swt.browser.Browser;
import org.eclipse.swt.browser.BrowserFunction;
import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;
import org.eclipse.swt.widgets.Event;

class HtmlComposer$ModifiedFunction
  extends BrowserFunction
{
  public HtmlComposer$ModifiedFunction(HtmlComposer paramHtmlComposer, Browser browser)
  {
    super(browser, "_delegate_modified");
  }
  
  public Object function(Object[] arguments)
  {
    if (arguments.length > 0)
    {
      String identifier = (String)arguments[0];
      Event event = new Event();
      widget = getBrowser();
      data = this;
      ModifyEvent modifyEvent = new ModifyEvent(event);
      ModifyListener modifyListener;
      if (HtmlComposer.access$0(this$0).get(identifier) != null)
      {
        List<ModifyListener> list = 
          (List)HtmlComposer.access$0(this$0).get(identifier);
        for (Iterator localIterator = list.iterator(); localIterator.hasNext();)
        {
          modifyListener = (ModifyListener)localIterator.next();
          modifyListener.modifyText(modifyEvent);
        }
      }
      else if (HtmlComposer.access$1(this$0).size() > 0)
      {
        for (ModifyListener listener : HtmlComposer.access$1(this$0)) {
          listener.modifyText(modifyEvent);
        }
      }
      HtmlComposer.access$0(this$0).remove(identifier);
    }
    return null;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.htmltext.HtmlComposer.ModifiedFunction
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.htmltext.listener;

import org.eclipse.mylyn.htmltext.events.NodeSelectionEvent;

public abstract interface NodeSelectionChangeListener
{
  public abstract void selectedNodeChanged(NodeSelectionEvent paramNodeSelectionEvent);
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.htmltext.listener.NodeSelectionChangeListener
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.htmltext;

import org.eclipse.swt.browser.Browser;
import org.eclipse.swt.browser.ProgressAdapter;
import org.eclipse.swt.browser.ProgressEvent;

class HtmlComposer$1
  extends ProgressAdapter
{
  HtmlComposer$1(HtmlComposer paramHtmlComposer) {}
  
  public void completed(ProgressEvent event)
  {
    HtmlComposer.access$4(this$0).execute("integration.eclipseRunning = true;");
    HtmlComposer.access$4(this$0).removeProgressListener(this);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.htmltext.HtmlComposer.1
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.htmltext.model;

public enum TriState
{
  ON("1.0"),  OFF("2.0"),  DISABLED("3.0");
  
  private final String representation;
  
  private TriState(String representation)
  {
    this.representation = representation;
  }
  
  public static TriState fromString(String str)
  {
    TriState[] arrayOfTriState;
    int j = (arrayOfTriState = values()).length;
    for (int i = 0; i < j; i++)
    {
      TriState state = arrayOfTriState[i];
      if (representation.equals(str)) {
        return state;
      }
    }
    return DISABLED;
  }
  
  public String getRepresentation()
  {
    return representation;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.htmltext.model.TriState
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.htmltext;

import java.io.IOException;
import java.net.URL;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.eclipse.core.runtime.FileLocator;
import org.eclipse.core.runtime.Path;
import org.eclipse.mylyn.htmltext.commands.Command;
import org.eclipse.mylyn.htmltext.commands.GetHtmlCommand;
import org.eclipse.mylyn.htmltext.commands.SetHtmlCommand;
import org.eclipse.mylyn.htmltext.configuration.Configuration;
import org.eclipse.mylyn.htmltext.events.NodeSelectionEvent;
import org.eclipse.mylyn.htmltext.listener.NodeSelectionChangeListener;
import org.eclipse.mylyn.htmltext.model.TriState;
import org.eclipse.mylyn.htmltext.util.ColorConverter;
import org.eclipse.swt.SWTException;
import org.eclipse.swt.accessibility.Accessible;
import org.eclipse.swt.browser.Browser;
import org.eclipse.swt.browser.BrowserFunction;
import org.eclipse.swt.browser.OpenWindowListener;
import org.eclipse.swt.browser.ProgressAdapter;
import org.eclipse.swt.browser.ProgressEvent;
import org.eclipse.swt.events.ControlListener;
import org.eclipse.swt.events.DisposeListener;
import org.eclipse.swt.events.FocusListener;
import org.eclipse.swt.events.HelpListener;
import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;
import org.eclipse.swt.events.PaintListener;
import org.eclipse.swt.events.TraverseListener;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.Cursor;
import org.eclipse.swt.graphics.Font;
import org.eclipse.swt.graphics.GC;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.graphics.Region;
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.Layout;
import org.eclipse.swt.widgets.Listener;
import org.eclipse.swt.widgets.Menu;
import org.eclipse.swt.widgets.Monitor;
import org.eclipse.swt.widgets.ScrollBar;
import org.eclipse.swt.widgets.Shell;

public class HtmlComposer
{
  private final Browser browser;
  
  private class ModifiedFunction
    extends BrowserFunction
  {
    public ModifiedFunction(Browser browser)
    {
      super("_delegate_modified");
    }
    
    public Object function(Object[] arguments)
    {
      if (arguments.length > 0)
      {
        String identifier = (String)arguments[0];
        Event event = new Event();
        widget = getBrowser();
        data = this;
        ModifyEvent modifyEvent = new ModifyEvent(event);
        ModifyListener modifyListener;
        if (pendingListenerCallBackMap.get(identifier) != null)
        {
          List<ModifyListener> list = 
            (List)pendingListenerCallBackMap.get(identifier);
          for (Iterator localIterator = list.iterator(); localIterator.hasNext();)
          {
            modifyListener = (ModifyListener)localIterator.next();
            modifyListener.modifyText(modifyEvent);
          }
        }
        else if (modifyListenerList.size() > 0)
        {
          for (ModifyListener listener : modifyListenerList) {
            listener.modifyText(modifyEvent);
          }
        }
        pendingListenerCallBackMap.remove(identifier);
      }
      return null;
    }
  }
  
  private class RenderCompleteFunction
    extends BrowserFunction
  {
    public RenderCompleteFunction(Browser browser)
    {
      super("_delegate_init");
    }
    
    public Object function(Object[] arguments)
    {
      initialize();
      return null;
    }
  }
  
  private class SelectionChangedFunction
    extends BrowserFunction
  {
    public SelectionChangedFunction(Browser browser)
    {
      super("_delegate_selectionChanged");
    }
    
    public Object function(Object[] arguments)
    {
      if (selectionListenerList.size() > 0)
      {
        NodeSelectionEvent nodeSelectionEvent = new NodeSelectionEvent(
          null);
        for (NodeSelectionChangeListener listener : selectionListenerList) {
          listener.selectedNodeChanged(nodeSelectionEvent);
        }
      }
      if (trackedCommands.size() > 0)
      {
        Set<String> keySet = trackedCommands.keySet();
        for (String string : keySet)
        {
          String valueOf = 
            String.valueOf(evaluate("return integration.editor.getCommand('" + 
            string + "').state;"));
          TriState fromString = TriState.fromString(valueOf);
          if (fromString != ((Command)trackedCommands.get(string)).getState()) {
            ((Command)trackedCommands.get(string)).setState(fromString);
          }
        }
      }
      return null;
    }
  }
  
  private transient List<NodeSelectionChangeListener> selectionListenerList = new ArrayList();
  private transient List<ModifyListener> modifyListenerList = new ArrayList();
  private final List<Command> pendingCommands = Collections.synchronizedList(new ArrayList());
  private Map<Command, List<ModifyListener>> pendingListeners = new HashMap();
  private Map<String, List<ModifyListener>> pendingListenerCallBackMap = new HashMap();
  private final Map<String, Command> trackedCommands = new HashMap();
  private boolean initialized;
  
  public HtmlComposer(Composite parent, int style)
  {
    this(parent, style, null);
  }
  
  public HtmlComposer(Composite parent, int style, Configuration config)
  {
    browser = new Browser(parent, style);
    browser.setMenu(new Menu(browser));
    new RenderCompleteFunction(browser);
    try
    {
      URL baseUrl = FileLocator.resolve(FileLocator.find(
        HtmlTextActivator.getDefault().getBundle(), new Path(
        "/eclipsebridge/base.html"), Collections.EMPTY_MAP));
      browser.setUrl(baseUrl.toString() + (config != null ? "?" + config.toQuery() : ""));
      browser.addProgressListener(new ProgressAdapter()
      {
        public void completed(ProgressEvent event)
        {
          browser.execute("integration.eclipseRunning = true;");
          browser.removeProgressListener(this);
        }
      });
    }
    catch (IOException e)
    {
      throw new RuntimeException(e);
    }
    URL baseUrl;
  }
  
  public void addControlListener(ControlListener listener)
  {
    browser.addControlListener(listener);
  }
  
  public void addDisposeListener(DisposeListener listener)
  {
    browser.addDisposeListener(listener);
  }
  
  public void addFocusListener(FocusListener listener)
  {
    browser.addFocusListener(listener);
  }
  
  public void addHelpListener(HelpListener listener)
  {
    browser.addHelpListener(listener);
  }
  
  public void addModifyListener(ModifyListener listener)
  {
    modifyListenerList.add(listener);
  }
  
  public void addNodeSelectionChangeListener(NodeSelectionChangeListener listener)
  {
    selectionListenerList.add(listener);
  }
  
  public void addPaintListener(PaintListener listener)
  {
    browser.addPaintListener(listener);
  }
  
  public void addTraverseListener(TraverseListener listener)
  {
    browser.addTraverseListener(listener);
  }
  
  public Point computeSize(int wHint, int hHint)
  {
    return browser.computeSize(wHint, hHint);
  }
  
  public Point computeSize(int wHint, int hHint, boolean changed)
  {
    return browser.computeSize(wHint, hHint, changed);
  }
  
  public Rectangle computeTrim(int x, int y, int width, int height)
  {
    return browser.computeTrim(x, y, width, height);
  }
  
  public void dispose()
  {
    Collection<Command> values = trackedCommands.values();
    for (Command command : values) {
      command.dispose();
    }
    browser.dispose();
  }
  
  public Object evaluate(String script)
    throws SWTException
  {
    return browser.evaluate(script);
  }
  
  public boolean execute(String script)
  {
    return browser.execute(script);
  }
  
  public void execute(Command command)
  {
    if (initialized)
    {
      if (pendingListeners.get(command) != null)
      {
        String nanoTime = String.valueOf(System.nanoTime());
        pendingListenerCallBackMap.put(nanoTime, 
          (List)pendingListeners.get(command));
        execute("integration.pendingCommandIdentifier = '" + nanoTime + 
          "';");
        execute(command.getCommand());
        pendingListeners.remove(command);
      }
      else
      {
        execute("integration.pendingCommandIdentifier = '';");
        execute(command.getCommand());
      }
    }
    else
    {
      pendingListeners.put(command, new ArrayList(
        modifyListenerList));
      pendingCommands.add(command);
    }
  }
  
  public Object executeWithReturn(Command command)
  {
    if (initialized) {
      return evaluate(command.getCommand());
    }
    return null;
  }
  
  public boolean forceFocus()
  {
    return browser.forceFocus();
  }
  
  public Accessible getAccessible()
  {
    return browser.getAccessible();
  }
  
  public Color getBackground()
  {
    return browser.getBackground();
  }
  
  public Image getBackgroundImage()
  {
    return browser.getBackgroundImage();
  }
  
  public int getBackgroundMode()
  {
    return browser.getBackgroundMode();
  }
  
  public int getBorderWidth()
  {
    return browser.getBorderWidth();
  }
  
  public Rectangle getBounds()
  {
    return browser.getBounds();
  }
  
  public Browser getBrowser()
  {
    return browser;
  }
  
  public Control[] getChildren()
  {
    return browser.getChildren();
  }
  
  public Rectangle getClientArea()
  {
    return browser.getClientArea();
  }
  
  public Cursor getCursor()
  {
    return browser.getCursor();
  }
  
  public Object getData()
  {
    return browser.getData();
  }
  
  public Object getData(String key)
  {
    return browser.getData(key);
  }
  
  public Display getDisplay()
  {
    return browser.getDisplay();
  }
  
  public boolean getEnabled()
  {
    return browser.getEnabled();
  }
  
  public Font getFont()
  {
    return browser.getFont();
  }
  
  public Color getForeground()
  {
    return browser.getForeground();
  }
  
  public ScrollBar getHorizontalBar()
  {
    return browser.getHorizontalBar();
  }
  
  public String getHtml()
  {
    GetHtmlCommand getHtmlCommand = new GetHtmlCommand();
    getHtmlCommand.setComposer(this);
    Object executeWithReturn = executeWithReturn(getHtmlCommand);
    if (executeWithReturn != null) {
      return String.valueOf(executeWithReturn);
    }
    return null;
  }
  
  public Layout getLayout()
  {
    return browser.getLayout();
  }
  
  public Object getLayoutData()
  {
    return browser.getLayoutData();
  }
  
  public boolean getLayoutDeferred()
  {
    return browser.getLayoutDeferred();
  }
  
  public Listener[] getListeners(int eventType)
  {
    return browser.getListeners(eventType);
  }
  
  public Point getLocation()
  {
    return browser.getLocation();
  }
  
  public Menu getMenu()
  {
    return browser.getMenu();
  }
  
  public Monitor getMonitor()
  {
    return browser.getMonitor();
  }
  
  public Composite getParent()
  {
    return browser.getParent();
  }
  
  public Region getRegion()
  {
    return browser.getRegion();
  }
  
  public Shell getShell()
  {
    return browser.getShell();
  }
  
  public Point getSize()
  {
    return browser.getSize();
  }
  
  public int getStyle()
  {
    return browser.getStyle();
  }
  
  public Control[] getTabList()
  {
    return browser.getTabList();
  }
  
  public ScrollBar getVerticalBar()
  {
    return browser.getVerticalBar();
  }
  
  public boolean getVisible()
  {
    return browser.getVisible();
  }
  
  public Object getWebBrowser()
  {
    return browser.getWebBrowser();
  }
  
  void initialize()
  {
    new SelectionChangedFunction(browser);
    new ModifiedFunction(browser);
    initialized = true;
    for (Command command : pendingCommands) {
      execute(command);
    }
    pendingCommands.clear();
  }
  
  public boolean isDisposed()
  {
    return browser.isDisposed();
  }
  
  public boolean isEnabled()
  {
    return browser.isEnabled();
  }
  
  public boolean isFocusControl()
  {
    return browser.isFocusControl();
  }
  
  public boolean isLayoutDeferred()
  {
    return browser.isLayoutDeferred();
  }
  
  public boolean isListening(int eventType)
  {
    return browser.isListening(eventType);
  }
  
  public boolean isReparentable()
  {
    return browser.isReparentable();
  }
  
  public boolean isVisible()
  {
    return browser.isVisible();
  }
  
  public void layout()
  {
    browser.layout();
  }
  
  public void layout(boolean changed)
  {
    browser.layout(changed);
  }
  
  public void layout(boolean changed, boolean all)
  {
    browser.layout(changed, all);
  }
  
  public void layout(Control[] changed)
  {
    browser.layout(changed);
  }
  
  public void moveAbove(Control control)
  {
    browser.moveAbove(control);
  }
  
  public void moveBelow(Control control)
  {
    browser.moveBelow(control);
  }
  
  public void notifyListeners(int eventType, Event event)
  {
    browser.notifyListeners(eventType, event);
  }
  
  public void pack()
  {
    browser.pack();
  }
  
  public void pack(boolean changed)
  {
    browser.pack(changed);
  }
  
  public boolean print(GC gc)
  {
    return browser.print(gc);
  }
  
  public void redraw()
  {
    browser.redraw();
  }
  
  public void redraw(int x, int y, int width, int height, boolean all)
  {
    browser.redraw(x, y, width, height, all);
  }
  
  public void refresh()
  {
    browser.refresh();
  }
  
  public void removeDisposeListener(DisposeListener listener)
  {
    browser.removeDisposeListener(listener);
  }
  
  public void removeFocusListener(FocusListener listener)
  {
    browser.removeFocusListener(listener);
  }
  
  public void removeHelpListener(HelpListener listener)
  {
    browser.removeHelpListener(listener);
  }
  
  public void removeModifyListener(ModifyListener listener)
  {
    modifyListenerList.remove(listener);
  }
  
  public void removeNodeSelectionChangeListener(NodeSelectionChangeListener listener)
  {
    selectionListenerList.remove(listener);
  }
  
  public void removeOpenWindowListener(OpenWindowListener listener)
  {
    browser.removeOpenWindowListener(listener);
  }
  
  public void removePaintListener(PaintListener listener)
  {
    browser.removePaintListener(listener);
  }
  
  public void removeTraverseListener(TraverseListener listener)
  {
    browser.removeTraverseListener(listener);
  }
  
  public void setBackground(final Color color)
  {
    browser.setBackground(color);
    execute(new Command()
    {
      public String getCommandIdentifier()
      {
        return "set_background_internal";
      }
      
      public String getCommand()
      {
        String hexValue = color != null ? "#" + 
          ColorConverter.convertRgbToHex(color.getRGB()) : "";
        return "document.getElementById('cke_editor1_arialbl').nextSibling.style.backgroundColor = '" + 
          hexValue + "';";
      }
    });
  }
  
  public void setBackgroundImage(Image image)
  {
    browser.setBackgroundImage(image);
  }
  
  public void setBackgroundMode(int mode)
  {
    browser.setBackgroundMode(mode);
  }
  
  public void setBounds(int x, int y, int width, int height)
  {
    browser.setBounds(x, y, width, height);
  }
  
  public void setBounds(Rectangle rect)
  {
    browser.setBounds(rect);
  }
  
  public void setCapture(boolean capture)
  {
    browser.setCapture(capture);
  }
  
  public void setCursor(Cursor cursor)
  {
    browser.setCursor(cursor);
  }
  
  public void setData(Object data)
  {
    browser.setData(data);
  }
  
  public void setData(String key, Object value)
  {
    browser.setData(key, value);
  }
  
  public void setEnabled(boolean enabled)
  {
    browser.setEnabled(enabled);
  }
  
  public boolean setFocus()
  {
    boolean setFocus = browser.setFocus();
    browser.execute("integration.editor.focus();");
    return setFocus;
  }
  
  public void setFont(Font font)
  {
    browser.setFont(font);
  }
  
  public void setForeground(Color color)
  {
    browser.setForeground(color);
  }
  
  public void setHtml(String html)
  {
    SetHtmlCommand setHtmlCommand = new SetHtmlCommand();
    setHtmlCommand.setComposer(this);
    setHtmlCommand.setHtml(html);
    execute(setHtmlCommand);
  }
  
  public void setLayout(Layout layout)
  {
    browser.setLayout(layout);
  }
  
  public void setLayoutData(Object layoutData)
  {
    browser.setLayoutData(layoutData);
  }
  
  public void setLayoutDeferred(boolean defer)
  {
    browser.setLayoutDeferred(defer);
  }
  
  public void setLocation(int x, int y)
  {
    browser.setLocation(x, y);
  }
  
  public void setLocation(Point location)
  {
    browser.setLocation(location);
  }
  
  public void setMenu(Menu menu)
  {
    browser.setMenu(menu);
  }
  
  public boolean setParent(Composite parent)
  {
    return browser.setParent(parent);
  }
  
  public void setRedraw(boolean redraw)
  {
    browser.setRedraw(redraw);
  }
  
  public void setRegion(Region region)
  {
    browser.setRegion(region);
  }
  
  public void setSize(int width, int height)
  {
    browser.setSize(width, height);
  }
  
  public void setSize(Point size)
  {
    browser.setSize(size);
  }
  
  public void setTabList(Control[] tabList)
  {
    browser.setTabList(tabList);
  }
  
  public void setVisible(boolean visible)
  {
    browser.setVisible(visible);
  }
  
  public Point toControl(int x, int y)
  {
    return browser.toControl(x, y);
  }
  
  public Point toControl(Point point)
  {
    return browser.toControl(point);
  }
  
  public Point toDisplay(int x, int y)
  {
    return browser.toDisplay(x, y);
  }
  
  public Point toDisplay(Point point)
  {
    return browser.toDisplay(point);
  }
  
  public String toString()
  {
    return browser.toString();
  }
  
  public void trackCommand(Command command)
  {
    trackedCommands.put(command.getCommandIdentifier(), command);
  }
  
  public boolean traverse(int traversal)
  {
    return browser.traverse(traversal);
  }
  
  public void untrackCommand(Command command)
  {
    trackedCommands.remove(command.getCommandIdentifier());
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.htmltext.HtmlComposer
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.htmltext;

import org.eclipse.mylyn.htmltext.commands.Command;
import org.eclipse.mylyn.htmltext.util.ColorConverter;
import org.eclipse.swt.graphics.Color;

class HtmlComposer$2
  extends Command
{
  HtmlComposer$2(HtmlComposer paramHtmlComposer, Color paramColor) {}
  
  public String getCommandIdentifier()
  {
    return "set_background_internal";
  }
  
  public String getCommand()
  {
    String hexValue = val$color != null ? "#" + 
      ColorConverter.convertRgbToHex(val$color.getRGB()) : "";
    return "document.getElementById('cke_editor1_arialbl').nextSibling.style.backgroundColor = '" + 
      hexValue + "';";
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.htmltext.HtmlComposer.2
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.htmltext.configuration;

public class EnterModeConfiguration
  extends ConfigurationElement
{
  public static enum EnterMode
  {
    BR("BR"),  P("P"),  DIV("DIV");
    
    private final String strRepresentation;
    
    private EnterMode(String strRepresentation)
    {
      this.strRepresentation = strRepresentation;
    }
    
    public String getStrRepresentation()
    {
      return strRepresentation;
    }
  }
  
  public EnterModeConfiguration(EnterMode mode)
  {
    super("enterMode", mode);
  }
  
  protected EnterMode doGetDefaultValue()
  {
    return EnterMode.P;
  }
  
  public String getValueForEditor()
  {
    return ((EnterMode)value).getStrRepresentation();
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.htmltext.configuration.EnterModeConfiguration
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.htmltext.configuration;

public class UseEntitiesConfiguration
  extends ConfigurationElement
{
  public UseEntitiesConfiguration(boolean value)
  {
    super("entities", Boolean.valueOf(value));
  }
  
  protected Object doGetDefaultValue()
  {
    return Boolean.TRUE;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.htmltext.configuration.UseEntitiesConfiguration
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.htmltext.configuration;

public class ShiftEnterModeConfiguration
  extends ConfigurationElement
{
  public ShiftEnterModeConfiguration(EnterModeConfiguration.EnterMode mode)
  {
    super("shiftEnterMode", mode);
  }
  
  protected EnterModeConfiguration.EnterMode doGetDefaultValue()
  {
    return EnterModeConfiguration.EnterMode.BR;
  }
  
  public String getValueForEditor()
  {
    return ((EnterModeConfiguration.EnterMode)value).getStrRepresentation();
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.htmltext.configuration.ShiftEnterModeConfiguration
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.htmltext.configuration;

import java.util.ArrayList;
import java.util.List;

public class Configuration
{
  private static final String QUERY_SEPARATOR = "&";
  private List<ConfigurationElement> configNodes;
  
  public Configuration() {}
  
  public Configuration(List<ConfigurationElement> configNodes)
  {
    this.configNodes = configNodes;
  }
  
  public void addConfigurationNode(ConfigurationElement element)
  {
    if (configNodes == null) {
      configNodes = new ArrayList();
    }
    configNodes.add(element);
  }
  
  public String toQuery()
  {
    StringBuffer sb = new StringBuffer();
    if (configNodes != null) {
      for (ConfigurationElement element : configNodes)
      {
        String query = element.toQuery();
        if ((query != null) && (query.length() > 0)) {
          sb.append(query).append("&");
        }
      }
    }
    return sb.toString();
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.htmltext.configuration.Configuration
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.htmltext.configuration;

import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;

public abstract class ConfigurationElement
{
  private String ckConfigElement;
  protected Object value;
  
  protected ConfigurationElement(String ckConfigElement, Object value)
  {
    this.ckConfigElement = ckConfigElement;
    this.value = value;
  }
  
  public String getCkConfigElement()
  {
    return ckConfigElement;
  }
  
  protected abstract Object doGetDefaultValue();
  
  public final Object getDefaultValue()
  {
    return doGetDefaultValue();
  }
  
  public String toQuery()
  {
    StringBuffer sb = new StringBuffer();
    if ((value != null) && (!value.equals(getDefaultValue()))) {
      try
      {
        String valueForEditor = 
          URLEncoder.encode(getValueForEditor(), "UTF-8");
        if (valueForEditor != null) {
          sb.append(ckConfigElement).append("=").append(valueForEditor);
        }
      }
      catch (UnsupportedEncodingException e)
      {
        throw new IllegalStateException(e);
      }
    }
    return sb.toString();
  }
  
  public String getValueForEditor()
  {
    return value == null ? null : value.toString();
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.htmltext.configuration.ConfigurationElement
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.htmltext.configuration;

public enum EnterModeConfiguration$EnterMode
{
  BR("BR"),  P("P"),  DIV("DIV");
  
  private final String strRepresentation;
  
  private EnterModeConfiguration$EnterMode(String strRepresentation)
  {
    this.strRepresentation = strRepresentation;
  }
  
  public String getStrRepresentation()
  {
    return strRepresentation;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.htmltext.configuration.EnterModeConfiguration.EnterMode
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.htmltext.configuration;

public class AutoparagrahConfiguration
  extends ConfigurationElement
{
  public AutoparagrahConfiguration(boolean value)
  {
    super("autoParagraph", Boolean.valueOf(value));
  }
  
  protected Object doGetDefaultValue()
  {
    return Boolean.FALSE;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.htmltext.configuration.AutoparagrahConfiguration
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.htmltext.commands.list;

import org.eclipse.mylyn.htmltext.commands.Command;

public class NumlistCommand
  extends Command
{
  public String getCommandIdentifier()
  {
    return "numberedlist";
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.htmltext.commands.list.NumlistCommand
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.htmltext.commands.list;

import org.eclipse.mylyn.htmltext.commands.Command;

public class BulletlistCommand
  extends Command
{
  public String getCommandIdentifier()
  {
    return "bulletedlist";
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.htmltext.commands.list.BulletlistCommand
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.htmltext.commands.justify;

import org.eclipse.mylyn.htmltext.commands.Command;

public class JustifyCenterCommand
  extends Command
{
  public String getCommandIdentifier()
  {
    return "justifycenter";
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.htmltext.commands.justify.JustifyCenterCommand
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.htmltext.commands.justify;

import org.eclipse.mylyn.htmltext.commands.Command;

public class JustifyRightCommand
  extends Command
{
  public String getCommandIdentifier()
  {
    return "justifyright";
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.htmltext.commands.justify.JustifyRightCommand
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.htmltext.commands.justify;

import org.eclipse.mylyn.htmltext.commands.Command;

public class JustifyLeftCommand
  extends Command
{
  public String getCommandIdentifier()
  {
    return "justifyleft";
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.htmltext.commands.justify.JustifyLeftCommand
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.htmltext.commands.justify;

import org.eclipse.mylyn.htmltext.commands.Command;

public class JustifyBlockCommand
  extends Command
{
  public String getCommandIdentifier()
  {
    return "justifyblock";
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.htmltext.commands.justify.JustifyBlockCommand
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.htmltext.commands.dialog;

import org.eclipse.mylyn.htmltext.commands.Command;

public class InsertEditTableCommand
  extends Command
{
  public String getCommandIdentifier()
  {
    return "table";
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.htmltext.commands.dialog.InsertEditTableCommand
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.htmltext.commands.dialog;

import org.eclipse.mylyn.htmltext.commands.Command;

public class InsertEditImageCommand
  extends Command
{
  public String getCommandIdentifier()
  {
    return "image";
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.htmltext.commands.dialog.InsertEditImageCommand
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.htmltext.commands.dialog;

import org.eclipse.mylyn.htmltext.commands.Command;

public class InsertEditAnchorCommand
  extends Command
{
  public String getCommandIdentifier()
  {
    return "anchor";
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.htmltext.commands.dialog.InsertEditAnchorCommand
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.htmltext.commands.dialog;

import org.eclipse.mylyn.htmltext.commands.Command;

public class InsertEditLinkCommand
  extends Command
{
  public String getCommandIdentifier()
  {
    return "link";
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.htmltext.commands.dialog.InsertEditLinkCommand
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.htmltext.commands.indent;

import org.eclipse.mylyn.htmltext.commands.Command;

public class OutdentCommand
  extends Command
{
  public String getCommandIdentifier()
  {
    return "outdent";
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.htmltext.commands.indent.OutdentCommand
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.htmltext.commands.indent;

import org.eclipse.mylyn.htmltext.commands.Command;

public class IndentCommand
  extends Command
{
  public String getCommandIdentifier()
  {
    return "indent";
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.htmltext.commands.indent.IndentCommand
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.htmltext.commands;

public class GetHtmlCommand
  extends Command
{
  public String getCommandIdentifier()
  {
    return "gethtml";
  }
  
  public String getCommand()
  {
    return "return integration.editor.getData();";
  }
  
  protected boolean trackCommand()
  {
    return false;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.htmltext.commands.GetHtmlCommand
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.htmltext.commands.formatting;

import org.eclipse.mylyn.htmltext.HtmlComposer;
import org.eclipse.mylyn.htmltext.commands.Command;
import org.eclipse.swt.browser.Browser;
import org.eclipse.swt.browser.BrowserFunction;

public class SetFormatCommand
  extends Command
{
  private String selectedFormat;
  private String formatOfSelection;
  
  public String getCommandIdentifier()
  {
    return "setformat";
  }
  
  public String getCommand()
  {
    return "integration.format.setStyle('" + selectedFormat + "');";
  }
  
  public void setFormatToWidget(String selectedFormat)
  {
    this.selectedFormat = selectedFormat;
  }
  
  public String getFormatOfSelection()
  {
    return formatOfSelection;
  }
  
  public void setComposer(HtmlComposer composer)
  {
    super.setComposer(composer);
    new FormatChangeFunction(composer.getBrowser());
  }
  
  public void setFormatOfSelection(String formatOfSelection)
  {
    String oldValue = this.formatOfSelection;
    this.formatOfSelection = formatOfSelection;
    firePropertyChange("formatOfSelection", oldValue, formatOfSelection);
  }
  
  private class FormatChangeFunction
    extends BrowserFunction
  {
    public FormatChangeFunction(Browser browser)
    {
      super("_delegate_selectedformat");
    }
    
    public Object function(Object[] arguments)
    {
      setFormatOfSelection(String.valueOf(arguments[0]));
      return null;
    }
  }
  
  protected boolean trackCommand()
  {
    return false;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.htmltext.commands.formatting.SetFormatCommand
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.htmltext.commands.formatting;

import org.eclipse.mylyn.htmltext.commands.Command;
import org.eclipse.mylyn.htmltext.util.ColorConverter;
import org.eclipse.swt.graphics.RGB;

public class SetBackgroundColorCommand
  extends Command
{
  private String color;
  
  public String getCommandIdentifier()
  {
    return "setBackground";
  }
  
  public String getCommand()
  {
    return 
      "new CKEDITOR.style(CKEDITOR.instances.editor1.config['colorButton_backStyle'], { color : '#" + color + "' } ).apply( CKEDITOR.instances.editor1.document );";
  }
  
  public void setColor(String hexCode)
  {
    color = hexCode;
  }
  
  public void setColor(RGB color)
  {
    this.color = ColorConverter.convertRgbToHex(color);
  }
  
  protected boolean trackCommand()
  {
    return false;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.htmltext.commands.formatting.SetBackgroundColorCommand
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.htmltext.commands.formatting;

import org.eclipse.mylyn.htmltext.HtmlComposer;
import org.eclipse.mylyn.htmltext.commands.Command;
import org.eclipse.swt.browser.Browser;
import org.eclipse.swt.browser.BrowserFunction;

public class SetSizeCommand
  extends Command
{
  private String setSelectedSize;
  private String sizeOfSelection;
  
  public String getCommandIdentifier()
  {
    return "setsize";
  }
  
  public String getCommand()
  {
    return "integration.format.setSize(" + setSelectedSize + ");";
  }
  
  public String[] getAvailableSizes()
  {
    String sizeString = String.valueOf(composer.evaluate("return integration.format.getAvailableSizes();"));
    String[] split = sizeString.split(";");
    String[] returnValue = new String[split.length];
    int i = 0;
    for (int n = split.length; i < n; i++) {
      returnValue[i] = split[i].split("/")[0];
    }
    return returnValue;
  }
  
  public void setSizeToWidget(String selectedFormat)
  {
    setSelectedSize = selectedFormat;
  }
  
  public String getSizeOfSelection()
  {
    return sizeOfSelection;
  }
  
  public void setComposer(HtmlComposer composer)
  {
    super.setComposer(composer);
    new FormatChangeFunction(composer.getBrowser());
  }
  
  public void setSizeOfSelection(String sizeOfSelection)
  {
    String oldValue = this.sizeOfSelection;
    this.sizeOfSelection = sizeOfSelection;
    firePropertyChange("sizeOfSelection", oldValue, sizeOfSelection);
  }
  
  private class FormatChangeFunction
    extends BrowserFunction
  {
    public FormatChangeFunction(Browser browser)
    {
      super("_delegate_selectedsize");
    }
    
    public Object function(Object[] arguments)
    {
      setSizeOfSelection(String.valueOf(arguments[0]));
      return null;
    }
  }
  
  protected boolean trackCommand()
  {
    return false;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.htmltext.commands.formatting.SetSizeCommand
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.htmltext.commands.formatting;

import org.eclipse.mylyn.htmltext.commands.Command;

public class InsertHrCommand
  extends Command
{
  public String getCommandIdentifier()
  {
    return "horizontalrule";
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.htmltext.commands.formatting.InsertHrCommand
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.htmltext.commands.formatting;

import org.eclipse.mylyn.htmltext.commands.Command;

public class UnlinkCommand
  extends Command
{
  public String getCommandIdentifier()
  {
    return "unlink";
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.htmltext.commands.formatting.UnlinkCommand
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.htmltext.commands.formatting;

import org.eclipse.mylyn.htmltext.commands.Command;
import org.eclipse.mylyn.htmltext.util.ColorConverter;
import org.eclipse.
1 2

Further reading...

For more information on Java 1.5 Tiger, you may find Java 1.5 Tiger, A developer's Notebook by D. Flanagan and B. McLaughlin from O'Reilly of interest.

New!JAR listings


Copyright 2006-2017. Infinite Loop Ltd