org.eclipse.mylyn.trac.ui_3.7.1.v20120425-0100

16:47:00.765 INFO  jd.cli.Main - Decompiling org.eclipse.mylyn.trac.ui_3.7.1.v20120425-0100.jar
package org.eclipse.mylyn.internal.trac.ui;

import org.eclipse.mylyn.internal.trac.core.TracCorePlugin;
import org.eclipse.mylyn.internal.trac.core.TracRepositoryConnector;
import org.eclipse.mylyn.tasks.core.IRepositoryManager;
import org.eclipse.mylyn.tasks.ui.TaskRepositoryLocationUiFactory;
import org.eclipse.mylyn.tasks.ui.TasksUi;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.BundleContext;

public class TracUiPlugin
  extends AbstractUIPlugin
{
  public static final String ID_PLUGIN = "org.eclipse.mylyn.trac.ui";
  private static TracUiPlugin plugin;
  
  public TracUiPlugin()
  {
    plugin = this;
  }
  
  public void start(BundleContext context)
    throws Exception
  {
    super.start(context);
    
    TracCorePlugin.getDefault()
      .getConnector()
      .setTaskRepositoryLocationFactory(new TaskRepositoryLocationUiFactory());
    TasksUi.getRepositoryManager().addListener(TracCorePlugin.getDefault().getConnector().getClientManager());
  }
  
  public void stop(BundleContext context)
    throws Exception
  {
    TasksUi.getRepositoryManager().removeListener(TracCorePlugin.getDefault().getConnector().getClientManager());
    
    plugin = null;
    super.stop(context);
  }
  
  public static TracUiPlugin getDefault()
  {
    return plugin;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.internal.trac.ui.TracUiPlugin
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.internal.trac.ui;

import java.util.HashSet;
import java.util.Set;
import org.eclipse.mylyn.internal.trac.core.util.TracUtil;
import org.eclipse.mylyn.tasks.core.AbstractTaskListMigrator;
import org.eclipse.mylyn.tasks.core.IRepositoryQuery;
import org.eclipse.mylyn.tasks.core.ITask;
import org.w3c.dom.Element;

public class TracTaskListMigrator
  extends AbstractTaskListMigrator
{
  private static final String KEY_TRAC = "Trac";
  private static final String KEY_TRAC_TASK = "TracTask";
  private static final String KEY_TRAC_QUERY = "TracQuery";
  private static final String KEY_SUPPORTS_SUBTASKS = "SupportsSubtasks";
  
  public String getConnectorKind()
  {
    return "trac";
  }
  
  public String getTaskElementName()
  {
    return "TracTask";
  }
  
  public Set<String> getQueryElementNames()
  {
    Set<String> names = new HashSet();
    names.add("TracQuery");
    return names;
  }
  
  public void migrateQuery(IRepositoryQuery query, Element element) {}
  
  public void migrateTask(ITask task, Element element)
  {
    String lastModDate = element.getAttribute("LastModified");
    task.setModificationDate(TracUtil.parseDate(lastModDate));
    task.setAttribute("UpdateDate", lastModDate);
    if (element.hasAttribute("SupportsSubtasks")) {
      task.setAttribute("SupportsSubtasks", 
        Boolean.valueOf(element.getAttribute("SupportsSubtasks")).toString());
    }
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.internal.trac.ui.TracTaskListMigrator
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.internal.trac.ui;

import java.util.ArrayList;
import java.util.List;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.text.hyperlink.IHyperlink;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.wizard.IWizard;
import org.eclipse.jface.wizard.IWizardPage;
import org.eclipse.mylyn.internal.tasks.ui.TasksUiPlugin;
import org.eclipse.mylyn.internal.trac.core.TracRepositoryConnector;
import org.eclipse.mylyn.internal.trac.core.TracRepositoryConnector.TaskKind;
import org.eclipse.mylyn.internal.trac.ui.wizard.TracQueryPage;
import org.eclipse.mylyn.internal.trac.ui.wizard.TracRepositorySettingsPage;
import org.eclipse.mylyn.tasks.core.IRepositoryPerson;
import org.eclipse.mylyn.tasks.core.IRepositoryQuery;
import org.eclipse.mylyn.tasks.core.ITask;
import org.eclipse.mylyn.tasks.core.ITaskComment;
import org.eclipse.mylyn.tasks.core.ITaskMapping;
import org.eclipse.mylyn.tasks.core.TaskRepository;
import org.eclipse.mylyn.tasks.core.data.TaskAttachmentModel;
import org.eclipse.mylyn.tasks.ui.AbstractRepositoryConnectorUi;
import org.eclipse.mylyn.tasks.ui.LegendElement;
import org.eclipse.mylyn.tasks.ui.wizards.ITaskRepositoryPage;
import org.eclipse.mylyn.tasks.ui.wizards.ITaskSearchPage;
import org.eclipse.mylyn.tasks.ui.wizards.NewTaskWizard;
import org.eclipse.mylyn.tasks.ui.wizards.NewWebTaskWizard;
import org.eclipse.mylyn.tasks.ui.wizards.RepositoryQueryWizard;
import org.eclipse.mylyn.tasks.ui.wizards.TaskAttachmentPage;
import org.eclipse.osgi.util.NLS;

public class TracConnectorUi
  extends AbstractRepositoryConnectorUi
{
  public TracConnectorUi()
  {
    TasksUiPlugin.getDefault().addSearchHandler(new TracSearchHandler());
  }
  
  public IHyperlink[] findHyperlinks(TaskRepository repository, String text, int lineOffset, int regionOffset)
  {
    return TracHyperlinkUtil.findTicketHyperlinks(repository, text, lineOffset, regionOffset);
  }
  
  public String getTaskKindLabel(ITask repositoryTask)
  {
    return Messages.TracConnectorUi_Ticket;
  }
  
  public ITaskRepositoryPage getSettingsPage(TaskRepository taskRepository)
  {
    return new TracRepositorySettingsPage(taskRepository);
  }
  
  public ITaskSearchPage getSearchPage(TaskRepository repository, IStructuredSelection selection)
  {
    return new TracQueryPage(repository);
  }
  
  public boolean hasSearchPage()
  {
    return true;
  }
  
  public IWizard getNewTaskWizard(TaskRepository repository, ITaskMapping selection)
  {
    if (TracRepositoryConnector.hasRichEditor(repository)) {
      return new NewTaskWizard(repository, selection);
    }
    return new NewWebTaskWizard(repository, repository.getRepositoryUrl() + "/newticket", 
      selection);
  }
  
  public IWizard getQueryWizard(TaskRepository repository, IRepositoryQuery query)
  {
    RepositoryQueryWizard wizard = new RepositoryQueryWizard(repository);
    wizard.addPage(new TracQueryPage(repository, query));
    return wizard;
  }
  
  public String getConnectorKind()
  {
    return "trac";
  }
  
  public ImageDescriptor getTaskKindOverlay(ITask task)
  {
    TracRepositoryConnector.TaskKind taskKind = TracRepositoryConnector.TaskKind.fromString(task.getTaskKind());
    if (taskKind == TracRepositoryConnector.TaskKind.DEFECT) {
      return TracImages.OVERLAY_DEFECT;
    }
    if (taskKind == TracRepositoryConnector.TaskKind.ENHANCEMENT) {
      return TracImages.OVERLAY_ENHANCEMENT;
    }
    if (taskKind == TracRepositoryConnector.TaskKind.STORY) {
      return TracImages.OVERLAY_STORY;
    }
    if (taskKind == TracRepositoryConnector.TaskKind.TASK) {
      return null;
    }
    return super.getTaskKindOverlay(task);
  }
  
  public List<LegendElement> getLegendElements()
  {
    List<LegendElement> legendItems = new ArrayList();
    legendItems.add(LegendElement.createTask(TracRepositoryConnector.TaskKind.DEFECT.toString(), TracImages.OVERLAY_DEFECT));
    legendItems.add(LegendElement.createTask(TracRepositoryConnector.TaskKind.ENHANCEMENT.toString(), TracImages.OVERLAY_ENHANCEMENT));
    legendItems.add(LegendElement.createTask(TracRepositoryConnector.TaskKind.TASK.toString(), null));
    return legendItems;
  }
  
  public String getReplyText(TaskRepository taskRepository, ITask task, ITaskComment taskComment, boolean includeTask)
  {
    if (taskComment == null) {
      return NLS.bind(Messages.TracConnectorUi_Replying_to__ticket_X_X_, task.getTaskKey(), task.getOwner());
    }
    if (includeTask) {
      return NLS.bind(Messages.TracConnectorUi_Replying_to__comment_ticket_X_X_X_, 
        new Object[] { task.getTaskKey(), Integer.valueOf(taskComment.getNumber()), taskComment.getAuthor().getPersonId() });
    }
    return NLS.bind(Messages.TracConnectorUi_Replying_to__comment_X_X_, Integer.valueOf(taskComment.getNumber()), 
      taskComment.getAuthor().getPersonId());
  }
  
  public IWizardPage getTaskAttachmentPage(TaskAttachmentModel model)
  {
    TaskAttachmentPage page = new TaskAttachmentPage(model);
    page.setNeedsReplaceExisting(true);
    return page;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.internal.trac.ui.TracConnectorUi
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.internal.trac.ui;

import org.eclipse.mylyn.internal.tasks.core.AbstractSearchHandler;
import org.eclipse.mylyn.internal.trac.core.model.TracSearch;
import org.eclipse.mylyn.internal.trac.core.model.TracSearchFilter;
import org.eclipse.mylyn.internal.trac.core.model.TracSearchFilter.CompareOperator;
import org.eclipse.mylyn.tasks.core.IRepositoryQuery;
import org.eclipse.mylyn.tasks.core.TaskRepository;
import org.eclipse.mylyn.tasks.core.data.TaskData;

public class TracSearchHandler
  extends AbstractSearchHandler
{
  public String getConnectorKind()
  {
    return "trac";
  }
  
  public boolean queryForText(TaskRepository taskRepository, IRepositoryQuery query, TaskData taskData, String searchString)
  {
    TracSearchFilter filter = new TracSearchFilter("description");
    filter.setOperator(TracSearchFilter.CompareOperator.CONTAINS);
    filter.addValue(searchString);
    
    TracSearch search = new TracSearch();
    search.addFilter(filter);
    
    StringBuilder sb = new StringBuilder();
    sb.append(taskRepository.getRepositoryUrl());
    sb.append("/query?format=tab");
    sb.append(search.toUrl());
    
    query.setUrl(sb.toString());
    
    return true;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.internal.trac.ui.TracSearchHandler
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.internal.trac.ui;

import java.net.MalformedURLException;
import java.net.URL;
import org.eclipse.jface.resource.ImageDescriptor;
import org.osgi.framework.Bundle;

public class TracImages
{
  private static final URL baseURL = TracUiPlugin.getDefault().getBundle().getEntry("/icons/");
  public static final String T_VIEW = "eview16";
  public static final ImageDescriptor OVERLAY_DEFECT = create("eview16", "overlay-critical.gif");
  public static final ImageDescriptor OVERLAY_ENHANCEMENT = create("eview16", "overlay-enhancement.gif");
  public static final ImageDescriptor OVERLAY_STORY = create("eview16", "overlay-story.gif");
  
  private static ImageDescriptor create(String prefix, String name)
  {
    try
    {
      return ImageDescriptor.createFromURL(makeIconFileURL(prefix, name));
    }
    catch (MalformedURLException localMalformedURLException) {}
    return ImageDescriptor.getMissingImageDescriptor();
  }
  
  private static URL makeIconFileURL(String prefix, String name)
    throws MalformedURLException
  {
    if (baseURL == null) {
      throw new MalformedURLException();
    }
    StringBuilder buffer = new StringBuilder(prefix);
    buffer.append('/');
    buffer.append(name);
    return new URL(baseURL, buffer.toString());
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.internal.trac.ui.TracImages
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.internal.trac.ui.editor;

import java.util.Iterator;
import java.util.Set;
import org.eclipse.mylyn.internal.trac.core.TracAttribute;
import org.eclipse.mylyn.tasks.core.TaskRepository;
import org.eclipse.mylyn.tasks.core.data.TaskAttribute;
import org.eclipse.mylyn.tasks.core.data.TaskDataModel;
import org.eclipse.mylyn.tasks.ui.editors.AbstractAttributeEditor;
import org.eclipse.mylyn.tasks.ui.editors.AbstractTaskEditorPage;
import org.eclipse.mylyn.tasks.ui.editors.AbstractTaskEditorPart;
import org.eclipse.mylyn.tasks.ui.editors.AttributeEditorFactory;
import org.eclipse.mylyn.tasks.ui.editors.AttributeEditorToolkit;
import org.eclipse.mylyn.tasks.ui.editors.TaskEditor;
import org.eclipse.mylyn.tasks.ui.editors.TaskEditorPartDescriptor;
import org.eclipse.ui.services.IServiceLocator;

public class TracTaskEditorPage
  extends AbstractTaskEditorPage
{
  private TracRenderingEngine renderingEngine;
  
  public TracTaskEditorPage(TaskEditor editor)
  {
    super(editor, "trac");
    setNeedsPrivateSection(true);
    setNeedsSubmitButton(true);
  }
  
  protected Set<TaskEditorPartDescriptor> createPartDescriptors()
  {
    Set<TaskEditorPartDescriptor> descriptors = super.createPartDescriptors();
    for (Iterator<TaskEditorPartDescriptor> it = descriptors.iterator(); it.hasNext();)
    {
      TaskEditorPartDescriptor taskEditorPartDescriptor = (TaskEditorPartDescriptor)it.next();
      if (taskEditorPartDescriptor.getId().equals("org.eclipse.mylyn.tasks.ui.editors.parts.people")) {
        it.remove();
      }
    }
    descriptors.add(new TaskEditorPartDescriptor("org.eclipse.mylyn.tasks.ui.editors.parts.people")
    {
      public AbstractTaskEditorPart createPart()
      {
        return new TracPeoplePart();
      }
    }.setPath("people"));
    return descriptors;
  }
  
  protected void createParts()
  {
    if (renderingEngine == null) {
      renderingEngine = new TracRenderingEngine();
    }
    getAttributeEditorToolkit().setRenderingEngine(renderingEngine);
    super.createParts();
  }
  
  protected AttributeEditorFactory createAttributeEditorFactory()
  {
    AttributeEditorFactory factory = new AttributeEditorFactory(getModel(), getTaskRepository(), getEditorSite())
    {
      public AbstractAttributeEditor createEditor(String type, TaskAttribute taskAttribute)
      {
        if (TracAttribute.CC.getTracKey().equals(taskAttribute.getId())) {
          return new TracCcAttributeEditor(getModel(), taskAttribute);
        }
        return super.createEditor(type, taskAttribute);
      }
    };
    return factory;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.internal.trac.ui.editor.TracTaskEditorPage
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.internal.trac.ui.editor;

import org.eclipse.mylyn.tasks.ui.editors.AbstractTaskEditorPart;
import org.eclipse.mylyn.tasks.ui.editors.TaskEditorPartDescriptor;

class TracTaskEditorPage$1
  extends TaskEditorPartDescriptor
{
  TracTaskEditorPage$1(TracTaskEditorPage paramTracTaskEditorPage, String $anonymous0)
  {
    super($anonymous0);
  }
  
  public AbstractTaskEditorPart createPart()
  {
    return new TracPeoplePart();
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.internal.trac.ui.editor.TracTaskEditorPage.1
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.internal.trac.ui.editor;

import org.eclipse.mylyn.commons.ui.CommonImages;
import org.eclipse.mylyn.internal.trac.core.TracRepositoryConnector;
import org.eclipse.mylyn.tasks.core.ITask;
import org.eclipse.mylyn.tasks.ui.TasksUiImages;
import org.eclipse.mylyn.tasks.ui.TasksUiUtil;
import org.eclipse.mylyn.tasks.ui.editors.AbstractTaskEditorPageFactory;
import org.eclipse.mylyn.tasks.ui.editors.BrowserFormPage;
import org.eclipse.mylyn.tasks.ui.editors.TaskEditor;
import org.eclipse.mylyn.tasks.ui.editors.TaskEditorInput;
import org.eclipse.swt.graphics.Image;
import org.eclipse.ui.forms.editor.FormPage;

public class TracTaskEditorPageFactory
  extends AbstractTaskEditorPageFactory
{
  public boolean canCreatePageFor(TaskEditorInput input)
  {
    if (input.getTask().getConnectorKind().equals("trac")) {
      return true;
    }
    if (TasksUiUtil.isOutgoingNewTask(input.getTask(), "trac")) {
      return true;
    }
    return false;
  }
  
  public FormPage createPage(TaskEditor parentEditor)
  {
    TaskEditorInput input = parentEditor.getTaskEditorInput();
    if (TasksUiUtil.isOutgoingNewTask(input.getTask(), "trac")) {
      return new TracTaskEditorPage(parentEditor);
    }
    if (TracRepositoryConnector.hasRichEditor(input.getTaskRepository())) {
      return new TracTaskEditorPage(parentEditor);
    }
    return new BrowserFormPage(parentEditor, Messages.TracTaskEditorPageFactory_Browser);
  }
  
  public String[] getConflictingIds(TaskEditorInput input)
  {
    if ((TracRepositoryConnector.hasRichEditor(input.getTaskRepository())) || 
      (TasksUiUtil.isOutgoingNewTask(input.getTask(), "trac"))) {
      return new String[] { "org.eclipse.mylyn.tasks.ui.pageFactory.Planning" };
    }
    return super.getConflictingIds(input);
  }
  
  public Image getPageImage()
  {
    return CommonImages.getImage(TasksUiImages.REPOSITORY_SMALL);
  }
  
  public String getPageText()
  {
    return "Trac";
  }
  
  public int getPriority()
  {
    return 30;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.internal.trac.ui.editor.TracTaskEditorPageFactory
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.internal.trac.ui.editor;

import org.eclipse.mylyn.internal.trac.core.TracAttribute;
import org.eclipse.mylyn.tasks.core.TaskRepository;
import org.eclipse.mylyn.tasks.core.data.TaskAttribute;
import org.eclipse.mylyn.tasks.core.data.TaskDataModel;
import org.eclipse.mylyn.tasks.ui.editors.AbstractAttributeEditor;
import org.eclipse.mylyn.tasks.ui.editors.AttributeEditorFactory;
import org.eclipse.ui.services.IServiceLocator;

class TracTaskEditorPage$2
  extends AttributeEditorFactory
{
  TracTaskEditorPage$2(TracTaskEditorPage paramTracTaskEditorPage, TaskDataModel $anonymous0, TaskRepository $anonymous1, IServiceLocator $anonymous2)
  {
    super($anonymous0, $anonymous1, $anonymous2);
  }
  
  public AbstractAttributeEditor createEditor(String type, TaskAttribute taskAttribute)
  {
    if (TracAttribute.CC.getTracKey().equals(taskAttribute.getId())) {
      return new TracCcAttributeEditor(this$0.getModel(), taskAttribute);
    }
    return super.createEditor(type, taskAttribute);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.internal.trac.ui.editor.TracTaskEditorPage.2
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.internal.trac.ui.editor;

import org.eclipse.swt.events.SelectionAdapter;

class TracCcAttributeEditor$1
  extends SelectionAdapter
{
  TracCcAttributeEditor$1(TracCcAttributeEditor paramTracCcAttributeEditor) {}
  
  /* Error */
  public void widgetSelected(org.eclipse.swt.events.SelectionEvent e)
  {
    // Byte code:
    //   0: aload_0
    //   1: getfield 74	org/eclipse/mylyn/internal/trac/ui/editor/TracCcAttributeEditor$1:this$0	Lorg/eclipse/mylyn/internal/trac/ui/editor/TracCcAttributeEditor;
    //   4: iconst_1
    //   5: putfield 73	org/eclipse/mylyn/internal/trac/ui/editor/TracCcAttributeEditor:suppressRefresh	Z
    //   8: aload_0
    //   9: getfield 74	org/eclipse/mylyn/internal/trac/ui/editor/TracCcAttributeEditor$1:this$0	Lorg/eclipse/mylyn/internal/trac/ui/editor/TracCcAttributeEditor;
    //   12: invokestatic 77	org/eclipse/mylyn/internal/trac/ui/editor/TracCcAttributeEditor:access$0	(Lorg/eclipse/mylyn/internal/trac/ui/editor/TracCcAttributeEditor;)Lorg/eclipse/swt/widgets/List;
    //   15: invokevirtual 84	org/eclipse/swt/widgets/List:getItems	()[Ljava/lang/String;
    //   18: dup
    //   19: astore 5
    //   21: arraylength
    //   22: istore 4
    //   24: iconst_0
    //   25: istore_3
    //   26: goto +87 -> 113
    //   29: aload 5
    //   31: iload_3
    //   32: aaload
    //   33: astore_2
    //   34: aload_0
    //   35: getfield 74	org/eclipse/mylyn/internal/trac/ui/editor/TracCcAttributeEditor$1:this$0	Lorg/eclipse/mylyn/internal/trac/ui/editor/TracCcAttributeEditor;
    //   38: invokestatic 77	org/eclipse/mylyn/internal/trac/ui/editor/TracCcAttributeEditor:access$0	(Lorg/eclipse/mylyn/internal/trac/ui/editor/TracCcAttributeEditor;)Lorg/eclipse/swt/widgets/List;
    //   41: aload_2
    //   42: invokevirtual 85	org/eclipse/swt/widgets/List:indexOf	(Ljava/lang/String;)I
    //   45: istore 6
    //   47: aload_0
    //   48: getfield 74	org/eclipse/mylyn/internal/trac/ui/editor/TracCcAttributeEditor$1:this$0	Lorg/eclipse/mylyn/internal/trac/ui/editor/TracCcAttributeEditor;
    //   51: invokestatic 77	org/eclipse/mylyn/internal/trac/ui/editor/TracCcAttributeEditor:access$0	(Lorg/eclipse/mylyn/internal/trac/ui/editor/TracCcAttributeEditor;)Lorg/eclipse/swt/widgets/List;
    //   54: iload 6
    //   56: invokevirtual 83	org/eclipse/swt/widgets/List:isSelected	(I)Z
    //   59: ifeq +40 -> 99
    //   62: aload_0
    //   63: getfield 74	org/eclipse/mylyn/internal/trac/ui/editor/TracCcAttributeEditor$1:this$0	Lorg/eclipse/mylyn/internal/trac/ui/editor/TracCcAttributeEditor;
    //   66: invokestatic 76	org/eclipse/mylyn/internal/trac/ui/editor/TracCcAttributeEditor:access$1	(Lorg/eclipse/mylyn/internal/trac/ui/editor/TracCcAttributeEditor;)Lorg/eclipse/mylyn/tasks/core/data/TaskAttribute;
    //   69: invokevirtual 80	org/eclipse/mylyn/tasks/core/data/TaskAttribute:getValues	()Ljava/util/List;
    //   72: astore 7
    //   74: aload 7
    //   76: aload_2
    //   77: invokeinterface 86 2 0
    //   82: ifne +28 -> 110
    //   85: aload_0
    //   86: getfield 74	org/eclipse/mylyn/internal/trac/ui/editor/TracCcAttributeEditor$1:this$0	Lorg/eclipse/mylyn/internal/trac/ui/editor/TracCcAttributeEditor;
    //   89: invokestatic 76	org/eclipse/mylyn/internal/trac/ui/editor/TracCcAttributeEditor:access$1	(Lorg/eclipse/mylyn/internal/trac/ui/editor/TracCcAttributeEditor;)Lorg/eclipse/mylyn/tasks/core/data/TaskAttribute;
    //   92: aload_2
    //   93: invokevirtual 78	org/eclipse/mylyn/tasks/core/data/TaskAttribute:addValue	(Ljava/lang/String;)V
    //   96: goto +14 -> 110
    //   99: aload_0
    //   100: getfield 74	org/eclipse/mylyn/internal/trac/ui/editor/TracCcAttributeEditor$1:this$0	Lorg/eclipse/mylyn/internal/trac/ui/editor/TracCcAttributeEditor;
    //   103: invokestatic 76	org/eclipse/mylyn/internal/trac/ui/editor/TracCcAttributeEditor:access$1	(Lorg/eclipse/mylyn/internal/trac/ui/editor/TracCcAttributeEditor;)Lorg/eclipse/mylyn/tasks/core/data/TaskAttribute;
    //   106: aload_2
    //   107: invokevirtual 79	org/eclipse/mylyn/tasks/core/data/TaskAttribute:removeValue	(Ljava/lang/String;)V
    //   110: iinc 3 1
    //   113: iload_3
    //   114: iload 4
    //   116: if_icmplt -87 -> 29
    //   119: aload_0
    //   120: getfield 74	org/eclipse/mylyn/internal/trac/ui/editor/TracCcAttributeEditor$1:this$0	Lorg/eclipse/mylyn/internal/trac/ui/editor/TracCcAttributeEditor;
    //   123: invokevirtual 75	org/eclipse/mylyn/internal/trac/ui/editor/TracCcAttributeEditor:getModel	()Lorg/eclipse/mylyn/tasks/core/data/TaskDataModel;
    //   126: aload_0
    //   127: getfield 74	org/eclipse/mylyn/internal/trac/ui/editor/TracCcAttributeEditor$1:this$0	Lorg/eclipse/mylyn/internal/trac/ui/editor/TracCcAttributeEditor;
    //   130: invokestatic 76	org/eclipse/mylyn/internal/trac/ui/editor/TracCcAttributeEditor:access$1	(Lorg/eclipse/mylyn/internal/trac/ui/editor/TracCcAttributeEditor;)Lorg/eclipse/mylyn/tasks/core/data/TaskAttribute;
    //   133: invokevirtual 81	org/eclipse/mylyn/tasks/core/data/TaskDataModel:attributeChanged	(Lorg/eclipse/mylyn/tasks/core/data/TaskAttribute;)V
    //   136: goto +16 -> 152
    //   139: astore 8
    //   141: aload_0
    //   142: getfield 74	org/eclipse/mylyn/internal/trac/ui/editor/TracCcAttributeEditor$1:this$0	Lorg/eclipse/mylyn/internal/trac/ui/editor/TracCcAttributeEditor;
    //   145: iconst_0
    //   146: putfield 73	org/eclipse/mylyn/internal/trac/ui/editor/TracCcAttributeEditor:suppressRefresh	Z
    //   149: aload 8
    //   151: athrow
    //   152: aload_0
    //   153: getfield 74	org/eclipse/mylyn/internal/trac/ui/editor/TracCcAttributeEditor$1:this$0	Lorg/eclipse/mylyn/internal/trac/ui/editor/TracCcAttributeEditor;
    //   156: iconst_0
    //   157: putfield 73	org/eclipse/mylyn/internal/trac/ui/editor/TracCcAttributeEditor:suppressRefresh	Z
    //   160: return
    // Line number table:
    //   Java source line #64	-> byte code offset #0
    //   Java source line #65	-> byte code offset #8
    //   Java source line #66	-> byte code offset #34
    //   Java source line #67	-> byte code offset #47
    //   Java source line #68	-> byte code offset #62
    //   Java source line #69	-> byte code offset #74
    //   Java source line #70	-> byte code offset #85
    //   Java source line #73	-> byte code offset #99
    //   Java source line #65	-> byte code offset #110
    //   Java source line #76	-> byte code offset #119
    //   Java source line #77	-> byte code offset #139
    //   Java source line #78	-> byte code offset #141
    //   Java source line #79	-> byte code offset #149
    //   Java source line #78	-> byte code offset #152
    //   Java source line #80	-> byte code offset #160
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	161	0	this	1
    //   0	161	1	e	org.eclipse.swt.events.SelectionEvent
    //   33	74	2	cc	String
    //   25	92	3	i	int
    //   22	95	4	j	int
    //   19	11	5	arrayOfString	String[]
    //   45	10	6	index	int
    //   72	3	7	remove	java.util.List<String>
    //   139	11	8	localObject	Object
    // Exception table:
    //   from	to	target	type
    //   0	139	139	finally
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.internal.trac.ui.editor.TracCcAttributeEditor.1
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.internal.trac.ui.editor;

import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.OperationCanceledException;
import org.eclipse.mylyn.internal.trac.core.TracClientManager;
import org.eclipse.mylyn.internal.trac.core.TracCorePlugin;
import org.eclipse.mylyn.internal.trac.core.TracRepositoryConnector;
import org.eclipse.mylyn.internal.trac.core.client.ITracClient;
import org.eclipse.mylyn.internal.trac.core.client.TracException;
import org.eclipse.mylyn.internal.trac.core.client.TracXmlRpcClient;
import org.eclipse.mylyn.tasks.core.TaskRepository;
import org.eclipse.mylyn.tasks.ui.editors.AbstractRenderingEngine;

public class TracRenderingEngine
  extends AbstractRenderingEngine
{
  public String renderAsHtml(TaskRepository repository, String text, IProgressMonitor monitor)
    throws CoreException
  {
    monitor.beginTask("Render HTML Preview", -1);
    try
    {
      ITracClient client = TracCorePlugin.getDefault()
        .getConnector()
        .getClientManager()
        .getTracClient(repository);
      if ((client instanceof TracXmlRpcClient))
      {
        TracXmlRpcClient tracXmlRpcClient = (TracXmlRpcClient)client;
        String htmlText = tracXmlRpcClient.wikiToHtml(text, monitor);
        if (monitor.isCanceled()) {
          throw new OperationCanceledException();
        }
        String htmlHeader = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\"><html xmlns=\"http://www.w3.org/1999/xhtml\" lang=\"en\" xml:lang=\"en\"><head><link rel=\"stylesheet\" href=\"REPOSITORY_URL/chrome/common/css/trac.css\" type=\"text/css\" /><link rel=\"stylesheet\" href=\"REPOSITORY_URL/chrome/common/css/wiki.css\" type=\"text/css\" /><link rel=\"icon\" href=\"REPOSITORY_URL/chrome/common/trac.ico\" type=\"image/x-icon\" /><link rel=\"shortcut icon\" href=\"EPOSITORY_URL/chrome/common/trac.ico\" type=\"image/x-icon\" /><style type=\"text/css\">body {background: #f4f4f4 url(REPOSITORY_URL/chrome/common/draft.png);margin: 0;padding: 0;}</style></head>";
        
        String htmlBody = "<body> " + htmlText + "</body>";
        String htmlFooter = "</html>";
        
        String html = htmlHeader.replace("REPOSITORY_URL", repository.getRepositoryUrl()) + htmlBody + 
          htmlFooter;
        return html;
      }
      throw new CoreException(TracCorePlugin.toStatus(new TracException(
        "Preview is available only in XML-RPC access mode"), repository));
    }
    catch (TracException e)
    {
      throw new CoreException(TracCorePlugin.toStatus(e, repository));
    }
    finally
    {
      monitor.done();
    }
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.internal.trac.ui.editor.TracRenderingEngine
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.internal.trac.ui.editor;

import org.eclipse.osgi.util.NLS;

public class Messages
  extends NLS
{
  private static final String BUNDLE_NAME = "org.eclipse.mylyn.internal.trac.ui.editor.messages";
  public static String TracPeoplePart_People;
  public static String TracPeoplePart__Select_to_remove_;
  public static String TracTaskEditorPageFactory_Browser;
  
  static {}
  
  public static void reloadMessages()
  {
    NLS.initializeMessages("org.eclipse.mylyn.internal.trac.ui.editor.messages", Messages.class);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.internal.trac.ui.editor.Messages
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.internal.trac.ui.editor;

import org.eclipse.jface.layout.GridDataFactory;
import org.eclipse.jface.resource.JFaceResources;
import org.eclipse.mylyn.tasks.core.data.TaskAttribute;
import org.eclipse.mylyn.tasks.core.data.TaskData;
import org.eclipse.mylyn.tasks.core.data.TaskDataModel;
import org.eclipse.mylyn.tasks.ui.editors.AbstractAttributeEditor;
import org.eclipse.mylyn.tasks.ui.editors.LayoutHint;
import org.eclipse.mylyn.tasks.ui.editors.LayoutHint.ColumnSpan;
import org.eclipse.mylyn.tasks.ui.editors.LayoutHint.RowSpan;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.List;
import org.eclipse.ui.forms.widgets.FormToolkit;

public class TracCcAttributeEditor
  extends AbstractAttributeEditor
{
  private List list;
  private TaskAttribute attrRemoveCc;
  protected boolean suppressRefresh;
  
  public TracCcAttributeEditor(TaskDataModel manager, TaskAttribute taskAttribute)
  {
    super(manager, taskAttribute);
    setLayoutHint(new LayoutHint(LayoutHint.RowSpan.MULTIPLE, LayoutHint.ColumnSpan.SINGLE));
  }
  
  public void createControl(Composite parent, FormToolkit toolkit)
  {
    list = new List(parent, 8389122);
    toolkit.adapt(list, true, true);
    list.setData("FormWidgetFactory.drawBorder", "textBorder");
    list.setFont(JFaceResources.getDefaultFont());
    list.setToolTipText(getDescription());
    GridDataFactory.fillDefaults().grab(true, true).align(4, 4).applyTo(list);
    
    populateFromAttribute();
    
    attrRemoveCc = getModel().getTaskData().getRoot().getMappedAttribute("task.common.removecc");
    selectValuesToRemove();
    
    list.addSelectionListener(new SelectionAdapter()
    {
      /* Error */
      public void widgetSelected(org.eclipse.swt.events.SelectionEvent e)
      {
        // Byte code:
        //   0: aload_0
        //   1: getfield 74	org/eclipse/mylyn/internal/trac/ui/editor/TracCcAttributeEditor$1:this$0	Lorg/eclipse/mylyn/internal/trac/ui/editor/TracCcAttributeEditor;
        //   4: iconst_1
        //   5: putfield 73	org/eclipse/mylyn/internal/trac/ui/editor/TracCcAttributeEditor:suppressRefresh	Z
        //   8: aload_0
        //   9: getfield 74	org/eclipse/mylyn/internal/trac/ui/editor/TracCcAttributeEditor$1:this$0	Lorg/eclipse/mylyn/internal/trac/ui/editor/TracCcAttributeEditor;
        //   12: invokestatic 77	org/eclipse/mylyn/internal/trac/ui/editor/TracCcAttributeEditor:access$0	(Lorg/eclipse/mylyn/internal/trac/ui/editor/TracCcAttributeEditor;)Lorg/eclipse/swt/widgets/List;
        //   15: invokevirtual 84	org/eclipse/swt/widgets/List:getItems	()[Ljava/lang/String;
        //   18: dup
        //   19: astore 5
        //   21: arraylength
        //   22: istore 4
        //   24: iconst_0
        //   25: istore_3
        //   26: goto +87 -> 113
        //   29: aload 5
        //   31: iload_3
        //   32: aaload
        //   33: astore_2
        //   34: aload_0
        //   35: getfield 74	org/eclipse/mylyn/internal/trac/ui/editor/TracCcAttributeEditor$1:this$0	Lorg/eclipse/mylyn/internal/trac/ui/editor/TracCcAttributeEditor;
        //   38: invokestatic 77	org/eclipse/mylyn/internal/trac/ui/editor/TracCcAttributeEditor:access$0	(Lorg/eclipse/mylyn/internal/trac/ui/editor/TracCcAttributeEditor;)Lorg/eclipse/swt/widgets/List;
        //   41: aload_2
        //   42: invokevirtual 85	org/eclipse/swt/widgets/List:indexOf	(Ljava/lang/String;)I
        //   45: istore 6
        //   47: aload_0
        //   48: getfield 74	org/eclipse/mylyn/internal/trac/ui/editor/TracCcAttributeEditor$1:this$0	Lorg/eclipse/mylyn/internal/trac/ui/editor/TracCcAttributeEditor;
        //   51: invokestatic 77	org/eclipse/mylyn/internal/trac/ui/editor/TracCcAttributeEditor:access$0	(Lorg/eclipse/mylyn/internal/trac/ui/editor/TracCcAttributeEditor;)Lorg/eclipse/swt/widgets/List;
        //   54: iload 6
        //   56: invokevirtual 83	org/eclipse/swt/widgets/List:isSelected	(I)Z
        //   59: ifeq +40 -> 99
        //   62: aload_0
        //   63: getfield 74	org/eclipse/mylyn/internal/trac/ui/editor/TracCcAttributeEditor$1:this$0	Lorg/eclipse/mylyn/internal/trac/ui/editor/TracCcAttributeEditor;
        //   66: invokestatic 76	org/eclipse/mylyn/internal/trac/ui/editor/TracCcAttributeEditor:access$1	(Lorg/eclipse/mylyn/internal/trac/ui/editor/TracCcAttributeEditor;)Lorg/eclipse/mylyn/tasks/core/data/TaskAttribute;
        //   69: invokevirtual 80	org/eclipse/mylyn/tasks/core/data/TaskAttribute:getValues	()Ljava/util/List;
        //   72: astore 7
        //   74: aload 7
        //   76: aload_2
        //   77: invokeinterface 86 2 0
        //   82: ifne +28 -> 110
        //   85: aload_0
        //   86: getfield 74	org/eclipse/mylyn/internal/trac/ui/editor/TracCcAttributeEditor$1:this$0	Lorg/eclipse/mylyn/internal/trac/ui/editor/TracCcAttributeEditor;
        //   89: invokestatic 76	org/eclipse/mylyn/internal/trac/ui/editor/TracCcAttributeEditor:access$1	(Lorg/eclipse/mylyn/internal/trac/ui/editor/TracCcAttributeEditor;)Lorg/eclipse/mylyn/tasks/core/data/TaskAttribute;
        //   92: aload_2
        //   93: invokevirtual 78	org/eclipse/mylyn/tasks/core/data/TaskAttribute:addValue	(Ljava/lang/String;)V
        //   96: goto +14 -> 110
        //   99: aload_0
        //   100: getfield 74	org/eclipse/mylyn/internal/trac/ui/editor/TracCcAttributeEditor$1:this$0	Lorg/eclipse/mylyn/internal/trac/ui/editor/TracCcAttributeEditor;
        //   103: invokestatic 76	org/eclipse/mylyn/internal/trac/ui/editor/TracCcAttributeEditor:access$1	(Lorg/eclipse/mylyn/internal/trac/ui/editor/TracCcAttributeEditor;)Lorg/eclipse/mylyn/tasks/core/data/TaskAttribute;
        //   106: aload_2
        //   107: invokevirtual 79	org/eclipse/mylyn/tasks/core/data/TaskAttribute:removeValue	(Ljava/lang/String;)V
        //   110: iinc 3 1
        //   113: iload_3
        //   114: iload 4
        //   116: if_icmplt -87 -> 29
        //   119: aload_0
        //   120: getfield 74	org/eclipse/mylyn/internal/trac/ui/editor/TracCcAttributeEditor$1:this$0	Lorg/eclipse/mylyn/internal/trac/ui/editor/TracCcAttributeEditor;
        //   123: invokevirtual 75	org/eclipse/mylyn/internal/trac/ui/editor/TracCcAttributeEditor:getModel	()Lorg/eclipse/mylyn/tasks/core/data/TaskDataModel;
        //   126: aload_0
        //   127: getfield 74	org/eclipse/mylyn/internal/trac/ui/editor/TracCcAttributeEditor$1:this$0	Lorg/eclipse/mylyn/internal/trac/ui/editor/TracCcAttributeEditor;
        //   130: invokestatic 76	org/eclipse/mylyn/internal/trac/ui/editor/TracCcAttributeEditor:access$1	(Lorg/eclipse/mylyn/internal/trac/ui/editor/TracCcAttributeEditor;)Lorg/eclipse/mylyn/tasks/core/data/TaskAttribute;
        //   133: invokevirtual 81	org/eclipse/mylyn/tasks/core/data/TaskDataModel:attributeChanged	(Lorg/eclipse/mylyn/tasks/core/data/TaskAttribute;)V
        //   136: goto +16 -> 152
        //   139: astore 8
        //   141: aload_0
        //   142: getfield 74	org/eclipse/mylyn/internal/trac/ui/editor/TracCcAttributeEditor$1:this$0	Lorg/eclipse/mylyn/internal/trac/ui/editor/TracCcAttributeEditor;
        //   145: iconst_0
        //   146: putfield 73	org/eclipse/mylyn/internal/trac/ui/editor/TracCcAttributeEditor:suppressRefresh	Z
        //   149: aload 8
        //   151: athrow
        //   152: aload_0
        //   153: getfield 74	org/eclipse/mylyn/internal/trac/ui/editor/TracCcAttributeEditor$1:this$0	Lorg/eclipse/mylyn/internal/trac/ui/editor/TracCcAttributeEditor;
        //   156: iconst_0
        //   157: putfield 73	org/eclipse/mylyn/internal/trac/ui/editor/TracCcAttributeEditor:suppressRefresh	Z
        //   160: return
        // Line number table:
        //   Java source line #64	-> byte code offset #0
        //   Java source line #65	-> byte code offset #8
        //   Java source line #66	-> byte code offset #34
        //   Java source line #67	-> byte code offset #47
        //   Java source line #68	-> byte code offset #62
        //   Java source line #69	-> byte code offset #74
        //   Java source line #70	-> byte code offset #85
        //   Java source line #73	-> byte code offset #99
        //   Java source line #65	-> byte code offset #110
        //   Java source line #76	-> byte code offset #119
        //   Java source line #77	-> byte code offset #139
        //   Java source line #78	-> byte code offset #141
        //   Java source line #79	-> byte code offset #149
        //   Java source line #78	-> byte code offset #152
        //   Java source line #80	-> byte code offset #160
        // Local variable table:
        //   start	length	slot	name	signature
        //   0	161	0	this	1
        //   0	161	1	e	org.eclipse.swt.events.SelectionEvent
        //   33	74	2	cc	String
        //   25	92	3	i	int
        //   22	95	4	j	int
        //   19	11	5	arrayOfString	String[]
        //   45	10	6	index	int
        //   72	3	7	remove	java.util.List<String>
        //   139	11	8	localObject	Object
        // Exception table:
        //   from	to	target	type
        //   0	139	139	finally
      }
    });
    list.showSelection();
    
    setControl(list);
  }
  
  private void populateFromAttribute()
  {
    TaskAttribute attrUserCC = getTaskAttribute();
    if (attrUserCC != null) {
      for (String value : attrUserCC.getValues()) {
        list.add(value);
      }
    }
  }
  
  private void selectValuesToRemove()
  {
    for (String item : attrRemoveCc.getValues())
    {
      int i = list.indexOf(item);
      if (i != -1) {
        list.select(i);
      }
    }
  }
  
  public void refresh()
  {
    if ((list != null) && (!list.isDisposed()))
    {
      list.removeAll();
      populateFromAttribute();
      selectValuesToRemove();
    }
  }
  
  public boolean shouldAutoRefresh()
  {
    return !suppressRefresh;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.internal.trac.ui.editor.TracCcAttributeEditor
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.internal.trac.ui.editor;

import java.util.List;
import org.eclipse.jface.layout.GridDataFactory;
import org.eclipse.mylyn.internal.trac.core.TracAttribute;
import org.eclipse.mylyn.tasks.core.TaskRepository;
import org.eclipse.mylyn.tasks.core.data.TaskAttribute;
import org.eclipse.mylyn.tasks.core.data.TaskData;
import org.eclipse.mylyn.tasks.ui.editors.AbstractAttributeEditor;
import org.eclipse.mylyn.tasks.ui.editors.AbstractTaskEditorPage;
import org.eclipse.mylyn.tasks.ui.editors.AbstractTaskEditorPart;
import org.eclipse.mylyn.tasks.ui.editors.AttributeEditorToolkit;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;
import org.eclipse.ui.forms.widgets.FormToolkit;
import org.eclipse.ui.forms.widgets.Section;

public class TracPeoplePart
  extends AbstractTaskEditorPart
{
  private static final int COLUMN_MARGIN = 5;
  
  public TracPeoplePart()
  {
    setPartNam
1 2 3 4

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