org.eclipse.wst.common.snippets_1.2.100.v201103281740

16:48:54.942 INFO  jd.cli.Main - Decompiling org.eclipse.wst.common.snippets_1.2.100.v201103281740.jar
package org.eclipse.wst.common.snippets.core;

public abstract interface ISnippetCategory
  extends ISnippetsEntry
{
  public abstract ISnippetItem[] getItems();
}

/* Location:
 * Qualified Name:     org.eclipse.wst.common.snippets.core.ISnippetCategory
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.common.snippets.core;

public abstract interface ISnippetItem
  extends ISnippetsEntry
{
  public abstract ISnippetCategory getCategory();
  
  public abstract String getContentString();
  
  public abstract ISnippetVariable[] getVariables();
}

/* Location:
 * Qualified Name:     org.eclipse.wst.common.snippets.core.ISnippetItem
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.common.snippets.core;

import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.gef.palette.PaletteEntry;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.ui.IEditorPart;
import org.eclipse.wst.common.snippets.internal.editors.ISnippetEditor;
import org.eclipse.wst.common.snippets.internal.palette.SnippetPaletteItem;
import org.eclipse.wst.common.snippets.ui.ISnippetInsertion;

public abstract interface ISnippetProvider
{
  public abstract SnippetPaletteItem createSnippet(PaletteEntry paramPaletteEntry)
    throws CoreException;
  
  public abstract boolean isActionEnabled(ISelection paramISelection);
  
  public abstract IStatus saveAdditionalContent(IPath paramIPath);
  
  public abstract ISnippetInsertion getSnippetInsertion();
  
  public abstract String getId();
  
  public abstract void setEditor(IEditorPart paramIEditorPart);
  
  public abstract ISnippetEditor getSnippetEditor();
}

/* Location:
 * Qualified Name:     org.eclipse.wst.common.snippets.core.ISnippetProvider
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.common.snippets.core;

public abstract interface ISnippetVariable
{
  public abstract String getDefaultValue();
  
  public abstract String getDescription();
  
  public abstract String getName();
}

/* Location:
 * Qualified Name:     org.eclipse.wst.common.snippets.core.ISnippetVariable
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.common.snippets.core;

public abstract interface ISnippetsEntry
{
  public static final String SNIPPET_SOURCE_PLUGINS = "PLUGINS";
  public static final String SNIPPET_SOURCE_USER = "USER";
  public static final String SNIPPET_SOURCE_WORKSPACE = "WORKSPACE";
  
  public abstract String getDescription();
  
  public abstract String[] getFilters();
  
  public abstract String getId();
  
  public abstract String getLabel();
  
  public abstract Object getSourceDescriptor();
  
  public abstract Object getSourceType();
}

/* Location:
 * Qualified Name:     org.eclipse.wst.common.snippets.core.ISnippetsEntry
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.common.snippets.internal;

import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.gef.palette.PaletteEntry;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.IWorkbenchPartSite;
import org.eclipse.wst.common.snippets.core.ISnippetProvider;
import org.eclipse.wst.common.snippets.internal.editors.ISnippetEditor;
import org.eclipse.wst.common.snippets.internal.palette.SnippetPaletteItem;
import org.eclipse.wst.common.snippets.internal.palette.SnippetPaletteItemFactory;

public abstract class AbstractSnippetProvider
  implements ISnippetProvider
{
  protected IEditorPart fEditorPart;
  
  public void setEditor(IEditorPart editor)
  {
    fEditorPart = editor;
  }
  
  public SnippetPaletteItem createSnippet(PaletteEntry drawer)
    throws CoreException
  {
    SnippetPaletteItem snippet = createSnippetMetadata(drawer);
    return snippet;
  }
  
  protected SnippetPaletteItem createSnippetMetadata(PaletteEntry drawer)
    throws CoreException
  {
    SnippetPaletteItem item = (SnippetPaletteItem)new SnippetPaletteItemFactory().createNewEntry(fEditorPart.getSite().getShell(), drawer);
    
    item.setProvider(this);
    IStatus status = saveAdditionalContent(item.getStorageLocation());
    if ((status != null) && (status.getSeverity() == 4)) {
      throw new CoreException(status);
    }
    return item;
  }
  
  public ISnippetEditor getSnippetEditor()
  {
    return null;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.common.snippets.internal.AbstractSnippetProvider
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.common.snippets.internal;

import com.ibm.icu.text.Collator;
import java.util.Arrays;
import java.util.List;
import org.eclipse.wst.common.snippets.core.ISnippetCategory;
import org.eclipse.wst.common.snippets.core.ISnippetItem;
import org.eclipse.wst.common.snippets.core.ISnippetsEntry;
import org.eclipse.wst.common.snippets.internal.util.Sorter;

public class EntrySorter
  extends Sorter
{
  public static ISnippetCategory[] sortCategories(Object[] categories)
  {
    Object[] sortedEntries = new EntrySorter().sort(categories);
    ISnippetCategory[] results = new ISnippetCategory[sortedEntries.length];
    for (int i = 0; i < results.length; i++) {
      results[i] = ((ISnippetCategory)sortedEntries[i]);
    }
    return results;
  }
  
  public static List sortEntries(List entries)
  {
    return Arrays.asList(new EntrySorter().sort(entries.toArray()));
  }
  
  public static ISnippetItem[] sortItems(Object[] items)
  {
    Object[] sortedEntries = new EntrySorter().sort(items);
    ISnippetItem[] results = new ISnippetItem[sortedEntries.length];
    for (int i = 0; i < results.length; i++) {
      results[i] = ((ISnippetItem)sortedEntries[i]);
    }
    return results;
  }
  
  Collator collator = Collator.getInstance();
  
  public boolean compare(Object elementOne, Object elementTwo)
  {
    ISnippetsEntry entry1 = (ISnippetsEntry)elementOne;
    ISnippetsEntry entry2 = (ISnippetsEntry)elementTwo;
    return collator.compare(entry1.getLabel(), entry2.getLabel()) < 0;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.common.snippets.internal.EntrySorter
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.common.snippets.internal;

public abstract interface IEntryChangeListener
{
  public abstract void modelChanged(SnippetDefinitions paramSnippetDefinitions1, SnippetDefinitions paramSnippetDefinitions2);
}

/* Location:
 * Qualified Name:     org.eclipse.wst.common.snippets.internal.IEntryChangeListener
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.common.snippets.internal;

public abstract interface IHelpContextIds
{
  public static final String PREFIX = "org.eclipse.wst.common.snippets.";
  public static final String DIALOG_EDIT_CATEGORY = "org.eclipse.wst.common.snippets.libv1300";
  public static final String DIALOG_EDIT_VARITEM = "org.eclipse.wst.common.snippets.libv1200";
  public static final String DIALOG_INSERT_VARITEM = "org.eclipse.wst.common.snippets.libv1100";
  public static final String MAIN_VIEW_GENERAL = "org.eclipse.wst.common.snippets.libv1000";
  public static final String CUSTOMIZE_IMPORT_BUTTON = "org.eclipse.wst.common.snippets.snip0010";
  public static final String CUSTOMIZE_EXPORT_BUTTON = "org.eclipse.wst.common.snippets.snip0020";
  public static final String DIALOG_CONTENT_TYPE_SELECTION = "org.eclipse.wst.common.snippets.snip0030";
  public static final String MENU_COPY_SNIPPET = "org.eclipse.wst.common.snippets.snip0060";
  public static final String MENU_CUT_SNIPPET = "org.eclipse.wst.common.snippets.snip0050";
  public static final String MENU_PASTE_SNIPPET = "org.eclipse.wst.common.snippets.snip0070";
  public static final String ADD_TO_SNIPPETS_DIALOG_CATEGORY = "org.eclipse.wst.common.snippets.snip0080";
}

/* Location:
 * Qualified Name:     org.eclipse.wst.common.snippets.internal.IHelpContextIds
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.common.snippets.internal;

import org.eclipse.wst.common.snippets.core.ISnippetsEntry;

public abstract interface ISnippetManager
{
  public abstract void addEntryChangeListener(IEntryChangeListener paramIEntryChangeListener);
  
  public abstract ISnippetsEntry findEntry(String paramString);
  
  public abstract SnippetDefinitions getDefinitions();
  
  public abstract void removeEntryChangeListener(IEntryChangeListener paramIEntryChangeListener);
}

/* Location:
 * Qualified Name:     org.eclipse.wst.common.snippets.internal.ISnippetManager
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.common.snippets.internal;

import com.ibm.icu.util.StringTokenizer;
import org.eclipse.core.runtime.ILog;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Plugin;
import org.eclipse.core.runtime.Status;
import org.osgi.framework.Bundle;

public class Logger
{
  public static final boolean DEBUG_DEFINITION_PERSISTENCE = "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.wst.common.snippets/debug/definition_persistence"));
  public static final boolean DEBUG_DRAG_AND_DROP = "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.wst.common.snippets/debug/drag_and_drop"));
  public static final boolean DEBUG_PALETTE_SELECTION = "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.wst.common.snippets/debug/palette_selection"));
  public static final boolean DEBUG_VIEWER_CONTENT = "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.wst.common.snippets/debug/viewer_content"));
  public static final int ERROR = 4;
  public static final int ERROR_DEBUG = 204;
  private static Plugin fPlugin = SnippetsPlugin.getDefault();
  private static final String fPluginId = fPlugin.getBundle().getSymbolicName();
  public static final int INFO = 1;
  public static final int INFO_DEBUG = 201;
  public static final int OK = 0;
  public static final int OK_DEBUG = 200;
  private static final String TRACEFILTER_LOCATION = "/debug/tracefilter";
  public static final int WARNING = 2;
  public static final int WARNING_DEBUG = 202;
  
  protected static void _log(int level, String message, Throwable exception)
  {
    if (((level == 200) || (level == 201) || (level == 202) || (level == 204)) && 
      (!isDebugging())) {
      return;
    }
    int severity = 0;
    switch (level)
    {
    case 1: 
    case 201: 
      severity = 1;
      break;
    case 2: 
    case 202: 
      severity = 2;
      break;
    case 4: 
    case 204: 
      severity = 4;
    }
    message = message != null ? message : "null";
    Status statusObj = new Status(severity, fPluginId, severity, message, exception);
    fPlugin.getLog().log(statusObj);
  }
  
  protected static void _trace(String category, String message, Throwable exception)
  {
    if (isTracing(category))
    {
      message = message != null ? message : "null";
      Status statusObj = new Status(0, fPluginId, 0, message, exception);
      fPlugin.getLog().log(statusObj);
    }
  }
  
  public static boolean isDebugging()
  {
    return fPlugin.isDebugging();
  }
  
  public static boolean isTracing(String category)
  {
    if (!isDebugging()) {
      return false;
    }
    String traceFilter = Platform.getDebugOption(fPluginId + "/debug/tracefilter");
    if (traceFilter != null)
    {
      StringTokenizer tokenizer = new StringTokenizer(traceFilter, ",");
      while (tokenizer.hasMoreTokens())
      {
        String cat = tokenizer.nextToken().trim();
        if (category.equals(cat)) {
          return true;
        }
      }
    }
    return false;
  }
  
  public static void log(int level, String message)
  {
    _log(level, message, null);
  }
  
  public static void log(int level, String message, Throwable exception)
  {
    _log(level, message, exception);
  }
  
  public static void logException(String message, Throwable exception)
  {
    _log(4, message, exception);
  }
  
  public static void logException(Throwable exception)
  {
    _log(4, exception.getMessage(), exception);
  }
  
  public static void trace(String category, String message)
  {
    _trace(category, message, null);
  }
  
  public static void traceException(String category, String message, Throwable exception)
  {
    _trace(category, message, exception);
  }
  
  public static void traceException(String category, Throwable exception)
  {
    _trace(category, exception.getMessage(), exception);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.common.snippets.internal.Logger
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.common.snippets.internal;

public class PluginRecord
{
  protected String fPluginName = null;
  protected String fPluginVersion = null;
  
  public boolean equals(Object obj)
  {
    PluginRecord record = (PluginRecord)obj;
    return (record.getPluginName().equals(getPluginName())) && (record.getPluginVersion().equals(getPluginVersion()));
  }
  
  public String getPluginName()
  {
    return fPluginName;
  }
  
  public String getPluginVersion()
  {
    return fPluginVersion;
  }
  
  public void setPluginName(String pluginName)
  {
    fPluginName = pluginName;
  }
  
  public void setPluginVersion(String pluginVersion)
  {
    fPluginVersion = pluginVersion;
  }
  
  public String toString()
  {
    return getPluginName() + ":" + getPluginVersion();
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.common.snippets.internal.PluginRecord
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.common.snippets.internal;

import org.eclipse.core.expressions.EvaluationContext;
import org.eclipse.core.expressions.EvaluationResult;
import org.eclipse.core.expressions.Expression;
import org.eclipse.core.expressions.ExpressionConverter;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.wst.common.snippets.core.ISnippetProvider;

public class SnippetContributor
{
  public static final String ID_EXTENSION_POINT_PROVIDER = "org.eclipse.wst.common.snippets.SnippetProvider";
  public static final String CLASS = "class";
  public static final String PRIORITY = "priority";
  public static final String ENABLEMENT = "enablement";
  private ISnippetProvider provider;
  private IConfigurationElement extPointElement;
  private byte priority = 100;
  private boolean initExecuted = false;
  
  public SnippetContributor(IConfigurationElement extPointElement)
  {
    this.extPointElement = extPointElement;
    initPriority();
  }
  
  private void initPriority()
  {
    if (extPointElement.getAttribute("priority") != null) {
      try
      {
        priority = ((byte)Integer.parseInt(extPointElement.getAttribute("priority")));
        if ((priority < 0) || (priority > 100)) {
          priority = 100;
        }
      }
      catch (NumberFormatException e)
      {
        priority = 100;
        Logger.logException(e);
      }
    }
  }
  
  private void initProvider()
  {
    initExecuted = true;
    try
    {
      provider = ((ISnippetProvider)extPointElement.createExecutableExtension("class"));
    }
    catch (CoreException e)
    {
      Logger.logException(e);
    }
  }
  
  public boolean isApplicable(Object o)
  {
    IConfigurationElement[] configurationElements = extPointElement.getChildren("enablement");
    boolean enabled = false;
    for (int i = 0; i < configurationElements.length; i++) {
      try
      {
        enabled |= testEnablement(configurationElements[i], o);
      }
      catch (CoreException localCoreException)
      {
        return false;
      }
    }
    return enabled;
  }
  
  private boolean testEnablement(IConfigurationElement enable, Object o)
    throws CoreException
  {
    Expression exp = ExpressionConverter.getDefault().perform(enable);
    EvaluationContext context = new EvaluationContext(null, o);
    context.setAllowPluginActivation(true);
    return EvaluationResult.TRUE == exp.evaluate(context);
  }
  
  public ISnippetProvider getProvider()
  {
    if (!initExecuted) {
      initProvider();
    }
    return provider;
  }
  
  public byte getPriority()
  {
    return priority;
  }
  
  public String toString()
  {
    return super.toString() + ":" + extPointElement.getAttribute("class");
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.common.snippets.internal.SnippetContributor
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.common.snippets.internal;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import org.eclipse.wst.common.snippets.core.ISnippetCategory;
import org.eclipse.wst.common.snippets.core.ISnippetItem;
import org.eclipse.wst.common.snippets.internal.palette.SnippetPaletteDrawer;
import org.eclipse.wst.common.snippets.internal.palette.SnippetPaletteItem;

public class SnippetDefinitions
{
  protected List fCategories = null;
  protected List fItems = null;
  
  public List getCategories()
  {
    if (fCategories == null) {
      fCategories = new ArrayList();
    }
    return fCategories;
  }
  
  public ISnippetCategory getCategory(String id)
  {
    Iterator iterator = getCategories().iterator();
    while (iterator.hasNext())
    {
      SnippetPaletteDrawer category = (SnippetPaletteDrawer)iterator.next();
      if (category.getId().equals(id)) {
        return category;
      }
    }
    return null;
  }
  
  public ISnippetItem getItem(String id)
  {
    Iterator iterator = getItems().iterator();
    while (iterator.hasNext())
    {
      SnippetPaletteItem item = (SnippetPaletteItem)iterator.next();
      if (item.getId().equals(id)) {
        return item;
      }
    }
    for (int i = 0; i < fCategories.size(); i++)
    {
      ISnippetItem[] items = ((ISnippetCategory)fCategories.get(i)).getItems();
      for (int j = 0; j < items.length; j++)
      {
        SnippetPaletteItem item = (SnippetPaletteItem)items[j];
        if (item.getId().equals(id)) {
          return item;
        }
      }
    }
    return null;
  }
  
  public List getItems()
  {
    if (fItems == null) {
      fItems = new ArrayList();
    }
    return fItems;
  }
  
  public void setCategories(List categories)
  {
    fCategories = categories;
  }
  
  public void setItems(List items)
  {
    fItems = items;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.common.snippets.internal.SnippetDefinitions
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.common.snippets.internal;

import org.eclipse.swt.dnd.ByteArrayTransfer;
import org.eclipse.swt.dnd.TransferData;

public class SnippetTransfer
  extends ByteArrayTransfer
{
  private static SnippetTransfer instance;
  private static final String LOCAL_NAME = "Snippet " + System.currentTimeMillis();
  private static final int LOCAL_TYPE = registerType(LOCAL_NAME);
  private static String[] names = null;
  private static int[] types = null;
  protected long startTime;
  protected Object object;
  
  public static SnippetTransfer getTransferInstance()
  {
    if (instance == null)
    {
      instance = new SnippetTransfer();
      init();
    }
    return instance;
  }
  
  private static void init()
  {
    types = new int[] { LOCAL_TYPE };
    names = new String[] { LOCAL_NAME };
  }
  
  protected int[] getTypeIds()
  {
    return types;
  }
  
  protected String[] getTypeNames()
  {
    return names;
  }
  
  public void javaToNative(Object object, TransferData transferData)
  {
    startTime = System.currentTimeMillis();
    this.object = object;
    if (transferData != null) {
      super.javaToNative(String.valueOf(startTime).getBytes(), transferData);
    }
  }
  
  public Object nativeToJava(TransferData transferData)
  {
    long startTime = Long.valueOf(new String((byte[])super.nativeToJava(transferData))).longValue();
    return this.startTime == startTime ? object : null;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.common.snippets.internal.SnippetTransfer
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.common.snippets.internal;

import org.eclipse.osgi.util.NLS;

public class SnippetsMessages
  extends NLS
{
  private static final String BUNDLE_NAME = "org.eclipse.wst.common.snippets.internal.SnippetsPluginResources";
  public static String A_name_must_be_specified_1;
  public static String New_Category_Title;
  public static String New_Item_Title;
  public static String Delete_1;
  public static String Unnamed_Template_1;
  public static String Insert_Template___1;
  public static String Insert_Template_2;
  public static String Edit_Instruction;
  public static String Variables__4;
  public static String Description_of_variable__5;
  public static String Variable_Name_6;
  public static String Value_7;
  public static String Preview__9;
  public static String Insert_14;
  public static String Variable_Name_3;
  public static String Value_4;
  public static String Name_5;
  public static String Description_6;
  public static String Default_Value_7;
  public static String Remove_15;
  public static String Template_Pattern__16;
  public static String Insert_Variable_17;
  public static String Insert___;
  public static String New_1;
  public static String Cut_2;
  public static String Copy_2;
  public static String Paste_4;
  public static String new_category_name;
  public static String category;
  public static String item;
  public static String Unnamed_Category;
  public static String Add_to_Snippets____3;
  public static String Cant_add_to_this;
  public static String choose_or_create;
  public static String force_create;
  public static String SnippetCustomizerDialog_0;
  public static String SnippetCustomizerDialog_1;
  public static String SnippetCustomizerDialog_2;
  public static String SnippetCustomizerDialog_3;
  public static String SnippetCustomizerDialog_4;
  public static String SnippetDrawerEntryPage_0;
  public static String SnippetDrawerEntryPage_1;
  public static String SnippetDrawerEntryPage_2;
  public static String SnippetDrawerEntryPage_3;
  public static String SnippetDrawerEntryPage_4;
  public static String SnippetDrawerEntryPage_5;
  public static String SnippetDrawerEntryPage_6;
  public static String Paste_as_Snippet;
  public static String Import_Snippets;
  public static String Export_Snippets;
  
  static
  {
    NLS.initializeMessages("org.eclipse.wst.common.snippets.internal.SnippetsPluginResources", SnippetsMessages.class);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.common.snippets.internal.SnippetsMessages
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.common.snippets.internal;

public abstract interface SnippetsPlugin$NAMES
{
  public static final String CATEGORY = "category";
  public static final String CLASSNAME = "class";
  public static final String CONTENT = "content";
  public static final String DEFAULT = "default";
  public static final String DESCRIPTION = "description";
  public static final String EDITORCLASSNAME = "editorclass";
  public static final String EXTENSION_POINT_ID = "SnippetContributions";
  public static final String HIDE = "hide";
  public static final String SMALLICON = "smallicon";
  public static final String ID = "id";
  public static final String INITIAL_STATE = "initial_state";
  public static final String ITEM = "item";
  public static final String LABEL = "label";
  public static final String LARGEICON = "largeicon";
  public static final String NAME = "name";
  public static final String PLUGIN = "plugin";
  public static final String SHARED = "shared";
  public static final String SHOW = "show";
  public static final String SNIPPETS = "snippets";
  public static final String VARIABLE = "variable";
  public static final String VARIABLES = "variables";
  public static final String VERSION = "version";
  public static final String VIEW_ID = "org.eclipse.wst.common.snippets.internal.ui.SnippetsView";
  public static final String PROVIDER_ID = "snippetProvider";
}

/* Location:
 * Qualified Name:     org.eclipse.wst.common.snippets.internal.SnippetsPlugin.NAMES
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.common.snippets.internal;

import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.eclipse.wst.common.snippets.internal.model.SnippetManager;

public class SnippetsPlugin
  extends AbstractUIPlugin
{
  public static final String BUNDLE_ID = "org.eclipse.wst.common.snippets";
  private static SnippetsPlugin fInstance;
  
  public static SnippetsPlugin getDefault()
  {
    return fInstance;
  }
  
  public static ISnippetManager getSnippetManager()
  {
    return SnippetManager.getInstance();
  }
  
  public SnippetsPlugin()
  {
    fInstance = this;
  }
  
  public static abstract interface NAMES
  {
    public static final String CATEGORY = "category";
    public static final String CLASSNAME = "class";
    public static final String CONTENT = "content";
    public static final String DEFAULT = "default";
    public static final String DESCRIPTION = "description";
    public static final String EDITORCLASSNAME = "editorclass";
    public static final String EXTENSION_POINT_ID = "SnippetContributions";
    public static final String HIDE = "hide";
    public static final String SMALLICON = "smallicon";
    public static final String ID = "id";
    public static final String INITIAL_STATE = "initial_state";
    public static final String ITEM = "item";
    public static final String LABEL = "label";
    public static final String LARGEICON = "largeicon";
    public static final String NAME = "name";
    public static final String PLUGIN = "plugin";
    public static final String SHARED = "shared";
    public static final String SHOW = "show";
    public static final String SNIPPETS = "snippets";
    public static final String VARIABLE = "variable";
    public static final String VARIABLES = "variables";
    public static final String VERSION = "version";
    public static final String VIEW_ID = "org.eclipse.wst.common.snippets.internal.ui.SnippetsView";
    public static final String PROVIDER_ID = "snippetProvider";
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.common.snippets.internal.SnippetsPlugin
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.common.snippets.internal;

import java.util.HashMap;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.resource.ImageRegistry;
import org.eclipse.jface.resource.JFaceResources;
import org.eclipse.swt.graphics.Image;
import org.eclipse.ui.plugin.AbstractUIPlugin;

public class SnippetsPluginImageHelper
{
  private static SnippetsPluginImageHelper instance = null;
  
  public static synchronized SnippetsPluginImageHelper getInstance()
  {
    if (instance == null) {
      instance = new SnippetsPluginImageHelper();
    }
    return instance;
  }
  
  private HashMap fImageDescRegistry = null;
  private final String PLUGIN_SEPARATOR = "^";
  private final String PLUGINID = "org.eclipse.wst.common.snippets";
  
  private Image createImage(String resource, String pluginId)
  {
    ImageDescriptor desc = getImageDescriptor(resource, pluginId);
    Image image = null;
    if (desc != null)
    {
      image = desc.createImage();
      if (!desc.equals(ImageDescriptor.getMissingImageDescriptor()))
      {
        String thePluginId = pluginId;
        if (thePluginId == null) {
          thePluginId = "org.eclipse.wst.common.snippets";
        }
        String key = thePluginId + "^" + resource;
        getImageRegistry().put(key, image);
      }
    }
    return image;
  }
  
  private ImageDescriptor createImageDescriptor(String imageFilePath, String pluginId)
  {
    String thePluginId = pluginId;
    if (thePluginId == null) {
      thePluginId = "org.eclipse.wst.common.snippets";
    }
    ImageDescriptor imageDescriptor = AbstractUIPlugin.imageDescriptorFromPlugin(thePluginId, imageFilePath);
    if (imageDescriptor != null)
    {
      String key = thePluginId + "^" + imageFilePath;
      getImageDescriptorRegistry().put(key, imageDescriptor);
    }
    else
    {
      imageDescriptor = ImageDescriptor.getMissingImageDescriptor();
    }
    return imageDescriptor;
  }
  
  public Image getImage(String resource)
  {
    return getImage(resource, null);
  }
  
  public Image getImage(String resource, String pluginId)
  {
    String thePluginId = pluginId;
    if (thePluginId == null) {
      thePluginId = "org.eclipse.wst.common.snippets";
    }
    String key = thePluginId + "^" + resource;
    
    Image image = getImageRegistry().get(key);
    if (image == null) {
      image = createImage(resource, pluginId);
    }
    return image;
  }
  
  public ImageDescriptor getImageDescriptor(String resource)
  {
    return getImageDescriptor(resource, null);
  }
  
  public ImageDescriptor getImageDescriptor(String resource, String pluginId)
  {
    ImageDescriptor imageDescriptor = null;
    String thePluginId = pluginId;
    if (thePluginId == null) {
      thePluginId = "org.eclipse.wst.common.snippets";
    }
    String key = thePluginId + "^" + resource;
    Object o = getImageDescriptorRegistry().get(key);
    if (o == null) {
      imageDescriptor = createImageDescriptor(resource, pluginId);
    } else {
      imageDescriptor = (ImageDescriptor)o;
    }
    return imageDescriptor;
  }
  
  private HashMap getImageDescriptorRegistry()
  {
    if (fImageDescRegistry == null) {
      fImageDescRegistry = new HashMap();
    }
    return fImageDescRegistry;
  }
  
  private ImageRegistry getImageRegistry()
  {
    return JFaceResources.getImageRegistry();
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.common.snippets.internal.SnippetsPluginImageHelper
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.common.snippets.internal;

public class SnippetsPluginImages
{
  public static final String IMG_CLCL_COPY = "icons/full/clcl16/copy.gif";
  public static final String IMG_CLCL_CUT = "icons/full/clcl16/cut.gif";
  public static final String IMG_CLCL_DELETE = "icons/full/clcl16/delete.gif";
  public static final String IMG_CLCL_EXPORT = "icons/full/clcl16/export.gif";
  public static final String IMG_CLCL_IMPORT = "icons/full/clcl16/import.gif";
  public static final String IMG_CLCL_INSERT = "icons/full/clcl16/insert.gif";
  public static final String IMG_CLCL_NEW_CATEGORY = "icons/full/clcl16/new_category.gif";
  public static final String IMG_CLCL_NEW_TEMPLATE = "icons/full/clcl16/new_template.gif";
  public static final String IMG_CLCL_PASTE = "icons/full/clcl16/paste.gif";
  public static final String IMG_DLCL_COPY = "icons/full/dlcl16/copy.gif";
  public static final String IMG_DLCL_CUT = "icons/full/dlcl16/cut.gif";
  public static final String IMG_DLCL_DELETE = "icons/full/dlcl16/delete.gif";
  public static final String IMG_DLCL_EXPORT = "icons/full/dlcl16/export.gif";
  public static final String IMG_DLCL_IMPORT = "icons/full/dlcl16/import.gif";
  public static final String IMG_DLCL_INSERT = "icons/full/dlcl16/insert.gif";
  public static final String IMG_DLCL_NEW_CATEGORY = "icons/full/dlcl16/new_category.gif";
  public static final String IMG_DLCL_NEW_TEMPLATE = "icons/full/dlcl16/new_template.gif";
  public static final String IMG_DLCL_PASTE = "icons/full/dlcl16/paste.gif";
  public static final String IMG_ELCL_COPY = "icons/full/elcl16/copy.gif";
  public static final String IMG_ELCL_CUT = "icons/full/elcl16/cut.gif";
  public static final String IMG_ELCL_DELETE = "icons/full/elcl16/delete.gif";
  public static final String IMG_ELCL_EXPORT = "icons/full/elcl16/export.gif";
  public static final String IMG_ELCL_IMPORT = "icons/full/elcl16/import.gif";
  public static final String IMG_ELCL_INSERT = "icons/full/elcl16/insert.gif";
  public static final String IMG_ELCL_NEW_CATEGORY = "icons/full/elcl16/new_category.gif";
  public static final String IMG_ELCL_NEW_TEMPLATE = "icons/full/elcl16/new_template.gif";
  public static final String IMG_ELCL_PASTE = "icons/full/elcl16/paste.gif";
  public static final String IMG_OBJ_SNIPPETS = "icons/full/obj16/snippets.gif";
  public static final String IMG_OBJ_TEMPLATE = "icons/full/obj16/template.gif";
}

/* Location:
 * Qualified Name:     org.eclipse.wst.common.snippets.internal.SnippetsPluginImages
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.common.snippets.internal;

import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.swt.custom.StyledText;
import org.eclipse.wst.common.snippets.core.ISnippetVariable;
import org.eclipse.wst.common.snippets.internal.ui.StringPropertyTableViewer;

class VariableInsertionDialog$1
  implements ISelectionChangedListener
{
  final VariableInsertionDialog this$0;
  
  VariableInsertionDialog$1(VariableInsertionDialog paramVariableInsertionDialog)
  {
    this$0 = paramVariableInsertionDialog;
  }
  
  public void selectionChanged(SelectionChangedEvent event)
  {
    ISnippetVariable variable = null;
    if (this$0.fTableViewer.getSelection() != null) {
      variable = this$0.getVariable(this$0.fTableViewer.getSelection());
    }
    this$0.fDescriptionPane.setText(variable != null ? variable.getDescription() : "");
    this$0.fDescriptionPane.setHorizontalPixel(2);
    this$0.fDescriptionPane.redraw();
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.common.snippets.internal.VariableInsertionDialog.1
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.common.snippets.internal;

import org.eclipse.wst.common.snippets.internal.ui.ValueChangedListener;

class VariableInsertionDialog$2
  implements ValueChangedListener
{
  final VariableInsertionDialog this$0;
  
  VariableInsertionDialog$2(VariableInsertionDialog paramVariableInsertionDialog)
  {
    this$0 = paramVariableInsertionDialog;
  }
  
  public void valueChanged(String key, String property, String oldValue, String newValue)
  {
    this$0.update();
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.common.snippets.internal.VariableInsertionDialog.2
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.common.snippets.internal;

import org.eclipse.swt.custom.LineStyleEvent;
import org.eclipse.swt.custom.LineStyleListener;

class VariableInsertionDialog$3
  implements LineStyleListener
{
  final VariableInsertionDialog this$0;
  
  VariableInsertionDialog$3(VariableInsertionDialog paramVariableInsertionDialog)
  {
    this$0 = paramVariableInsertionDialog;
  }
  
  public void lineGetStyle(LineStyleEvent event) {}
}

/* Location:
 * Qualified Name:     org.eclipse.wst.common.snippets.internal.VariableInsertionDialog.3
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.common.snippets.internal;

import org.eclipse.swt.custom.VerifyKeyListener;
import org.eclipse.swt.events.VerifyEvent;
import org.eclipse.swt.widgets.Control;

class VariableInsertionDialog$4
  implements VerifyKeyListener
{
  final VariableInsertionDialog this$0;
  private final Control val$widget;
  
  VariableInsertionDialog$4(VariableInsertionDialog paramVariableInsertionDialog, Control paramControl)
  {
    this$0 = paramVariableInsertionDialog;val$widget = paramControl;
  }
  
  public void verifyKey(VerifyEvent event)
  {
    if (character == '\t') {
      if ((stateMask & 0x20000) != 0) {
        val$widget.traverse(8);
      } else {
        val$widget.traverse(16);
      }
    }
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.common.snippets.internal.VariableInsertionDialog.4
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.common.snippets.internal;

import org.eclipse.swt.accessibility.AccessibleAdapter;
import org.eclipse.swt.accessibility.AccessibleEvent;

class VariableInsertionDialog$5
  extends AccessibleAdapter
{
  final VariableInsertionDialog this$0;
  private final String val$n;
  
  VariableInsertionDialog$5(VariableInsertionDialog paramVariableInsertionDialog, String paramString)
  {
    this$0 = paramVariableInsertionDialog;val$n = paramString;
  }
  
  public void getName(AccessibleEvent e)
  {
    if (childID == -1) {
      result = val$n;
    }
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.common.snippets.internal.VariableInsertionDialog.5
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.common.snippets.internal;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.resource.JFaceResources;
import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.swt.accessibility.Accessible;
import org.eclipse.swt.accessibility.AccessibleAdapter;
import org.eclipse.swt.accessibility.AccessibleEvent;
import org.eclipse.swt.custom.LineStyleEvent;
import org.eclipse.swt.custom.LineStyleListener;
import org.eclipse.swt.custom.StyledText;
import org.eclipse.swt.custom.VerifyKeyListener;
import org.eclipse.swt.events.DisposeListener;
import org.eclipse.swt.events.VerifyEvent;
import org.eclipse.swt.graphics.FontData;
import org.eclipse.swt.graphics.Rectangle;
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.Shell;
import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.help.IWorkbenchHelpSystem;
import org.eclipse.wst.common.snippets.core.ISnippetItem;
import org.eclipse.wst.common.snippets.core.ISnippetVariable;
import org.eclipse.wst.common.snippets.internal.palette.SnippetVariable;
import org.eclipse.wst.common.snippets.internal.ui.StringPropertyTableViewer;
import org.eclipse.wst.common.snippets.internal.ui.ValueChangedListener;
import org.eclipse.wst.common.snippets.internal.util.StringUtils;

public class VariableInsertionDialog
  extends Dialog
{
  private List disposeListeners = new ArrayList();
  protected StyledText fDescriptionPane = null;
  protected ISnippetItem fItem = null;
  protected String fPreparedText = null;
  protected StyledText fPreviewPane = null;
  protected StringPropertyTableViewer fTableViewer = null;
  
  public VariableInsertionDialog(Shell parentShell, boolean clearModality)
  {
    super(parentShell);
    if (clearModality) {
      setShellStyle(2160);
    } else {
      setShellStyle(0x10 | getShellStyle());
    }
  }
  
  protected void addContents(Composite composite) {}
  
  public void addDisposeListener(DisposeListener listener)
  {
    if (!disposeListeners.contains(listener)) {
      disposeListeners.add(listener);
    }
  }
  
  public void create()
  {
    super.create();
    for (int i = 0; i < disposeListeners.size(); i++) {
      getShell().addDisposeListener((DisposeListener)disposeListeners.get(i));
    }
    getShell().setActive();
  }
  
  protected void createButtonsForButtonBar(Composite parent)
  {
    super.createButtonsForButtonBar(parent);
    getButton(0).setText(SnippetsMessages.Insert_14);
  }
  
  protected Control createDialogArea(Composite parent)
  {
    parent.getShell().setText(getDialogTitle());
    SnippetsPlugin.getDe
1 2 3 4 5 6 7 8 9 10 11 12

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-2019. Infinite Loop Ltd