org.eclipse.wst.dtd.ui_1.0.600.v201103171359

16:48:59.787 INFO  jd.cli.Main - Decompiling org.eclipse.wst.dtd.ui_1.0.600.v201103171359.jar
package org.eclipse.wst.dtd.ui;

import org.eclipse.jface.text.source.ISourceViewer;
import org.eclipse.wst.dtd.ui.internal.style.LineStyleProviderForDTD;
import org.eclipse.wst.sse.ui.StructuredTextViewerConfiguration;
import org.eclipse.wst.sse.ui.internal.provisional.style.LineStyleProvider;

public class StructuredTextViewerConfigurationDTD
  extends StructuredTextViewerConfiguration
{
  private String[] fConfiguredContentTypes;
  private LineStyleProvider[] fLineStyleProviders;
  
  public String[] getConfiguredContentTypes(ISourceViewer sourceViewer)
  {
    if (fConfiguredContentTypes == null) {
      fConfiguredContentTypes = new String[] { "org.eclipse.wst.dtd.DEFAULT", "org.eclipse.wst.sse.ST_DEFAULT", "org.eclipse.wst.sse.UNKNOWN_PARTITION_TYPE" };
    }
    return fConfiguredContentTypes;
  }
  
  public LineStyleProvider[] getLineStyleProviders(ISourceViewer sourceViewer, String partitionType)
  {
    if (fLineStyleProviders == null) {
      fLineStyleProviders = new LineStyleProvider[] { createLineStyleProviderForDTD() };
    }
    return fLineStyleProviders;
  }
  
  private LineStyleProvider createLineStyleProviderForDTD()
  {
    return new LineStyleProviderForDTD();
  }
}

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

import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.ISelectionProvider;
import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.swt.widgets.Control;
import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage;

class DTDEditor$1
  implements ISelectionChangedListener
{
  final DTDEditor this$0;
  
  DTDEditor$1(DTDEditor paramDTDEditor)
  {
    this$0 = paramDTDEditor;
  }
  
  public void selectionChanged(SelectionChangedEvent event)
  {
    if ((this$0.fPropertySheetPage != null) && (!this$0.fPropertySheetPage.getControl().isDisposed())) {
      this$0.fPropertySheetPage.selectionChanged(this$0, this$0.getSelectionProvider().getSelection());
    }
  }
}

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

import org.eclipse.ui.IEditorSite;
import org.eclipse.ui.views.properties.tabbed.ITabbedPropertySheetPageContributor;

class DTDEditor$DTDPropertySheetPageContributor
  implements ITabbedPropertySheetPageContributor
{
  final DTDEditor this$0;
  
  DTDEditor$DTDPropertySheetPageContributor(DTDEditor paramDTDEditor)
  {
    this$0 = paramDTDEditor;
  }
  
  public String getContributorId()
  {
    return this$0.getEditorSite().getId();
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.dtd.ui.internal.DTDEditor.DTDPropertySheetPageContributor
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.dtd.ui.internal;

import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.viewers.IPostSelectionProvider;
import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.ISelectionProvider;
import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.swt.widgets.Control;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IEditorSite;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.views.properties.IPropertySheetPage;
import org.eclipse.ui.views.properties.tabbed.ITabbedPropertySheetPageContributor;
import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage;
import org.eclipse.wst.sse.ui.StructuredTextEditor;

public class DTDEditor
  extends StructuredTextEditor
{
  TabbedPropertySheetPage fPropertySheetPage;
  
  class DTDPropertySheetPageContributor
    implements ITabbedPropertySheetPageContributor
  {
    DTDPropertySheetPageContributor() {}
    
    public String getContributorId()
    {
      return getEditorSite().getId();
    }
  }
  
  public Object getAdapter(Class required)
  {
    if (IPropertySheetPage.class.equals(required))
    {
      if (fPropertySheetPage == null)
      {
        fPropertySheetPage = new DTDTabbedPropertySheetPage(new DTDPropertySheetPageContributor());
        
        ((IPostSelectionProvider)getSelectionProvider()).addPostSelectionChangedListener(new ISelectionChangedListener()
        {
          public void selectionChanged(SelectionChangedEvent event)
          {
            if ((fPropertySheetPage != null) && (!fPropertySheetPage.getControl().isDisposed())) {
              fPropertySheetPage.selectionChanged(DTDEditor.this, getSelectionProvider().getSelection());
            }
          }
        });
      }
      return fPropertySheetPage;
    }
    return super.getAdapter(required);
  }
  
  public void init(IEditorSite site, IEditorInput editorInput)
    throws PartInitException
  {
    super.init(site, editorInput);
    if (DTDUIPlugin.getDefault().getPreferenceStore().getBoolean("activateProperties"))
    {
      IWorkbenchWindow dw = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
      IWorkbenchPage page = dw.getActivePage();
      try
      {
        if (page != null) {
          page.showView("org.eclipse.ui.views.PropertySheet");
        }
      }
      catch (PartInitException e)
      {
        Logger.logException(e);
      }
    }
  }
}

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

import java.util.MissingResourceException;
import java.util.ResourceBundle;
import org.eclipse.osgi.util.NLS;

public class DTDPropertiesMessages
  extends NLS
{
  private static final String BUNDLE_NAME = "org.eclipse.wst.dtd.ui.internal.DTDPropertiesMessages";
  public static String _UI_ONCE;
  public static String _UI_ONE_OR_MORE;
  public static String _UI_OPTIONAL;
  public static String _UI_ZERO_OR_MORE;
  public static String _UI_LABEL_OCCURRENCE;
  public static String _UI_DEFAULT;
  public static String _UI_LABEL_USAGE;
  public static String _UI_LABEL_DEFAULT_VALUE;
  public static String _UI_SEQUENCE;
  public static String _UI_CHOICE;
  public static String _UI_LABEL_MODEL_GROUP;
  public static String _UI_LABEL_CONTENT_MODEL;
  public static String _UI_LABEL_CONTENT_TYPE;
  public static String _UI_LABEL_NAME;
  public static String _UI_LABEL_TYPE;
  public static String _UI_LABEL_ENTITY_TYPE;
  public static String _UI_LABEL_EXTERNAL_ENTITY;
  public static String _UI_LABEL_PARAMETER_ENTITY;
  public static String _UI_LABEL_GENERAL_ENTITY;
  public static String _UI_LABEL_ENTITY_VALUE;
  public static String _UI_LABEL_PUBLIC_ID;
  public static String _UI_LABEL_SYSTEM_ID;
  public static String _UI_PROPERTIES_VIEW_TITLE_ELEMENT_REF;
  public static String _UI_FILEDIALOG_SELECT_DTD;
  public static String _UI_FILEDIALOG_SELECT_DTD_DESC;
  public static String DTDSectionLabelProvider_0;
  public static String DTDSectionLabelProvider_1;
  public static String DTDSectionLabelProvider_10;
  public static String DTDSectionLabelProvider_11;
  public static String DTDSectionLabelProvider_6;
  public static String DTDSectionLabelProvider_7;
  public static String DTDSectionLabelProvider_8;
  public static String DTDSectionLabelProvider_9;
  private static ResourceBundle fResourceBundle;
  
  static
  {
    NLS.initializeMessages("org.eclipse.wst.dtd.ui.internal.DTDPropertiesMessages", DTDPropertiesMessages.class);
  }
  
  public static ResourceBundle getResourceBundle()
  {
    try
    {
      if (fResourceBundle == null) {
        fResourceBundle = ResourceBundle.getBundle("org.eclipse.wst.dtd.ui.internal.DTDPropertiesMessages");
      }
    }
    catch (MissingResourceException localMissingResourceException)
    {
      fResourceBundle = null;
    }
    return fResourceBundle;
  }
}

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

import org.eclipse.jface.viewers.ISelection;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.part.IPageSite;
import org.eclipse.ui.views.properties.IPropertySheetPage;
import org.eclipse.ui.views.properties.tabbed.ITabbedPropertySheetPageContributor;
import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage;

class DTDTabbedPropertySheetPage
  extends TabbedPropertySheetPage
{
  private ISelection oldSelection = null;
  
  public DTDTabbedPropertySheetPage(ITabbedPropertySheetPageContributor tabbedPropertySheetPageContributor)
  {
    super(tabbedPropertySheetPageContributor);
  }
  
  public void selectionChanged(IWorkbenchPart part, ISelection selection)
  {
    IWorkbenchWindow workbenchWindow = getSite().getWorkbenchWindow();
    if (workbenchWindow != null)
    {
      IWorkbenchPage activePage = workbenchWindow.getActivePage();
      if (activePage != null)
      {
        IEditorPart activeEditor = activePage.getActiveEditor();
        if (activeEditor != null) {
          if ((activeEditor.getAdapter(IPropertySheetPage.class) == this) && (
            (oldSelection == null) || (!oldSelection.equals(selection))))
          {
            oldSelection = selection;
            super.selectionChanged(part, selection);
          }
        }
      }
    }
  }
}

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

import org.eclipse.osgi.util.NLS;

public class DTDUIMessages
  extends NLS
{
  private static final String BUNDLE_NAME = "org.eclipse.wst.dtd.ui.internal.DTDUIPluginResources";
  public static String _UI_ACTION_ADD_ATTRIBUTELIST;
  public static String _UI_ACTION_ADD_DTD_NOTATION;
  public static String _UI_ACTION_ADD_DTD_ENTITY;
  public static String _UI_ACTION_ADD_DTD_ELEMENT;
  public static String _UI_ACTION_ADD_DTD_COMMENT;
  public static String _UI_ACTION_DTD_DELETE;
  public static String _UI_ACTION_ADD_ATTRIBUTE;
  public static String _UI_ACTION_GROUP_ADD_GROUP;
  public static String _UI_ACTION_ADD_ELEMENT;
  public static String _UI_BUTTON_GROUP_ITEMS_LOGICALLY;
  public static String _UI_BUTTON_SORT_ITEMS;
  public static String _UI_ACTION_ADD_PARAM_ENTITY_REF;
  public static String _UI_MOVE_ATTRIBUTE;
  public static String _UI_MOVE_CONTENT;
  public static String _UI_MOVE_NODE;
  public static String _UI_MOVE_NODES;
  public static String _ERROR_FILENAME_MUST_END_DTD;
  public static String Creating_files;
  public static String DTDFilesPreferencePage_ExtensionLabel;
  public static String DTDFilesPreferencePage_ExtensionError;
  public static String DTDColorPage_0;
  public static String DTDColorPage_1;
  public static String DTDColorPage_2;
  public static String DTDColorPage_3;
  public static String DTDColorPage_4;
  public static String DTDColorPage_5;
  public static String DTDColorPage_6;
  public static String DTDColorPage_7;
  public static String DTDColorPage_8;
  public static String DTDPropertySourceAdapter_0;
  public static String DTDPropertySourceAdapter_1;
  public static String DTDPropertySourceAdapter_2;
  public static String SourceMenu_label;
  public static String _UI_CREATE_NEW_DTD_FILE;
  public static String _UI_WIZARD_NEW_DTD_TITLE;
  public static String _UI_WIZARD_NEW_DTD_EXPL;
  public static String _UI_LABEL_DTD_FILE_DELETE;
  public static String ResourceGroup_nameExists;
  public static String NewDTDTemplatesWizardPage_0;
  public static String NewDTDTemplatesWizardPage_1;
  public static String NewDTDTemplatesWizardPage_2;
  public static String NewDTDTemplatesWizardPage_3;
  public static String NewDTDTemplatesWizardPage_4;
  public static String NewDTDTemplatesWizardPage_5;
  public static String NewDTDTemplatesWizardPage_6;
  public static String NewDTDTemplatesWizardPage_7;
  public static String SyntaxColoringPage_0;
  public static String SyntaxColoringPage_2;
  public static String SyntaxColoringPage_3;
  public static String SyntaxColoringPage_4;
  public static String SyntaxColoringPage_5;
  public static String SyntaxColoringPage_6;
  public static String _UI_STRUCTURED_TEXT_EDITOR_PREFS_LINK;
  public static String ShowProperties;
  
  static
  {
    NLS.initializeMessages("org.eclipse.wst.dtd.ui.internal.DTDUIPluginResources", DTDUIMessages.class);
  }
}

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

import java.io.IOException;
import org.eclipse.core.resources.IWorkspace;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.resource.ImageRegistry;
import org.eclipse.jface.text.templates.ContextTypeRegistry;
import org.eclipse.jface.text.templates.persistence.TemplateStore;
import org.eclipse.swt.graphics.Image;
import org.eclipse.ui.editors.text.templates.ContributionContextTypeRegistry;
import org.eclipse.ui.editors.text.templates.ContributionTemplateStore;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.Bundle;

public class DTDUIPlugin
  extends AbstractUIPlugin
{
  private static DTDUIPlugin plugin;
  private TemplateStore fTemplateStore;
  private ContextTypeRegistry fContextTypeRegistry;
  
  public static DTDUIPlugin getDefault()
  {
    return plugin;
  }
  
  public static IWorkspace getWorkspace()
  {
    return ResourcesPlugin.getWorkspace();
  }
  
  public DTDUIPlugin()
  {
    plugin = this;
  }
  
  public TemplateStore getTemplateStore()
  {
    if (fTemplateStore == null)
    {
      fTemplateStore = new ContributionTemplateStore(getTemplateContextRegistry(), getPreferenceStore(), "org.eclipse.wst.sse.ui.custom_templates");
      try
      {
        fTemplateStore.load();
      }
      catch (IOException e)
      {
        Logger.logException(e);
      }
    }
    return fTemplateStore;
  }
  
  public ContextTypeRegistry getTemplateContextRegistry()
  {
    if (fContextTypeRegistry == null)
    {
      ContributionContextTypeRegistry registry = new ContributionContextTypeRegistry();
      registry.addContextType("dtd_new");
      
      fContextTypeRegistry = registry;
    }
    return fContextTypeRegistry;
  }
  
  public Image getImage(String iconName)
  {
    ImageRegistry imageRegistry = getImageRegistry();
    Image image = imageRegistry.get(iconName);
    if (image == null)
    {
      String thisID = getDefault().getBundle().getSymbolicName();
      imageRegistry.put(iconName, imageDescriptorFromPlugin(thisID, iconName));
      image = imageRegistry.get(iconName);
    }
    return image;
  }
  
  public static Image getDTDImage(String iconName)
  {
    return getDefault().getImage(iconName);
  }
  
  public static ImageDescriptor getDTDImageDescriptor(String iconName)
  {
    String thisID = getDefault().getBundle().getSymbolicName();
    return AbstractUIPlugin.imageDescriptorFromPlugin(thisID, iconName);
  }
}

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

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

public class Logger
{
  private static final String PLUGIN_ID = "org.eclipse.wst.dtd.ui";
  public static final int ERROR = 4;
  public static final int ERROR_DEBUG = 204;
  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;
    }
    Status statusObj = new Status(severity, "org.eclipse.wst.dtd.ui", severity, message, exception);
    Bundle bundle = Platform.getBundle("org.eclipse.wst.dtd.ui");
    if (bundle != null) {
      Platform.getLog(bundle).log(statusObj);
    }
  }
  
  protected static void _trace(String category, String message, Throwable exception)
  {
    if (!isDebugging()) {
      return;
    }
    String traceFilter = Platform.getDebugOption("org.eclipse.wst.dtd.ui/debug/tracefilter");
    if (traceFilter != null)
    {
      StringTokenizer tokenizer = new StringTokenizer(traceFilter, ",");
      while (tokenizer.hasMoreTokens())
      {
        String cat = tokenizer.nextToken().trim();
        if (category.equals(cat))
        {
          Status statusObj = new Status(0, "org.eclipse.wst.dtd.ui", 0, message, exception);
          Bundle bundle = Platform.getBundle("org.eclipse.wst.dtd.ui");
          if (bundle != null) {
            Platform.getLog(bundle).log(statusObj);
          }
          return;
        }
      }
    }
  }
  
  public static boolean isDebugging()
  {
    return Platform.inDebugMode();
  }
  
  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.dtd.ui.internal.Logger
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.dtd.ui.internal.dnd;

import java.util.Collection;
import org.eclipse.wst.common.ui.internal.dnd.DragAndDropCommand;
import org.eclipse.wst.common.ui.internal.dnd.DragAndDropManager;
import org.eclipse.wst.dtd.core.internal.Attribute;
import org.eclipse.wst.dtd.core.internal.CMNode;
import org.eclipse.wst.dtd.core.internal.DTDNode;
import org.eclipse.wst.dtd.core.internal.TopLevelNode;

public class DTDDragAndDropManager
  implements DragAndDropManager
{
  public DragAndDropCommand createCommand(Object target, float location, int operations, int operation, Collection source)
  {
    if ((target instanceof DTDNode))
    {
      DTDNode node = (DTDNode)target;
      if ((node instanceof TopLevelNode)) {
        return new DragTopLevelNodesCommand(target, location, operations, operation, source);
      }
      if ((node instanceof Attribute)) {
        return new DragAttributeCommand(target, location, operations, operation, source);
      }
      if ((node instanceof CMNode)) {
        return new DragContentModelCommand(target, location, operations, operation, source);
      }
    }
    return null;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.dtd.ui.internal.dnd.DTDDragAndDropManager
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.dtd.ui.internal.dnd;

import java.util.Collection;
import java.util.Iterator;
import org.eclipse.wst.common.ui.internal.dnd.DefaultDragAndDropCommand;
import org.eclipse.wst.dtd.core.internal.Attribute;
import org.eclipse.wst.dtd.core.internal.AttributeList;
import org.eclipse.wst.dtd.core.internal.DTDFile;
import org.eclipse.wst.dtd.core.internal.DTDNode;
import org.eclipse.wst.dtd.core.internal.document.DTDModelImpl;
import org.eclipse.wst.dtd.ui.internal.DTDUIMessages;

public class DragAttributeCommand
  extends DefaultDragAndDropCommand
{
  public DragAttributeCommand(Object target, float location, int operations, int operation, Collection sources)
  {
    super(target, location, operations, operation, sources);
  }
  
  public boolean canExecute()
  {
    Iterator iter = sources.iterator();
    while (iter.hasNext())
    {
      Object source = iter.next();
      if (!(source instanceof Attribute)) {
        return false;
      }
    }
    return true;
  }
  
  public void execute()
  {
    DTDNode referenceNode = (DTDNode)target;
    DTDFile dtdFile = referenceNode.getDTDFile();
    if ((referenceNode instanceof Attribute))
    {
      dtdFile.getDTDModel().beginRecording(this, DTDUIMessages._UI_MOVE_ATTRIBUTE);
      AttributeList attList = (AttributeList)referenceNode.getParentNode();
      Iterator iter = sources.iterator();
      while (iter.hasNext())
      {
        DTDNode node = (DTDNode)iter.next();
        if ((node instanceof Attribute))
        {
          attList.insertIntoModel(this, (Attribute)referenceNode, (Attribute)node, isAfter());
          dtdFile.deleteNode(this, node);
        }
      }
      dtdFile.getDTDModel().endRecording(this);
    }
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.dtd.ui.internal.dnd.DragAttributeCommand
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.dtd.ui.internal.dnd;

import java.util.Collection;
import java.util.Iterator;
import org.eclipse.wst.common.ui.internal.dnd.DefaultDragAndDropCommand;
import org.eclipse.wst.dtd.core.internal.CMBasicNode;
import org.eclipse.wst.dtd.core.internal.CMGroupNode;
import org.eclipse.wst.dtd.core.internal.CMNode;
import org.eclipse.wst.dtd.core.internal.DTDFile;
import org.eclipse.wst.dtd.core.internal.DTDNode;
import org.eclipse.wst.dtd.core.internal.Element;
import org.eclipse.wst.dtd.core.internal.document.DTDModelImpl;
import org.eclipse.wst.dtd.ui.internal.DTDUIMessages;

public class DragContentModelCommand
  extends DefaultDragAndDropCommand
{
  public DragContentModelCommand(Object target, float location, int operations, int operation, Collection sources)
  {
    super(target, location, operations, operation, sources);
  }
  
  public boolean canExecute()
  {
    if (!(target instanceof CMNode)) {
      return false;
    }
    Iterator iter = sources.iterator();
    while (iter.hasNext())
    {
      Object source = iter.next();
      if (!(source instanceof CMNode)) {
        return false;
      }
    }
    return true;
  }
  
  public void execute()
  {
    DTDNode referenceNode = (DTDNode)target;
    if ((referenceNode instanceof CMNode))
    {
      DTDFile dtdFile = referenceNode.getDTDFile();
      
      DTDNode parent = (DTDNode)referenceNode.getParentNode();
      dtdFile.getDTDModel().beginRecording(this, DTDUIMessages._UI_MOVE_CONTENT);
      boolean parentIsElement = false;
      Element element = null;
      CMGroupNode group = null;
      if ((parent instanceof Element))
      {
        parentIsElement = true;
        element = (Element)parent;
      }
      else
      {
        group = (CMGroupNode)parent;
      }
      if ((element == null) && (group == null)) {
        return;
      }
      Iterator iter = sources.iterator();
      while (iter.hasNext())
      {
        DTDNode node = (DTDNode)iter.next();
        if ((node instanceof CMNode))
        {
          if (parentIsElement)
          {
            if (element.getContentModel() == node) {
              continue;
            }
            element.replaceContentModel(this, (CMNode)node);
          }
          else
          {
            if ((referenceNode == node) || ((isAfter()) && (referenceNode.getNextSibling() == node)) || ((!isAfter()) && (node.getNextSibling() == referenceNode))) {
              continue;
            }
            group.insertIntoModel(this, (CMNode)referenceNode, (CMNode)node, isAfter());
          }
          DTDNode nodeParent = (DTDNode)node.getParentNode();
          nodeParent.delete(this, node);
        }
      }
      dtdFile.getDTDModel().endRecording(this);
    }
  }
  
  public int getFeedback()
  {
    DTDNode referenceNode = (DTDNode)target;
    if ((referenceNode instanceof CMNode))
    {
      CMNode cmNode = (CMNode)referenceNode;
      if ((cmNode.isRootElementContent()) && ((cmNode instanceof CMBasicNode))) {
        return 1;
      }
    }
    return super.getFeedback();
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.dtd.ui.internal.dnd.DragContentModelCommand
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.dtd.ui.internal.dnd;

import java.util.Collection;
import java.util.Iterator;
import org.eclipse.wst.common.ui.internal.dnd.DefaultDragAndDropCommand;
import org.eclipse.wst.dtd.core.internal.DTDFile;
import org.eclipse.wst.dtd.core.internal.DTDNode;
import org.eclipse.wst.dtd.core.internal.TopLevelNode;
import org.eclipse.wst.dtd.core.internal.document.DTDModelImpl;
import org.eclipse.wst.dtd.ui.internal.DTDUIMessages;

public class DragTopLevelNodesCommand
  extends DefaultDragAndDropCommand
{
  private static final String moveNode = DTDUIMessages._UI_MOVE_NODE;
  private static final String moveNodes = DTDUIMessages._UI_MOVE_NODES;
  
  public DragTopLevelNodesCommand(Object target, float location, int operations, int operation, Collection sources)
  {
    super(target, location, operations, operation, sources);
  }
  
  public boolean canExecute()
  {
    if (!(target instanceof TopLevelNode)) {
      return false;
    }
    Iterator iter = sources.iterator();
    while (iter.hasNext())
    {
      Object source = iter.next();
      if (!(source instanceof TopLevelNode)) {
        return false;
      }
    }
    return true;
  }
  
  public void execute()
  {
    DTDNode referenceNode = (DTDNode)target;
    
    DTDFile dtdFile = referenceNode.getDTDFile();
    dtdFile.getDTDModel().beginRecording(this, sources.size() > 1 ? moveNodes : moveNode);
    Iterator iter = sources.iterator();
    while (iter.hasNext())
    {
      DTDNode node = (DTDNode)iter.next();
      if ((node instanceof TopLevelNode)) {
        dtdFile.moveNode(this, referenceNode, node, isAfter());
      }
    }
    dtdFile.getDTDModel().endRecording(this);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.dtd.ui.internal.dnd.DragTopLevelNodesCommand
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.dtd.ui.internal.editor;

import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.action.MenuManager;
import org.eclipse.wst.dtd.ui.internal.DTDUIMessages;
import org.eclipse.wst.sse.ui.internal.actions.ActionContributor;

public class ActionContributorDTD
  extends ActionContributor
{
  protected static final String[] EDITOR_IDS = { "org.eclipse.wst.dtd.core.dtdsource.source", "org.eclipse.wst.sse.ui.StructuredTextEditor" };
  
  protected String[] getExtensionIDs()
  {
    return EDITOR_IDS;
  }
  
  protected void addToMenu(IMenuManager menu)
  {
    IMenuManager editMenu = menu.findMenuUsingPath("edit");
    if (editMenu != null)
    {
      editMenu.add(fCommandsSeparator);
      editMenu.add(fToggleInsertModeAction);
      editMenu.add(fCommandsSeparator);
      editMenu.add(fExpandSelectionToMenu);
      editMenu.add(fCommandsSeparator);
      editMenu.add(fMenuAdditionsGroupMarker);
    }
    String sourceMenuLabel = DTDUIMessages.SourceMenu_label;
    String sourceMenuId = "sourceMenuId";
    IMenuManager sourceMenu = new MenuManager(sourceMenuLabel, sourceMenuId);
    menu.insertAfter("edit", sourceMenu);
    if (sourceMenu != null)
    {
      sourceMenu.add(fCommandsSeparator);
      sourceMenu.add(fShiftRight);
      sourceMenu.add(fShiftLeft);
      sourceMenu.add(fCommandsSeparator);
    }
    IMenuManager navigateMenu = menu.findMenuUsingPath("navigate");
    if (navigateMenu != null)
    {
      IMenuManager gotoGroup = navigateMenu.findMenuUsingPath("goTo");
      if (gotoGroup != null) {
        gotoGroup.add(fGotoMatchingBracketAction);
      }
    }
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.dtd.ui.internal.editor.ActionContributorDTD
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.dtd.ui.internal.editor;

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;
import org.eclipse.wst.dtd.ui.internal.DTDUIPlugin;
import org.osgi.framework.Bundle;

public class DTDEditorPluginImageHelper
{
  private static DTDEditorPluginImageHelper instance = null;
  
  public static synchronized DTDEditorPluginImageHelper getInstance()
  {
    if (instance == null) {
      instance = new DTDEditorPluginImageHelper();
    }
    return instance;
  }
  
  private HashMap fImageDescRegistry = null;
  private final String PLUGINID = DTDUIPlugin.getDefault().getBundle().getSymbolicName();
  
  private Image createImage(String resource)
  {
    ImageDescriptor desc = getImageDescriptor(resource);
    Image image = null;
    if (desc != null)
    {
      image = desc.createImage();
      if (!desc.equals(ImageDescriptor.getMissingImageDescriptor())) {
        getImageRegistry().put(resource, image);
      }
    }
    return image;
  }
  
  private ImageDescriptor createImageDescriptor(String imageFilePath)
  {
    ImageDescriptor imageDescriptor = AbstractUIPlugin.imageDescriptorFromPlugin(PLUGINID, imageFilePath);
    if (imageDescriptor != null) {
      getImageDescriptorRegistry().put(imageFilePath, imageDescriptor);
    } else {
      imageDescriptor = ImageDescriptor.getMissingImageDescriptor();
    }
    return imageDescriptor;
  }
  
  public Image getImage(String resource)
  {
    Image image = getImageRegistry().get(resource);
    if (image == null) {
      image = createImage(resource);
    }
    return image;
  }
  
  public ImageDescriptor getImageDescriptor(String resource)
  {
    ImageDescriptor imageDescriptor = null;
    Object o = getImageDescriptorRegistry().get(resource);
    if (o == null) {
      imageDescriptor = createImageDescriptor(resource);
    } 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.dtd.ui.internal.editor.DTDEditorPluginImageHelper
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.dtd.ui.internal.editor;

public class DTDEditorPluginImages
{
  public static final String IMG_CTOOL_ADD_ATTRIBUTE = "icons/full/ctool16/ADD_Attribute.gif";
  public static final String IMG_CTOOL_ADD_ELEMENT = "icons/full/ctool16/ADD_Element.gif";
  public static final String IMG_CTOOL_ADD_ELEMENTTOCONMODEL = "icons/full/ctool16/ADD_ElementToConModel.gif";
  public static final String IMG_CTOOL_ADD_GROUPTOCONMODEL = "icons/full/ctool16/ADD_GroupToConModel.gif";
  public static final String IMG_DTOOL_ADD_ATTRIBUTE = "icons/full/dtool16/ADD_Attribute.gif";
  public static final String IMG_DTOOL_ADD_ELEMENT = "icons/full/dtool16/ADD_Element.gif";
  public static final String IMG_DTOOL_ADD_ELEMENTTOCONMODEL = "icons/full/dtool16/ADD_ElementToConModel.gif";
  public static final String IMG_DTOOL_ADD_GROUPTOCONMODEL = "icons/full/dtool16/ADD_GroupToConModel.gif";
  public static final String IMG_ETOOL_ADD_ATTRIBUTE = "icons/full/etool16/ADD_Attribute.gif";
  public static final String IMG_ETOOL_ADD_ELEMENT = "icons/full/etool16/ADD_Element.gif";
  public static final String IMG_ETOOL_ADD_ELEMENTTOCONMODEL = "icons/full/etool16/ADD_ElementToConModel.gif";
  public static final String IMG_ETOOL_ADD_GROUPTOCONMODEL = "icons/full/etool16/ADD_GroupToConModel.gif";
  public static final String IMG_OBJ_ADD_COMMENT = "icons/full/obj16/ADD_Comment.gif";
  public static final String IMG_OBJ_ADD_ENTITY = "icons/full/obj16/ADD_Entity.gif";
  public static final String IMG_OBJ_ADD_ENTITY_REFERENCE = "icons/full/obj16/ADD_Entity_Reference.gif";
  public static final String IMG_OBJ_ADD_NOTATION = "icons/full/obj16/ADD_Notation.gif";
  public static final String IMG_OBJ_ORGANIZE_DTD_LOGICALLY = "icons/full/obj16/organize_dtd_logically.gif";
  public static final String IMG_OBJ_SORT = "icons/full/obj16/sort.gif";
  public static final String IMG_OBJ_VALIDATE = "icons/full/obj16/validate.gif";
  public static final String IMG_WIZBAN_NEWDTDFILE = "icons/full/wizban/newdtdfile_wiz.png";
}

/* Location:
 * Qualified Name:     org.eclipse.wst.dtd.ui.internal.editor.DTDEditorPluginImages
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.dtd.ui.internal.editor;

import org.eclipse.wst.dtd.ui.internal.DTDUIPlugin;
import org.osgi.framework.Bundle;

public abstract interface IHelpContextIds
{
  public static final String PREFIX = DTDUIPlugin.getDefault().getBundle().getSymbolicName() + ".";
  public static final String DTD_PREFWEBX_FILES_HELPID = PREFIX + "webx0020";
  public static final String DTD_PREFWEBX_STYLES_HELPID = PREFIX + "webx0021";
  public static final String DTD_PREFWEBX_TEMPLATES_HELPID = PREFIX + "webx0022";
  public static final String DTD_NEWWIZARD_TEMPLATE_HELPID = PREFIX + "dtdw0010";
}

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

import java.util.ArrayList;
import java.util.Dictionary;
import java.util.Hashtable;
import java.util.Iterator;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.help.IWorkbenchHelpSystem;
import org.eclipse.wst.dtd.core.internal.provisional.contenttype.ContentTypeIdForDTD;
import org.eclipse.wst.dtd.ui.internal.DTDUIMessages;
import org.eclipse.wst.dtd.ui.internal.DTDUIPlugin;
import org.eclipse.wst.dtd.ui.internal.editor.IHelpContextIds;
import org.eclipse.wst.sse.core.StructuredModelManager;
import org.eclipse.wst.sse.core.internal.provisional.IModelManager;
import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
import org.eclipse.wst.sse.ui.internal.preferences.OverlayPreferenceStore;
import org.eclipse.wst.sse.ui.internal.preferences.OverlayPreferenceStore.OverlayKey;
import org.eclipse.wst.sse.ui.internal.preferences.ui.AbstractColorPage;
import org.eclipse.wst.sse.ui.internal.preferences.ui.StyledTextColorPicker;

/**
 * @deprecated
 */
public class DTDColorPage
  extends AbstractColorPage
{
  protected Control createContents(Composite parent)
  {
    Composite pageComponent = createComposite(parent, 1);
    getLayoutDatahorizontalAlignment = 256;
    
    super.createContents(pageComponent);
    PlatformUI.getWorkbench().getHelpSystem().setHelp(pageComponent, IHelpContextIds.DTD_PREFWEBX_STYLES_HELPID);
    
    return pageComponent;
  }
  
  protected OverlayPreferenceStore.OverlayKey[] createOverlayStoreKeys()
  {
    ArrayList overlayKeys = new ArrayList();
    
    ArrayList styleList = new ArrayList();
    initStyleList(styleList);
    Iterator i = styleList.iterator();
    while (i.hasNext()) {
      overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, (String)i.next()));
    }
    OverlayPreferenceStore.OverlayKey[] keys = new OverlayPreferenceStore.OverlayKey[overlayKeys.size()];
    overlayKeys.toArray(keys);
    return keys;
  }
  
  protected IPreferenceStore doGetPreferenceStore()
  {
    return DTDUIPlugin.getDefault().getPreferenceStore();
  }
  
  public String getSampleText()
  {
    return DTDUIMessages.DTDColorPage_0;
  }
  
  protected void initContextStyleMap(Dictionary contextStyleMap)
  {
    contextStyleMap.put("org.eclipse.wst.dtd.core.internal.util.parser.DTDRegionTypes.CONTENT_EMPTY", "dtdData");
    contextStyleMap.put("org.eclipse.wst.dtd.core.internal.util.parser.DTDRegionTypes.CONTENT_ANY", "dtdData");
    contextStyleMap.put("org.eclipse.wst.dtd.core.internal.util.parser.DTDRegionTypes.CONTENT_PCDATA", "dtdData");
    contextStyleMap.put("org.eclipse.wst.dtd.core.internal.util.parser.DTDRegionTypes.NDATA_VALUE", "dtdData");
    contextStyleMap.put("org.eclipse.wst.dtd.core.internal.util.parser.DTDRegionTypes.NAME", "dtdData");
    contextStyleMap.put("org.eclipse.wst.dtd.core.internal.util.parser.DTDRegionTypes.ENTITY_PARM", "dtdData");
    
    contextStyleMap.put("org.eclipse.wst.dtd.core.internal.util.parser.DTDRegionTypes.ELEMENT_TAG", "dtdTagName");
    contextStyleMap.put("org.eclipse.wst.dtd.core.internal.util.parser.DTDRegionTypes.ENTITY_TAG", "dtdTagName");
    contextStyleMap.put("org.eclipse.wst.dtd.core.internal.util.parser.DTDRegionTypes.ATTLIST_TAG", "dtdTagName");
    contextStyleMap.put("org.eclipse.wst.dtd.core.internal.util.parser.DTDRegionTypes.NOTATION_TAG", "dtdTagName");
    
    contextStyleMap.put("org.eclipse.wst.dtd.core.internal.util.parser.DTDRegionTypes.CONNECTOR", "dtdSymbol");
    contextStyleMap.put("org.eclipse.wst.dtd.core.internal.util.parser.DTDRegionTypes.OCCUR_TYPE", "dtdSymbol");
    
    contextStyleMap.put("org.eclipse.wst.dtd.core.internal.util.parser.DTDRegionTypes.START_TAG", "dtdTag");
    contextStyleMap.put("org.eclipse.wst.dtd.core.internal.util.parser.DTDRegionTypes.END_TAG", "dtdTag");
    contextStyleMap.put("org.eclipse.wst.dtd.core.internal.util.parser.DTDRegionTypes.EXCLAMATION", "dtdTag");
    
    contextStyleMap.put("org.eclipse.wst.dtd.core.internal.util.parser.DTDRegionTypes.COMMENT", "dtdComment");
    contextStyleMap.put("org.eclipse.wst.dtd.core.internal.util.parser.DTDRegionTypes.COMMENT_CONTENT", "dtdComment");
    contextStyleMap.put("org.eclipse.wst.dtd.core.internal.util.parser.DTDRegionTypes.COMMENT_END", "dtdComment");
    
    contextStyleMap.put("org.eclipse.wst.dtd.core.internal.util.parser.DTDRegionTypes.SINGLEQUOTED_LITERAL", "dtdString");
    contextStyleMap.put("org.eclipse.wst.dtd.core.internal.util.parser.DTDRegionTypes.DOUBLEQUOTED_LITERAL", "dtdString");
    
    contextStyleMap.put("org.eclipse.wst.dtd.core.internal.util.parser.DTDRegionTypes.SYSTEM_KEYWORD", "dtdKeyword");
    contextStyleMap.put("org.eclipse.wst.dtd.core.internal.util.parser.DTDRegionTypes.PUBLIC_KEYWORD", "dtdKeyword");
    contextStyleMap.put("org.eclipse.wst.dtd.core.internal.util.parser.DTDRegionTypes.NDATA_KEYWORD", "dtdKeyword");
    contextStyleMap.put("org.eclipse.wst.dtd.core.internal.util.parser.DTDRegionTypes.CDATA_KEYWORD", "dtdKeyword");
    contextStyleMap.put("org.eclipse.wst.dtd.core.internal.util.parser.DTDRegionTypes.ID_KEYWORD", "dtdKeyword");
    contextStyleMap.put("org.eclipse.
1 2 3 4 5 6 7 8

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