org.eclipse.pde.ds.ui_1.0.100.v20111213-1754

16:47:26.548 INFO  jd.cli.Main - Decompiling org.eclipse.pde.ds.ui_1.0.100.v20111213-1754.jar
package org.eclipse.pde.internal.ds.ui;

import org.eclipse.core.runtime.IStatus;
import org.eclipse.jface.dialogs.ErrorDialog;

class Activator$1
  implements Runnable
{
  private final String val$title;
  private final IStatus val$fstatus;
  
  Activator$1(String paramString, IStatus paramIStatus)
  {
    val$title = paramString;val$fstatus = paramIStatus;
  }
  
  public void run()
  {
    ErrorDialog.openError(null, val$title, null, val$fstatus);
  }
}

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

import java.lang.reflect.InvocationTargetException;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.ILog;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.jface.dialogs.ErrorDialog;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.resource.ImageRegistry;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.BundleContext;

public class Activator
  extends AbstractUIPlugin
{
  public static final String PLUGIN_ID = "org.eclipse.pde.ds.ui";
  private static Activator plugin;
  
  public void start(BundleContext context)
    throws Exception
  {
    super.start(context);
    plugin = this;
  }
  
  public void stop(BundleContext context)
    throws Exception
  {
    plugin = null;
    super.stop(context);
  }
  
  public static Activator getDefault()
  {
    return plugin;
  }
  
  protected void initializeImageRegistry(ImageRegistry registry)
  {
    registry.put("icons/obj16/class_obj.gif", 
      createImageDescriptor("icons/obj16/class_obj.gif"));
    registry.put("icons/obj16/properties_obj.gif", 
      createImageDescriptor("icons/obj16/properties_obj.gif"));
    registry.put("icons/obj16/property_obj.gif", 
      createImageDescriptor("icons/obj16/property_obj.gif"));
    registry.put("icons/obj16/int_obj.gif", 
      createImageDescriptor("icons/obj16/int_obj.gif"));
    registry.put("icons/obj16/reference_obj.gif", 
      createImageDescriptor("icons/obj16/reference_obj.gif"));
    registry.put("icons/obj16/reference_zero_n_obj.gif", 
      createImageDescriptor("icons/obj16/reference_zero_n_obj.gif"));
    registry.put("icons/obj16/reference_zero_one_obj.gif", 
      createImageDescriptor("icons/obj16/reference_zero_one_obj.gif"));
    registry.put("icons/obj16/reference_one_n_obj.gif", 
      createImageDescriptor("icons/obj16/reference_one_n_obj.gif"));
    registry.put("icons/obj16/component_obj.gif", 
      createImageDescriptor("icons/obj16/component_obj.gif"));
    registry.put("icons/obj16/service_obj.gif", 
      createImageDescriptor("icons/obj16/service_obj.gif"));
    registry.put("icons/obj16/services_obj.gif", 
      createImageDescriptor("icons/obj16/services_obj.gif"));
    registry.put("icons/obj16/ds_obj.gif", 
      createImageDescriptor("icons/obj16/ds_obj.gif"));
    registry.put("icons/obj16/attribute_obj.gif", 
      createImageDescriptor("icons/obj16/attribute_obj.gif"));
    registry.put("icons/ovr16/synch_co.gif", 
      createImageDescriptor("icons/ovr16/synch_co.gif"));
    registry.put("icons/obj16/details_obj.gif", 
      createImageDescriptor("icons/obj16/details_obj.gif"));
    registry.put("icons/wizban/defcon_wiz.png", 
      createImageDescriptor("icons/wizban/defcon_wiz.png"));
  }
  
  private ImageDescriptor createImageDescriptor(String id)
  {
    return imageDescriptorFromPlugin("org.eclipse.pde.ds.ui", id);
  }
  
  public static Shell getActiveWorkbenchShell()
  {
    IWorkbenchWindow window = getActiveWorkbenchWindow();
    if (window != null) {
      return window.getShell();
    }
    return null;
  }
  
  public static IWorkbenchWindow getActiveWorkbenchWindow()
  {
    return getDefault().getWorkbench().getActiveWorkbenchWindow();
  }
  
  public static void logException(Throwable e, String title, String message)
  {
    if ((e instanceof InvocationTargetException)) {
      e = ((InvocationTargetException)e).getTargetException();
    }
    IStatus status = null;
    if ((e instanceof CoreException))
    {
      status = ((CoreException)e).getStatus();
    }
    else
    {
      if (message == null) {
        message = e.getMessage();
      }
      if (message == null) {
        message = e.toString();
      }
      status = new Status(4, "org.eclipse.pde.ds.ui", 0, 
        message, e);
    }
    ResourcesPlugin.getPlugin().getLog().log(status);
    Display display = Display.getCurrent() == null ? Display.getCurrent() : 
      Display.getDefault();
    IStatus fstatus = status;
    display.asyncExec(new Runnable()
    {
      private final IStatus val$fstatus;
      
      public void run()
      {
        ErrorDialog.openError(null, Activator.this, null, val$fstatus);
      }
    });
  }
  
  public static void logException(Throwable e)
  {
    logException(e, null, null);
  }
}

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

public abstract interface IConstants
{
  public static final String ID_EDITOR = "org.eclipse.pde.ui.dsEditor";
  public static final String ID_BUILDER = "org.eclipse.pde.ds.core.builder";
}

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

import org.eclipse.osgi.util.NLS;

public class Messages
  extends NLS
{
  public static String DSAddItemAction_addProperties;
  public static String DSAddItemAction_addProperty;
  public static String DSAddItemAction_addProvidedService;
  public static String DSAddItemAction_addReferencedService;
  public static String DSAddItemAction_addService;
  public static String DSComponentDetails_mainSectionTitle;
  public static String DSComponentDetails_mainSectionDescription;
  public static String DSComponentDetails_nameEntry;
  public static String DSComponentDetails_activateEntry;
  public static String DSComponentDetails_activateTooltip;
  public static String DSComponentDetails_deactivateEntry;
  public static String DSComponentDetails_deactivateTooltip;
  public static String DSComponentDetails_modifiedEntry;
  public static String DSComponentDetails_modifiedTooltip;
  public static String DSComponentDetails_factoryEntry;
  public static String DSComponentDetails_configurationPolicy;
  public static String DSComponentDetails_enabledLabel;
  public static String DSComponentDetails_immediateLabel;
  public static String DSComponentDetails_browse;
  public static String DSCreationOperation_title;
  public static String DSFileWizardPage_description;
  public static String DSFileWizardPage_title;
  public static String DSFileWizardPage_group;
  public static String DSFileWizardPage_component_name;
  public static String DSFileWizardPage_implementation_class;
  public static String DSFileWizardPage_browse;
  public static String DSFileWizardPage_ComponentNeedsClass;
  public static String DSFileWizardPage_ComponentNeedsFileName;
  public static String DSFileWizardPage_ComponentNeedsName;
  public static String DSFileWizardPage_ExampleComponentName;
  public static String DSFileWizardPage_selectType;
  public static String DSFileWizardPage_not_OSGI_folder;
  public static String DSNewWizard_title;
  public static String DSImplementationDetails_title;
  public static String DSImplementationDetails_description;
  public static String DSImplementationDetails_classEntry;
  public static String DSImplementationDetails_browse;
  public static String DSImplementationDetails_selectType;
  public static String DSPage_errorTitle;
  public static String DSPage_errorMessage;
  public static String DSPage_formTitle;
  public static String DSPage_title;
  public static String DSPluginTemplateWizard_title;
  public static String DSPropertiesDetails_sectionTitle;
  public static String DSPropertiesDetails_sectionDescription;
  public static String DSPropertiesDetails_entry;
  public static String DSPropertiesDetails_browse;
  public static String DSPropertiesDetails_dialogTitle;
  public static String DSPropertiesDetails_dialogMessage;
  public static String DSPropertyDetails_mainSectionText;
  public static String DSPropertyDetails_mainSectionDescription;
  public static String DSPropertyDetails_nameEntry;
  public static String DSPropertyDetails_valueEntry;
  public static String DSPropertyDetails_typeEntry;
  public static String DSPropertyDetails_bodyLabel;
  public static String DSProvideDetails_mainSectionText;
  public static String DSProvideDetails_mainSectionDesc;
  public static String DSProvideDetails_interface;
  public static String DSProvideDetails_browse;
  public static String DSProvideDetails_selectType;
  public static String DSServiceDetails_sectionTitle;
  public static String DSServiceDetails_sectionDescription;
  public static String DSServiceDetails_serviceFactoryLabel;
  public static String DSSourcePage_partName;
  public static String DSMasterTreeSection_addService;
  public static String DSMasterTreeSection_addProperty;
  public static String DSMasterTreeSection_addProperties;
  public static String DSMasterTreeSection_addReference;
  public static String DSMasterTreeSection_addProvide;
  public static String DSMasterTreeSection_up;
  public static String DSMasterTreeSection_down;
  public static String DSMasterTreeSection_remove;
  public static String DSMasterTreeSection_client_text;
  public static String DSMasterTreeSection_client_description;
  public static String DSReferenceDetails_title;
  public static String DSReferenceDetails_description;
  public static String DSReferenceDetails_bindEntry;
  public static String DSReferenceDetails_unbindEntry;
  public static String DSReferenceDetails_policeLabel;
  public static String DSReferenceDetails_nameEntry;
  public static String DSReferenceDetails_interfaceEntry;
  public static String DSReferenceDetails_cardinalityLabel;
  public static String DSReferenceDetails_targetEntry;
  public static String DSReferenceDetails_browse;
  public static String DSReferenceDetails_selectType;
  public static String DSRemoveItemAction_actionText;
  public static String DSSimpPage_title;
  public static String DSServicesPage_title;
  public static String DSSection_title;
  public static String DSSection_description;
  public static String DSOptionsSection_title;
  public static String DSOptionsSection_description;
  public static String DSReferenceSection_title;
  public static String DSReferenceSection_description;
  public static String DSReferenceSection_add;
  public static String DSReferenceSection_remove;
  public static String DSReferenceSection_edit;
  public static String DSReferenceSection_up;
  public static String DSReferenceSection_down;
  public static String DSProvideSection_title;
  public static String DSProvideSection_description;
  public static String DSProvideSection_add;
  public static String DSProvideSection_remove;
  public static String DSProvideSection_edit;
  public static String DSProvideSection_ServiceFactoryButtonMessage;
  public static String DSEditReferenceDialog_OK;
  public static String DSEditReferenceDialog_Cancel;
  public static String DSEditReferenceDialog_dialog_title;
  public static String DSEditReferenceDialog_dialogMessage;
  public static String DSEditProvideDialog_OK;
  public static String DSEditProvideDialog_Cancel;
  public static String DSEditProvideDialog_dialog_title;
  public static String DSEditProvideDialog_dialogMessage;
  public static String DSPropertiesSection_title;
  public static String DSPropertiesSection_description;
  public static String DSPropertiesSection_addProperties;
  public static String DSPropertiesSection_addProperty;
  public static String DSPropertiesSection_remove;
  public static String DSPropertiesSection_edit;
  public static String DSPropertiesSection_up;
  public static String DSPropertiesSection_down;
  public static String DSEditPropertiesDialog_OK;
  public static String DSEditPropertiesDialog_Cancel;
  public static String DSEditPropertiesDialog_dialog_title;
  public static String DSEditPropertiesDialog_dialogMessage;
  public static String DSEditPropertyDialog_dialog_title;
  public static String DSEditPropertyDialog_dialogMessage;
  public static String DSEditPropertyDialog_valuesLabel;
  public static String DSServiceComponentSection_immediateButtonMessage;
  public static String DSServiceComponentSection_enabledButtonMessage;
  public static String DSService_title;
  private static final String BUNDLE_NAME = "org.eclipse.pde.internal.ds.ui.messages";
  
  static
  {
    NLS.initializeMessages("org.eclipse.pde.internal.ds.ui.messages", Messages.class);
  }
}

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

import org.eclipse.core.runtime.Assert;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.layout.PixelConverter;
import org.eclipse.jface.resource.JFaceResources;
import org.eclipse.swt.dnd.DragSource;
import org.eclipse.swt.dnd.DropTarget;
import org.eclipse.swt.graphics.Font;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Canvas;
import org.eclipse.swt.widgets.Caret;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Decorations;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Menu;
import org.eclipse.swt.widgets.ScrollBar;
import org.eclipse.swt.widgets.Scrollable;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Widget;

public class SWTUtil
{
  public static Display getStandardDisplay()
  {
    Display display = Display.getCurrent();
    if (display == null) {
      display = Display.getDefault();
    }
    return display;
  }
  
  public static Shell getShell(Widget widget)
  {
    if ((widget instanceof Control)) {
      return ((Control)widget).getShell();
    }
    if ((widget instanceof Caret)) {
      return ((Caret)widget).getParent().getShell();
    }
    if ((widget instanceof DragSource)) {
      return ((DragSource)widget).getControl().getShell();
    }
    if ((widget instanceof DropTarget)) {
      return ((DropTarget)widget).getControl().getShell();
    }
    if ((widget instanceof Menu)) {
      return ((Menu)widget).getParent().getShell();
    }
    if ((widget instanceof ScrollBar)) {
      return ((ScrollBar)widget).getParent().getShell();
    }
    return null;
  }
  
  public static int getButtonWidthHint(Button button)
  {
    if (button.getFont().equals(JFaceResources.getDefaultFont())) {
      button.setFont(JFaceResources.getDialogFont());
    }
    PixelConverter converter = new PixelConverter(button);
    int widthHint = converter.convertHorizontalDLUsToPixels(61);
    return Math.max(widthHint, computeSize-1-1x);
  }
  
  public static void setButtonDimensionHint(Button button)
  {
    Dialog.applyDialogFont(button);
    Assert.isNotNull(button);
    Object gd = button.getLayoutData();
    if ((gd instanceof GridData)) {
      widthHint = getButtonWidthHint(button);
    }
  }
  
  public static void setDialogSize(Dialog dialog, int width, int height)
  {
    Point computedSize = dialog.getShell().computeSize(-1, -1);
    width = Math.max(x, width);
    height = Math.max(y, height);
    dialog.getShell().setSize(width, height);
  }
}

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

import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.resource.ImageRegistry;
import org.eclipse.jface.viewers.DecorationOverlayIcon;
import org.eclipse.swt.graphics.Image;

public final class SharedImages
{
  public static final int F_DYNAMIC = 1;
  public static final String ICONS_PATH = "icons/";
  private static final String PATH_OBJ = "icons/obj16/";
  private static final String PATH_OVR = "icons/ovr16/";
  private static final String PATH_WIZBAN = "icons/wizban/";
  public static final String DESC_IMPLEMENTATION = "icons/obj16/class_obj.gif";
  public static final String DESC_PROPERTY = "icons/obj16/property_obj.gif";
  public static final String DESC_PROPERTIES = "icons/obj16/properties_obj.gif";
  public static final String DESC_PROVIDE = "icons/obj16/int_obj.gif";
  public static final String DESC_REFERENCE = "icons/obj16/reference_obj.gif";
  public static final String DESC_REFERENCE_ONE_N = "icons/obj16/reference_one_n_obj.gif";
  public static final String DESC_REFERENCE_ZERO_ONE = "icons/obj16/reference_zero_one_obj.gif";
  public static final String DESC_REFERENCE_ZERO_N = "icons/obj16/reference_zero_n_obj.gif";
  public static final String DESC_ROOT = "icons/obj16/component_obj.gif";
  public static final String DESC_SERVICE = "icons/obj16/service_obj.gif";
  public static final String DESC_SERVICES = "icons/obj16/services_obj.gif";
  public static final String DESC_DS = "icons/obj16/ds_obj.gif";
  public static final String DESC_ATTR = "icons/obj16/attribute_obj.gif";
  public static final String DESC_DETAILS = "icons/obj16/details_obj.gif";
  public static final String OVR_DYNAMIC = "icons/ovr16/synch_co.gif";
  public static final String DESC_DS_WIZ = "icons/wizban/defcon_wiz.png";
  
  public static ImageDescriptor getImageDescriptor(String key)
  {
    return Activator.getDefault().getImageRegistry().getDescriptor(key);
  }
  
  public static Image getImage(String key)
  {
    return Activator.getDefault().getImageRegistry().get(key);
  }
  
  public static Image getImage(String key, int flags)
  {
    Image image = Activator.getDefault().getImageRegistry().get(key);
    if ((flags & 0x1) != 0)
    {
      Image o = Activator.getDefault().getImageRegistry().get(
        key + "icons/ovr16/synch_co.gif");
      if (o != null) {
        return o;
      }
      Image i = new DecorationOverlayIcon(image, 
        getImageDescriptor("icons/ovr16/synch_co.gif"), 
        1)
        .createImage();
      Activator.getDefault().getImageRegistry().put(key + "icons/ovr16/synch_co.gif", i);
      return i;
    }
    return image;
  }
}

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

import java.util.List;
import org.eclipse.jface.viewers.IContentProvider;
import org.eclipse.jface.viewers.ITreeContentProvider;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.pde.internal.ds.core.IDSModel;
import org.eclipse.pde.internal.ds.core.IDSObject;

public class DSContentProvider
  implements IContentProvider, ITreeContentProvider
{
  public Object[] getChildren(Object parentElement)
  {
    if ((parentElement instanceof IDSModel)) {
      return new Object[] { ((IDSModel)parentElement).getDSComponent() };
    }
    if ((parentElement instanceof IDSObject))
    {
      List list = ((IDSObject)parentElement).getChildNodesList();
      if (list.size() > 0) {
        return list.toArray();
      }
    }
    return new Object[0];
  }
  
  public Object getParent(Object element)
  {
    if ((element instanceof IDSObject)) {
      return ((IDSObject)element).getParentNode();
    }
    return null;
  }
  
  public boolean hasChildren(Object element)
  {
    return getChildren(element).length > 0;
  }
  
  public Object[] getElements(Object inputElement)
  {
    return getChildren(inputElement);
  }
  
  public void dispose() {}
  
  public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {}
}

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

import org.eclipse.core.filesystem.EFS;
import org.eclipse.core.filesystem.IFileStore;
import org.eclipse.core.resources.ICommand;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IProjectDescription;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.jface.action.IToolBarManager;
import org.eclipse.pde.internal.ds.ui.Activator;
import org.eclipse.pde.internal.ui.editor.ISortableContentOutlinePage;
import org.eclipse.pde.internal.ui.editor.MultiSourceEditor;
import org.eclipse.pde.internal.ui.editor.PDEFormEditor;
import org.eclipse.pde.internal.ui.editor.PDESourcePage;
import org.eclipse.pde.internal.ui.editor.context.InputContext;
import org.eclipse.pde.internal.ui.editor.context.InputContextManager;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IFileEditorInput;
import org.eclipse.ui.IStorageEditorInput;
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.ide.FileStoreEditorInput;

public class DSEditor
  extends MultiSourceEditor
{
  protected void addEditorPages()
  {
    try
    {
      addPage(new DSOverviewPage(this));
      addPage(new DSServicesPage(this));
    }
    catch (PartInitException e)
    {
      Activator.logException(e);
    }
    addSourcePage("ds-context");
  }
  
  public void contributeToToolbar(IToolBarManager manager) {}
  
  protected ISortableContentOutlinePage createContentOutline()
  {
    return new DSFormOutlinePage(this);
  }
  
  protected InputContextManager createInputContextManager()
  {
    return new DSInputContextManager(this);
  }
  
  protected void createResourceContexts(InputContextManager contexts, IFileEditorInput input)
  {
    contexts.putContext(input, new DSInputContext(this, input, true));
    contexts.monitorFile(input.getFile());
  }
  
  protected void createStorageContexts(InputContextManager contexts, IStorageEditorInput input)
  {
    contexts.putContext(input, new DSInputContext(this, input, true));
  }
  
  protected void createSystemFileContexts(InputContextManager contexts, FileStoreEditorInput input)
  {
    try
    {
      IFileStore store = EFS.getStore(input.getURI());
      IEditorInput in = new FileStoreEditorInput(store);
      contexts.putContext(in, new DSInputContext(this, in, true));
    }
    catch (CoreException e)
    {
      Activator.logException(e);
    }
  }
  
  private void addDSBuilder(IFile file)
  {
    try
    {
      IProject project = file.getProject();
      IProjectDescription description = project.getDescription();
      ICommand[] commands = description.getBuildSpec();
      for (int i = 0; i < commands.length; i++) {
        if (commands[i].getBuilderName().equals("org.eclipse.pde.ds.core.builder")) {
          return;
        }
      }
      ICommand[] newCommands = new ICommand[commands.length + 1];
      System.arraycopy(commands, 0, newCommands, 0, commands.length);
      ICommand command = description.newCommand();
      command.setBuilderName("org.eclipse.pde.ds.core.builder");
      newCommands[(newCommands.length - 1)] = command;
      description.setBuildSpec(newCommands);
      project.setDescription(description, null);
    }
    catch (CoreException e)
    {
      Activator.logException(e, null, null);
    }
  }
  
  public void editorContextAdded(InputContext context)
  {
    addSourcePage(context.getId());
  }
  
  protected String getEditorID()
  {
    return "org.eclipse.pde.ui.dsEditor";
  }
  
  protected InputContext getInputContext(Object object)
  {
    return fInputContextManager.findContext("ds-context");
  }
  
  public void contextRemoved(InputContext context)
  {
    close(false);
  }
  
  public void monitoredFileAdded(IFile monitoredFile) {}
  
  public boolean monitoredFileRemoved(IFile monitoredFile)
  {
    return true;
  }
  
  public boolean isSaveAsAllowed()
  {
    return true;
  }
  
  public void doSave(IProgressMonitor monitor)
  {
    IEditorInput input = getEditorInput();
    if ((input instanceof IFileEditorInput))
    {
      IFileEditorInput fileInput = (IFileEditorInput)input;
      addDSBuilder(fileInput.getFile());
    }
    super.doSave(monitor);
  }
  
  protected PDESourcePage createSourcePage(PDEFormEditor editor, String title, String name, String contextId)
  {
    return new DSSourcePage(editor, title, name);
  }
}

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

import org.eclipse.pde.internal.ui.editor.PDEFormTextEditorContributor;

public class DSEditorContributor
  extends PDEFormTextEditorContributor
{
  public DSEditorContributor()
  {
    super("DS Editor");
  }
  
  public boolean supportsHyperlinking()
  {
    return true;
  }
  
  public boolean supportsContentAssist()
  {
    return true;
  }
}

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

import org.eclipse.jface.viewers.ILabelProvider;
import org.eclipse.pde.internal.ui.editor.FormOutlinePage;
import org.eclipse.pde.internal.ui.editor.PDEFormEditor;

public class DSFormOutlinePage
  extends FormOutlinePage
{
  public DSFormOutlinePage(PDEFormEditor editor)
  {
    super(editor);
  }
  
  public ILabelProvider createLabelProvider()
  {
    return new DSLabelProvider();
  }
  
  protected String getParentPageId(Object item)
  {
    return "overview";
  }
}

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

import org.eclipse.core.resources.IResource;
import org.eclipse.jface.text.IRegion;
import org.eclipse.jface.text.Region;
import org.eclipse.jface.text.hyperlink.IHyperlink;
import org.eclipse.pde.internal.core.text.IDocumentAttributeNode;
import org.eclipse.pde.internal.core.text.IDocumentElementNode;
import org.eclipse.pde.internal.core.text.IDocumentTextNode;
import org.eclipse.pde.internal.ds.core.IDSComponent;
import org.eclipse.pde.internal.ds.core.IDSImplementation;
import org.eclipse.pde.internal.ds.core.IDSModel;
import org.eclipse.pde.internal.ds.core.IDSObject;
import org.eclipse.pde.internal.ds.core.IDSProperties;
import org.eclipse.pde.internal.ds.core.IDSProperty;
import org.eclipse.pde.internal.ds.core.IDSProvide;
import org.eclipse.pde.internal.ds.core.IDSReference;
import org.eclipse.pde.internal.ui.editor.PDEHyperlinkDetector;
import org.eclipse.pde.internal.ui.editor.PDESourcePage;
import org.eclipse.pde.internal.ui.editor.text.JavaHyperlink;
import org.eclipse.pde.internal.ui.editor.text.ResourceHyperlink;

public class DSHyperlinkDetector
  extends PDEHyperlinkDetector
{
  public DSHyperlinkDetector(PDESourcePage page)
  {
    super(page);
  }
  
  protected IHyperlink[] detectAttributeHyperlink(IDocumentAttributeNode attr)
  {
    String attrValue = attr.getAttributeValue();
    if (attrValue.length() == 0) {
      return null;
    }
    if (!(attr.getEnclosingElement() instanceof IDSObject)) {
      return null;
    }
    IDSObject node = (IDSObject)attr.getEnclosingElement();
    if ((node == null) || (!node.getModel().isEditable())) {
      return null;
    }
    IRegion linkRegion = new Region(attr.getValueOffset(), attr
      .getValueLength());
    
    IHyperlink[] link = new IHyperlink[1];
    IDSModel base = node.getModel();
    IResource res = base.getUnderlyingResource();
    if ((node instanceof IDSImplementation)) {
      link[0] = new JavaHyperlink(linkRegion, attrValue, res);
    } else if ((node instanceof IDSComponent))
    {
      if (attr.getAttributeName().equals("factory")) {
        link[0] = new JavaHyperlink(linkRegion, attrValue, res);
      }
    }
    else if ((node instanceof IDSReference))
    {
      if (attr.getAttributeName().equals(
        "interface")) {
        link[0] = new JavaHyperlink(linkRegion, attrValue, res);
      }
    }
    else if ((node instanceof IDSProperty))
    {
      if (attr.getAttributeName().equals(
        "type")) {
        link[0] = new JavaHyperlink(linkRegion, attrValue, res);
      }
    }
    else if ((node instanceof IDSProvide))
    {
      if (attr.getAttributeName().equals(
        "interface")) {
        link[0] = new JavaHyperlink(linkRegion, attrValue, res);
      }
    }
    else if (((node instanceof IDSProperties)) && 
      (attr.getAttributeName().equals("entry"))) {
      link[0] = new ResourceHyperlink(linkRegion, attrValue, res);
    }
    if (link[0] != null) {
      return link;
    }
    return null;
  }
  
  protected IHyperlink[] detectNodeHyperlink(IDocumentElementNode node)
  {
    return null;
  }
  
  protected IHyperlink[] detectTextNodeHyperlink(IDocumentTextNode node)
  {
    return null;
  }
}

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

import java.io.File;
import java.util.ArrayList;
import org.eclipse.core.filesystem.EFS;
import org.eclipse.core.filesystem.IFileStore;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.jface.text.IDocument;
import org.eclipse.pde.core.IBaseModel;
import org.eclipse.pde.internal.ds.core.text.DSModel;
import org.eclipse.pde.internal.ui.editor.JarEntryEditorInput;
import org.eclipse.pde.internal.ui.editor.PDEFormEditor;
import org.eclipse.pde.internal.ui.editor.context.XMLInputContext;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IFileEditorInput;
import org.eclipse.ui.IStorageEditorInput;
import org.eclipse.ui.IURIEditorInput;
import org.eclipse.ui.texteditor.IDocumentProvider;

public class DSInputContext
  extends XMLInputContext
{
  public static final String CONTEXT_ID = "ds-context";
  
  public DSInputContext(PDEFormEditor editor, IEditorInput input, boolean primary)
  {
    super(editor, input, primary);
    create();
  }
  
  protected void reorderInsertEdits(ArrayList ops) {}
  
  protected IBaseModel createModel(IEditorInput input)
    throws CoreException
  {
    if ((input instanceof IStorageEditorInput))
    {
      boolean isReconciling = input instanceof IFileEditorInput;
      IDocument document = getDocumentProvider().getDocument(input);
      
      DSModel model = new DSModel(document, isReconciling);
      if ((input instanceof IFileEditorInput))
      {
        IFile file = ((IFileEditorInput)input).getFile();
        model.setUnderlyingResource(file);
        model.setCharset(file.getCharset());
      }
      else if ((input instanceof IURIEditorInput))
      {
        IFileStore store = EFS.getStore(((IURIEditorInput)input)
          .getURI());
        model.setInstallLocation(store.getParent().toString());
        model.setCharset(getDefaultCharset());
      }
      else if ((input instanceof JarEntryEditorInput))
      {
        File file = (File)((JarEntryEditorInput)input)
          .getAdapter(File.class);
        model.setInstallLocation(file.toString());
        model.setCharset(getDefaultCharset());
      }
      else
      {
        model.setCharset(getDefaultCharset());
      }
      model.load();
      return model;
    }
    return null;
  }
  
  public String getId()
  {
    return "ds-context";
  }
  
  protected String getPartitionName()
  {
    return "___ds_partition";
  }
}

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

import org.eclipse.pde.core.IBaseModel;
import org.eclipse.pde.internal.ui.editor.PDEFormEditor;
import org.eclipse.pde.internal.ui.editor.context.InputContext;
import org.eclipse.pde.internal.ui.editor.context.InputContextManager;

public class DSInputContextManager
  extends InputContextManager
{
  public DSInputContextManager(PDEFormEditor editor)
  {
    super(editor);
  }
  
  public IBaseModel getAggregateModel()
  {
    InputContext context = findContext("ds-context");
    return context != null ? context.getModel() : null;
  }
}

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

import org.eclipse.jface.viewers.LabelProvider;
import org.eclipse.pde.internal.ds.core.IDSObject;
import org.eclipse.pde.internal.ds.core.IDSReference;
import org.eclipse.pde.internal.ds.ui.Messages;
import org.eclipse.pde.internal.ds.ui.SharedImages;
import org.eclipse.pde.internal.ui.PDELabelProvider;
import org.eclipse.pde.internal.ui.PDEPlugin;
import org.eclipse.pde.internal.ui.PDEPluginImages;
import org.eclipse.swt.graphics.Image;
import org.eclipse.ui.forms.editor.IFormPage;

public class DSLabelProvider
  extends LabelProvider
{
  public String getText(Object obj)
  {
    if ((obj instanceof IDSObject)) {
      return getObjectText((IDSObject)obj);
    }
    if ((obj instanceof IFormPage)) {
      return ((IFormPage)obj).getTitle();
    }
    return super.getText(obj);
  }
  
  public String getObjectText(IDSObject obj)
  {
    if (obj.getType() == 4) {
      return Messages.DSService_title;
    }
    if (obj.getType() == 6)
    {
      IDSReference reference = (IDSReference)obj;
      if ((reference.getName() == null) || 
        (reference.getName().length() == 0)) {
        return reference.getReferenceInterface();
      }
    }
    return obj.getName();
  }
  
  public Image getImage(Object obj)
  {
    if ((obj instanceof IDSObject)) {
      return getObjectImage((IDSObject)obj);
    }
    if ((obj instanceof IFormPage)) {
      return PDEPlugin.getDefault().getLabelProvider().get(
        PDEPluginImages.DESC_PAGE_OBJ);
    }
    return super.getImage(obj);
  }
  
  private Image getObjectImage(IDSObject obj)
  {
    if (obj.getType() == 1) {
      return SharedImages.getImage("icons/obj16/class_obj.gif");
    }
    if (obj.getType() == 2) {
      return SharedImages.getImage("icons/obj16/properties_obj.gif");
    }
    if (obj.getType() == 3) {
      return SharedImages.getImage("icons/obj16/property_obj.gif");
    }
    if (obj.getType() == 5) {
      return SharedImages.getImage("icons/obj16/service_obj.gif");
    }
    if (obj.getType() == 6)
    {
      IDSReference reference = (IDSReference)obj;
      int flags = 0;
      if ((reference == null) || (reference.getReferencePolicy() == null) || 
        (reference.getReferenceCardinality() == null)) {
        return 
          SharedImages.getImage("icons/obj16/reference_obj.gif", flags);
      }
      if (reference.getReferencePolicy().equals(
        "dynamic")) {
        flags |= 0x1;
      }
      String cardinality = reference.getReferenceCardinality();
      if (cardinality.equals(
        "0..1")) {
        return SharedImages.getImage(
          "icons/obj16/reference_zero_one_obj.gif", flags);
      }
      if (cardinality.equals(
        "0..n")) {
        return SharedImages.getImage(
          "icons/obj16/reference_zero_n_obj.gif", flags);
      }
      if (cardinality.equals(
        "1..n")) {
        return SharedImages.getImage("icons/obj16/reference_one_n_obj.gif", 
          flags);
      }
      return SharedImages.getImage("icons/obj16/reference_obj.gif", flags);
    }
    if (obj.getType() == 0) {
      return SharedImages.getImage("icons/obj16/component_obj.gif");
    }
    if (obj.getType() == 4) {
      return SharedImages.getImage("icons/obj16/services_obj.gif");
    }
    return null;
  }
}

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

import org.eclipse.jface.layout.GridDataFactory;
import org.eclipse.jface.layout.GridLayoutFactory;
import org.eclipse.pde.core.IModelChangedEvent;
import org.eclipse.pde.core.IModelChangedListener;
import org.eclipse.pde.internal.ds.ui.Messages;
import org.eclipse.pde.internal.ds.ui.SharedImages;
import org.eclipse.pde.internal.ds.ui.editor.sections.DSComponentSection;
import org.eclipse.pde.internal.ds.ui.editor.sections.DSOptionsSection;
import org.eclipse.pde.internal.ds.ui.editor.sections.DSPropertiesSection;
import org.eclipse.pde.internal.ui.editor.PDEFormPage;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.ui.forms.IManagedForm;
import org.eclipse.ui.forms.editor.FormEditor;
import org.eclipse.ui.forms.widgets.FormToolkit;
import org.eclipse.ui.forms.widgets.ScrolledForm;

public class DSOverviewPage
  extends PDEFormPage
  implements IModelChangedListener
{
  public static final String PAGE_ID = "overview";
  
  public DSOverviewPage(FormEditor editor)
  {
    super(editor, "overview", Messages.DSSimpPage_title);
  }
  
  public void modelChanged(IModelChangedEvent event) {}
  
  protected void createFormContent(IManagedForm managedForm)
  {
    super.createFormContent(managedForm);
    ScrolledForm form = managedForm.getForm();
    FormToolkit toolkit = managedForm.getToolkit();
    form.setImage(SharedImages.getImage("icons/obj16/ds_obj.gif"));
    form.setText(Messages.DSSimpPage_title);
    fillBody(managedForm, toolkit);
  }
  
  private void fillBody(IManagedForm managedForm, FormToolkit toolkit)
  {
    Composite body = managedForm.getForm().getBody();
    body.setLayout(FormLayoutFactory.createFormGridLayout(true, 4));
    
    Composite topLeft = toolkit.createComposite(body);
    topLeft.setLayout(GridLayoutFactory.fillDefaults().create());
    topLeft.setLayoutData(GridDataFactory.fillDefaults().grab(true, false)
      .span(2, 1).create());
    
    Composite topRight = toolkit.createComposite(body);
    topRight.setLayout(GridLayoutFactory.fillDefaults().create());
    topRight.setLayoutData(GridDataFactory.fillDefaults().grab(true, false)
      .span(2, 1).create());
    
    Composite bottom = toolkit.createComposite(body);
    bottom.setLayout(new GridLayout());
    bottom.setLayoutData(GridDataFactory.fillDefaults().grab(true, false)
      .span(4, 1).create());
    
    managedForm.addPart(new DSComponentSection(this, topLeft));
    managedForm.addPart(new DSOptionsSection(this, topRight));
    managedForm.addPart(new DSPropertiesSection(this, bottom));
  }
}

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

import org.eclipse.pde.core.IModelChangedEvent;
import org.eclipse.pde.core.IModelChangedListener;
import org.eclipse.pde.internal.ds.ui.Messages;
import org.eclipse.pde.internal.ds.ui.SharedImages;
import org.eclipse.pde.internal.ds.ui.editor.sections.DSProvideSection;
import org.eclipse.pde.internal.ds.ui.editor.sections.DSReferenceSection;
import org.eclipse.pde.internal.ui.editor.PDEFormPage;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.ui.forms.IManagedForm;
import org.eclipse.ui.forms.editor.FormEditor;
import org.eclipse.ui.forms.widgets.FormToolkit;
import org.eclipse.ui.forms.widgets.ScrolledForm;

public class DSServicesPage
  extends PDEFormPage
  implements IModelChange
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