org.tizen.web.editor.javascript_2.0.0.201311011708

16:50:40.518 INFO  jd.cli.Main - Decompiling org.tizen.web.editor.javascript_2.0.0.201311011708.jar
package org.tizen.web.editor.javascript;

import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.ui.IEditorRegistry;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.BundleContext;

public class Activator
  extends AbstractUIPlugin
{
  public static final String PLUGIN_ID = "org.tizen.web.editor.javascript";
  private static Activator plugin;
  
  public void start(BundleContext context)
    throws Exception
  {
    super.start(context);
    plugin = this;
    
    PlatformUI.getWorkbench().getEditorRegistry().setDefaultEditor("*.js", "org.tizen.web.editor.javascript.JavascriptEditor");
  }
  
  public void stop(BundleContext context)
    throws Exception
  {
    plugin = null;
    super.stop(context);
  }
  
  public static Activator getDefault()
  {
    return plugin;
  }
  
  public static ImageDescriptor getImageDescriptor(String path)
  {
    return imageDescriptorFromPlugin("org.tizen.web.editor.javascript", path);
  }
}

/* Location:
 * Qualified Name:     org.tizen.web.editor.javascript.Activator
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.web.editor.javascript;

import org.eclipse.jface.util.IPropertyChangeListener;
import org.eclipse.jface.util.PropertyChangeEvent;
import org.eclipse.ui.part.FileEditorInput;
import org.tizen.web.jslint.handlers.JSValidationHandler;

class JavascriptEditor$1
  implements IPropertyChangeListener
{
  JavascriptEditor$1(JavascriptEditor paramJavascriptEditor) {}
  
  public void propertyChange(PropertyChangeEvent event)
  {
    JSValidationHandler.runValidation(((FileEditorInput)this$0.getEditorInput()).getFile(), this$0);
  }
}

/* Location:
 * Qualified Name:     org.tizen.web.editor.javascript.JavascriptEditor.1
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.web.editor.javascript;

import java.io.IOException;
import java.net.URL;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.FileLocator;
import org.eclipse.core.runtime.Platform;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.util.IPropertyChangeListener;
import org.eclipse.jface.util.PropertyChangeEvent;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.help.IWorkbenchHelpSystem;
import org.eclipse.ui.part.FileEditorInput;
import org.eclipse.wst.jsdt.internal.ui.javaeditor.CompilationUnitEditor;
import org.osgi.framework.Bundle;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.tizen.web.jslint.Activator;
import org.tizen.web.jslint.handlers.JSValidationHandler;

public class JavascriptEditor
  extends CompilationUnitEditor
{
  protected final Logger logger = LoggerFactory.getLogger(getClass());
  public static final String EDITOR_ID = "org.tizen.web.editor.javascript.JavascriptEditor";
  public static final String EDITOR_CONTEXT = "org.tizen.web.editor.javascript.JavascriptEditor.context";
  public static final String RULER_CONTEXT = "org.tizen.web.editor.javascript.JavascriptEditor.ruler";
  private Composite parent;
  
  protected void initializeEditor()
  {
    super.initializeEditor();
  }
  
  public JavascriptEditor()
  {
    Activator.getDefault().getPreferenceStore().addPropertyChangeListener(listener);
    
    setEditorContextMenuId("org.tizen.web.editor.javascript.JavascriptEditor.context");
    setRulerContextMenuId("org.tizen.web.editor.javascript.JavascriptEditor.ruler");
  }
  
  protected void setPartName(String partName)
  {
    super.setPartName(partName);
  }
  
  public void dispose()
  {
    Activator.getDefault().getPreferenceStore().removePropertyChangeListener(listener);
    super.dispose();
  }
  
  public void createPartControl(Composite parent)
  {
    this.parent = parent;
    super.createPartControl(parent);
    
    PlatformUI.getWorkbench().getHelpSystem().setHelp(parent, "org.tizen.ide.web.javascript_editor_context");
  }
  
  public void setFocus()
  {
    parent.setFocus();
    super.setFocus();
  }
  
  private final IPropertyChangeListener listener = new IPropertyChangeListener()
  {
    public void propertyChange(PropertyChangeEvent event)
    {
      JSValidationHandler.runValidation(((FileEditorInput)getEditorInput()).getFile(), JavascriptEditor.this);
    }
  };
  
  protected void doSetInput(IEditorInput input)
    throws CoreException
  {
    super.doSetInput(input);
    if (input.getImageDescriptor() != null)
    {
      Image oldImage = input.getImageDescriptor().createImage();
      Bundle bundle = Platform.getBundle("org.tizen.web.editor.javascript");
      URL icon = bundle.getEntry("icons/javascript_file.png");
      try
      {
        Image image = new Image(oldImage.getDevice(), FileLocator.toFileURL(icon).getPath());
        setTitleImage(image);
      }
      catch (IOException e)
      {
        logger.error(e.getMessage(), e);
      }
    }
  }
}

/* Location:
 * Qualified Name:     org.tizen.web.editor.javascript.JavascriptEditor
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.web.editor.javascript.decorator;

import java.io.IOException;
import java.net.URL;
import org.eclipse.core.runtime.FileLocator;
import org.eclipse.core.runtime.Platform;
import org.eclipse.jface.viewers.ILabelDecorator;
import org.eclipse.jface.viewers.ILabelProviderListener;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.graphics.ImageData;
import org.osgi.framework.Bundle;

public class JavascriptFileDecorator
  implements ILabelDecorator
{
  public Image decorateImage(Image image, Object element)
  {
    Bundle bundle = Platform.getBundle("org.tizen.web.editor.javascript");
    URL icon_OK_URL = bundle.getEntry("icons/javascript_file.png");
    URL icon_warning_URL = bundle.getEntry("icons/javascript_file_warning.png");
    URL icon_error_URL = bundle.getEntry("icons/javascript_file_error.png");
    try
    {
      Image image_OK = new Image(image.getDevice(), FileLocator.toFileURL(icon_OK_URL).getPath());
      Image image_warning = new Image(image.getDevice(), FileLocator.toFileURL(icon_warning_URL).getPath());
      Image image_error = new Image(image.getDevice(), FileLocator.toFileURL(icon_error_URL).getPath());
      
      int color_incomming = image.getImageData().getPixel(2, 15);
      int color_OK = image_OK.getImageData().getPixel(2, 15);
      int color_warning = image_warning.getImageData().getPixel(2, 15);
      int color_error = image_error.getImageData().getPixel(2, 15);
      if ((color_incomming == color_OK) || (color_incomming == 0)) {
        return image_OK;
      }
      if (color_incomming == color_warning) {
        return image_warning;
      }
      if (color_incomming == color_error) {
        return image_error;
      }
      return image;
    }
    catch (IOException localIOException) {}
    return image;
  }
  
  public String decorateText(String text, Object element)
  {
    return null;
  }
  
  public void addListener(ILabelProviderListener listener) {}
  
  public void dispose() {}
  
  public boolean isLabelProperty(Object element, String property)
  {
    return false;
  }
  
  public void removeListener(ILabelProviderListener listener) {}
}

/* Location:
 * Qualified Name:     org.tizen.web.editor.javascript.decorator.JavascriptFileDecorator
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
1

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