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

tHint.RowSpan.SINGLE, LayoutHint.ColumnSpan.SINGLE));
    } else {
      setLayoutHint(new LayoutHint(LayoutHint.RowSpan.MULTIPLE, LayoutHint.ColumnSpan.SINGLE));
    }
  }
  
  public void createControl(Composite parent, FormToolkit toolkit)
  {
    if (isReadOnly())
    {
      text = new Text(parent, 8388680);
      text.setFont(EditorUtil.TEXT_FONT);
      toolkit.adapt(text, false, false);
      text.setData("FormWidgetFactory.drawBorder", Boolean.FALSE);
      select(getValues(), getValuesLabels());
      text.setToolTipText(getDescription());
      setControl(text);
    }
    else
    {
      list = new org.eclipse.swt.widgets.List(parent, 8389122);
      toolkit.adapt(list, false, false);
      list.setData("FormWidgetFactory.drawBorder", "treeBorder");
      list.setFont(EditorUtil.TEXT_FONT);
      list.setToolTipText(getDescription());
      
      updateListWithOptions();
      
      select(getValues(), getValuesLabels());
      if (allValues != null)
      {
        list.addSelectionListener(new SelectionAdapter()
        {
          public void widgetSelected(SelectionEvent e)
          {
            Assert.isNotNull(allValues);
            int[] indices = list.getSelectionIndices();
            String[] selectedValues = new String[indices.length];
            for (i = 0; i < indices.length; i++)
            {
              int index = indices[i];
              Assert.isLegal((index >= 0) && (index <= allValues.length - 1));
              selectedValues[i] = allValues[index];
            }
            try
            {
              suppressRefresh = true;
              setValues(selectedValues);
            }
            finally
            {
              suppressRefresh = false;
            }
          }
        });
        list.showSelection();
      }
      setControl(list);
    }
  }
  
  private void updateListWithOptions()
  {
    if ((list != null) && (!list.isDisposed()))
    {
      Map<String, String> labelByValue = getAttributeMapper().getOptions(getTaskAttribute());
      if (labelByValue != null)
      {
        int topIndex = list.getTopIndex();
        list.removeAll();
        allValues = ((String[])labelByValue.keySet().toArray(new String[0]));
        String[] arrayOfString;
        int j = (arrayOfString = allValues).length;
        for (int i = 0; i < j; i++)
        {
          String value = arrayOfString[i];
          list.add((String)labelByValue.get(value));
        }
        if (topIndex > 0) {
          list.setTopIndex(topIndex);
        }
      }
    }
  }
  
  public String[] getValues()
  {
    return (String[])getAttributeMapper().getValues(getTaskAttribute()).toArray(new String[0]);
  }
  
  public String[] getValuesLabels()
  {
    return (String[])getAttributeMapper().getValueLabels(getTaskAttribute()).toArray(new String[0]);
  }
  
  private void select(String[] values, String[] labels)
  {
    if ((text != null) && (!text.isDisposed()))
    {
      StringBuilder valueString = new StringBuilder();
      if (labels != null) {
        for (int i = 0; i < labels.length; i++)
        {
          valueString.append(labels[i]);
          if (i != labels.length - 1) {
            valueString.append(", ");
          }
        }
      }
      text.setText(valueString.toString());
    }
    else if ((list != null) && (!list.isDisposed()))
    {
      if (values != null)
      {
        list.deselectAll();
        Set<String> selectedValues = new HashSet(Arrays.asList(values));
        for (int i = 0; i < allValues.length; i++) {
          if (selectedValues.contains(allValues[i])) {
            list.select(i);
          }
        }
      }
      else
      {
        list.setItems(labels);
        list.setSelection(labels);
      }
    }
  }
  
  public void setValues(String[] values)
  {
    getAttributeMapper().setValues(getTaskAttribute(), Arrays.asList(values));
    attributeChanged();
  }
  
  public void refresh()
  {
    updateListWithOptions();
    select(getValues(), getValuesLabels());
  }
  
  public boolean shouldAutoRefresh()
  {
    return !suppressRefresh;
  }
}

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

import java.net.MalformedURLException;
import java.net.URL;
import java.util.ArrayList;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.eclipse.jface.text.ITextViewer;
import org.eclipse.jface.text.Region;
import org.eclipse.jface.text.hyperlink.IHyperlink;
import org.eclipse.mylyn.commons.workbench.browser.UrlHyperlink;
import org.eclipse.mylyn.internal.tasks.ui.util.TasksUiInternal;
import org.eclipse.mylyn.tasks.core.TaskRepository;
import org.eclipse.mylyn.tasks.ui.AbstractTaskHyperlinkDetector;

public class TaskUrlHyperlinkDetector
  extends AbstractTaskHyperlinkDetector
{
  private static final Pattern URL_PATTERN = Pattern.compile("([a-zA-Z][a-zA-Z+.-]{0,10}://[a-zA-Z0-9%._~!$&?#'()*+,;:@/=-]*[a-zA-Z0-9%_~!$&?#'(*+;:@/=-])");
  private static final String CLOSED_PARENTHESIS_PATTERN = "[^)]";
  private static final String OPEN_PARENTHESIS_PATTERN = "[^(]";
  private static final String EMPTY_STRING = "";
  
  protected List<IHyperlink> detectHyperlinks(ITextViewer textViewer, String content, int indexInContent, int contentOffset)
  {
    List<IHyperlink> links = null;
    Matcher m = URL_PATTERN.matcher(content);
    while (m.find()) {
      if (isInRegion(indexInContent, m))
      {
        String urlString = getUrlString(content, m);
        IHyperlink link = null;
        if (getAdapter(TaskRepository.class) != null) {
          try
          {
            new URL(urlString);
            link = createTaskUrlHyperlink(contentOffset, m, urlString);
          }
          catch (MalformedURLException localMalformedURLException) {}
        } else if (TasksUiInternal.isTaskUrl(urlString)) {
          link = createTaskUrlHyperlink(contentOffset, m, urlString);
        }
        if (link != null)
        {
          if (links == null) {
            links = new ArrayList();
          }
          links.add(link);
        }
      }
    }
    return links;
  }
  
  private String getUrlString(String content, Matcher m)
  {
    String urlString = m.group(1);
    
    int parenthesisDiff = urlString.replaceAll("[^(]", "").length() - 
      urlString.replaceAll("[^)]", "").length();
    if (parenthesisDiff > 0) {
      for (int i = m.end(); i - m.end() < parenthesisDiff; i++)
      {
        if ((i >= content.length()) || (content.charAt(i) != ')')) {
          break;
        }
        urlString = urlString + ')';
      }
    }
    return urlString;
  }
  
  private static boolean isInRegion(int offsetInText, Matcher m)
  {
    return (offsetInText == -1) || ((offsetInText >= m.start()) && (offsetInText <= m.end()));
  }
  
  private static IHyperlink createTaskUrlHyperlink(int textOffset, Matcher m, String urlString)
  {
    return new UrlHyperlink(new Region(textOffset + m.start(), urlString.length()), urlString);
  }
}

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

import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import org.eclipse.core.runtime.Platform;
import org.eclipse.jface.layout.GridDataFactory;
import org.eclipse.mylyn.commons.ui.CommonImages;
import org.eclipse.mylyn.internal.tasks.core.AbstractTaskCategory;
import org.eclipse.mylyn.internal.tasks.core.ITaskList;
import org.eclipse.mylyn.internal.tasks.ui.util.TaskContainerComparator;
import org.eclipse.mylyn.internal.tasks.ui.util.TasksUiInternal;
import org.eclipse.mylyn.internal.tasks.ui.views.TaskListView;
import org.eclipse.mylyn.tasks.core.AbstractRepositoryConnector;
import org.eclipse.mylyn.tasks.core.IRepositoryElement;
import org.eclipse.mylyn.tasks.core.ITask;
import org.eclipse.mylyn.tasks.core.TaskRepository;
import org.eclipse.mylyn.tasks.core.data.AbstractTaskAttachmentHandler;
import org.eclipse.mylyn.tasks.core.data.TaskAttribute;
import org.eclipse.mylyn.tasks.core.data.TaskAttributeMapper;
import org.eclipse.mylyn.tasks.core.data.TaskAttributeMetaData;
import org.eclipse.mylyn.tasks.core.data.TaskData;
import org.eclipse.mylyn.tasks.core.data.TaskDataModel;
import org.eclipse.mylyn.tasks.core.data.TaskOperation;
import org.eclipse.mylyn.tasks.ui.TasksUiImages;
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.custom.CCombo;
import org.eclipse.swt.custom.StyledText;
import org.eclipse.swt.custom.StyledTextContent;
import org.eclipse.swt.custom.TextChangeListener;
import org.eclipse.swt.custom.TextChangedEvent;
import org.eclipse.swt.custom.TextChangingEvent;
import org.eclipse.swt.events.FocusEvent;
import org.eclipse.swt.events.FocusListener;
import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.events.VerifyEvent;
import org.eclipse.swt.events.VerifyListener;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Listener;
import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.forms.IManagedForm;
import org.eclipse.ui.forms.widgets.FormToolkit;
import org.eclipse.ui.forms.widgets.Section;

public class TaskEditorActionPart
  extends AbstractTaskEditorPart
{
  private static final String KEY_OPERATION = "operation";
  private static final int DEFAULT_FIELD_WIDTH = 150;
  private static final int RADIO_OPTION_WIDTH = 120;
  private static final String KEY_ASSOCIATED_EDITOR = "associatedEditor";
  private List<Button> operationButtons;
  private Button submitButton;
  private Button attachContextButton;
  private Button addToCategory;
  private CCombo categoryChooser;
  private AbstractTaskCategory category;
  private TaskAttribute selectedOperationAttribute;
  
  public class SelectButtonListener
    implements ModifyListener, VerifyListener, SelectionListener, FocusListener, TextChangeListener
  {
    private final Button button;
    
    public SelectButtonListener(Button button)
    {
      this.button = button;
    }
    
    public void modifyText(ModifyEvent e)
    {
      selected();
    }
    
    public void verifyText(VerifyEvent e)
    {
      selected();
    }
    
    public void widgetSelected(SelectionEvent e)
    {
      selected();
    }
    
    public void widgetDefaultSelected(SelectionEvent e)
    {
      selected();
    }
    
    public void focusGained(FocusEvent event)
    {
      selected();
    }
    
    public void focusLost(FocusEvent e) {}
    
    public void textChanged(TextChangedEvent event)
    {
      selected();
    }
    
    public void textSet(TextChangedEvent event)
    {
      selected();
    }
    
    public void textChanging(TextChangingEvent event) {}
    
    private void selected()
    {
      TaskEditorActionPart.this.setSelectedRadionButton(button, true);
    }
  }
  
  public TaskEditorActionPart()
  {
    setPartName(Messages.TaskEditorActionPart_Actions);
  }
  
  protected void addAttachContextButton(Composite buttonComposite, FormToolkit toolkit)
  {
    attachContextButton = toolkit.createButton(buttonComposite, Messages.TaskEditorActionPart_Attach_Context, 
      32);
    attachContextButton.setImage(CommonImages.getImage(TasksUiImages.CONTEXT_ATTACH));
  }
  
  private void createActionButtons(Composite buttonComposite, FormToolkit toolkit)
  {
    submitButton = toolkit.createButton(buttonComposite, Messages.TaskEditorActionPart_Submit, 0);
    submitButton.setImage(CommonImages.getImage(TasksUiImages.REPOSITORY_SUBMIT));
    submitButton.addListener(13, new Listener()
    {
      public void handleEvent(Event e)
      {
        getTaskEditorPage().doSubmit();
      }
    });
    Point minSize = submitButton.computeSize(-1, -1, true);
    GridData submitButtonData = new GridData(32);
    widthHint = Math.max(100, x);
    submitButton.setLayoutData(submitButtonData);
    
    setSubmitEnabled(true);
    
    toolkit.createLabel(buttonComposite, "    ");
    
    createAttachContextButton(buttonComposite, toolkit);
  }
  
  private void createAttachContextButton(Composite buttonComposite, FormToolkit toolkit)
  {
    AbstractTaskEditorPage taskEditorPage = getTaskEditorPage();
    AbstractRepositoryConnector connector = taskEditorPage.getConnector();
    AbstractTaskAttachmentHandler taskAttachmentHandler = connector.getTaskAttachmentHandler();
    boolean canPostContent = false;
    if (taskAttachmentHandler != null)
    {
      TaskRepository taskRepository = taskEditorPage.getTaskRepository();
      ITask task = taskEditorPage.getTask();
      canPostContent = taskAttachmentHandler.canPostContent(taskRepository, task);
    }
    if ((!getTaskData().isNew()) && (canPostContent)) {
      addAttachContextButton(buttonComposite, toolkit);
    }
  }
  
  private void createCategoryChooser(Composite buttonComposite, FormToolkit toolkit)
  {
    addToCategory = getManagedForm().getToolkit().createButton(buttonComposite, 
      Messages.TaskEditorActionPart_Add_to_Category, 32);
    categoryChooser = new CCombo(buttonComposite, 8388616);
    categoryChooser.setData("FormWidgetFactory.drawBorder", "treeBorder");
    categoryChooser.setLayoutData(GridDataFactory.swtDefaults().hint(150, -1).create());
    toolkit.adapt(categoryChooser, false, false);
    categoryChooser.setFont(TEXT_FONT);
    ITaskList taskList = TasksUiInternal.getTaskList();
    final List<AbstractTaskCategory> categories = new ArrayList(taskList.getCategories());
    Collections.sort(categories, new TaskContainerComparator());
    AbstractTaskCategory selectedCategory = TasksUiInternal.getSelectedCategory(TaskListView.getFromActivePerspective());
    int i = 0;
    int selectedIndex = 0;
    for (IRepositoryElement category : categories)
    {
      categoryChooser.add(category.getSummary());
      if (category.equals(selectedCategory)) {
        selectedIndex = i;
      }
      i++;
    }
    categoryChooser.select(selectedIndex);
    categoryChooser.addSelectionListener(new SelectionAdapter()
    {
      public void widgetSelected(SelectionEvent event)
      {
        if (categoryChooser.getSelectionIndex() != -1) {
          category = ((AbstractTaskCategory)categories.get(categoryChooser.getSelectionIndex()));
        }
      }
    });
    categoryChooser.setEnabled(false);
    
    addToCategory.addSelectionListener(new SelectionAdapter()
    {
      public void widgetSelected(SelectionEvent e)
      {
        markDirty();
        if (!addToCategory.getSelection()) {
          category = null;
        } else if (categoryChooser.getSelectionIndex() != -1) {
          category = ((AbstractTaskCategory)categories.get(categoryChooser.getSelectionIndex()));
        }
        categoryChooser.setEnabled(addToCategory.getSelection());
      }
    });GridDataFactory.fillDefaults().hint(150, -1).span(3, -1)
      .applyTo(categoryChooser);
  }
  
  public AbstractTaskCategory getCategory()
  {
    return category;
  }
  
  public void createControl(Composite parent, FormToolkit toolkit)
  {
    Section section = createSection(parent, toolkit, true);
    
    Composite buttonComposite = toolkit.createComposite(section);
    GridLayout buttonLayout = EditorUtil.createSectionClientLayout();
    numColumns = 4;
    buttonComposite.setLayout(buttonLayout);
    if (getTaskEditorPage().needsAddToCategory()) {
      createCategoryChooser(buttonComposite, toolkit);
    }
    selectedOperationAttribute = getTaskData().getRoot().getMappedAttribute("task.common.operation");
    if ((selectedOperationAttribute != null) && 
      ("operation".equals(selectedOperationAttribute.getMetaData().getType())))
    {
      TaskOperation selectedOperation = getTaskData().getAttributeMapper().getTaskOperation(
        selectedOperationAttribute);
      createRadioButtons(buttonComposite, toolkit, selectedOperation);
    }
    createOperationAttributes(buttonComposite, toolkit);
    
    createActionButtons(buttonComposite, toolkit);
    
    toolkit.paintBordersFor(buttonComposite);
    section.setClient(buttonComposite);
    setSection(toolkit, section);
  }
  
  private void createOperationAttributes(Composite buttonComposite, FormToolkit toolkit)
  {
    Composite parent = null;
    for (TaskAttribute taskAttribute : getTaskData().getRoot().getAttributes().values()) {
      if ("task.common.kind.operation".equals(taskAttribute.getMetaData().getKind()))
      {
        if (parent == null)
        {
          parent = toolkit.createComposite(buttonComposite);
          parent.setLayout(new GridLayout(2, false));
          GridDataFactory.fillDefaults().span(4, 1).grab(true, false).applyTo(parent);
          toolkit.paintBordersFor(parent);
        }
        addAttribute(parent, toolkit, taskAttribute);
      }
    }
  }
  
  private void addAttribute(Composite attributesComposite, FormToolkit toolkit, TaskAttribute taskAttribute)
  {
    AbstractAttributeEditor attributeEditor = createAttributeEditor(taskAttribute);
    if ((attributeEditor.hasLabel()) && (attributeEditor.getLabel().length() != 0))
    {
      attributeEditor.createLabelControl(attributesComposite, toolkit);
      Label label = attributeEditor.getLabelControl();
      String text = label.getText();
      label.setText(text);
      GridData gd = GridDataFactory.fillDefaults()
        .align(16384, 16777216)
        .hint(-1, -1)
        .create();
      label.setLayoutData(gd);
    }
    attributeEditor.createControl(attributesComposite, toolkit);
    getTaskEditorPage().getAttributeEditorToolkit().adapt(attributeEditor);
    GridData gd = new GridData(4, 2, true, false);
    minimumWidth = 150;
    if (attributeEditor.getLabelControl() == null) {
      horizontalSpan = 2;
    }
    attributeEditor.getControl().setLayoutData(gd);
  }
  
  private void addAttribute(Composite composite, FormToolkit toolkit, TaskAttribute attribute, Button button)
  {
    AbstractAttributeEditor editor = createAttributeEditor(attribute);
    if (editor != null)
    {
      editor.createControl(composite, toolkit);
      GridData gd = new GridData(32);
      horizontalSpan = 3;
      Control editorControl = editor.getControl();
      if ((editorControl instanceof CCombo))
      {
        if (!"macosx".equals(Platform.getOS())) {
          heightHint = 20;
        }
        widthHint = 120;
      }
      else
      {
        widthHint = 115;
      }
      editorControl.setLayoutData(gd);
      if ((editor instanceof PersonAttributeEditor)) {
        editorControl = ((PersonAttributeEditor)editor).getText();
      }
      if ((editorControl instanceof CCombo))
      {
        ((CCombo)editorControl).addSelectionListener(new SelectButtonListener(button));
      }
      else if ((editorControl instanceof Text))
      {
        ((Text)editorControl).addModifyListener(new SelectButtonListener(button));
        ((Text)editorControl).addVerifyListener(new SelectButtonListener(button));
      }
      else if ((editorControl instanceof StyledText))
      {
        ((StyledText)editorControl).getContent().addTextChangeListener(new SelectButtonListener(button));
      }
      else
      {
        editorControl.addFocusListener(new SelectButtonListener(button));
      }
      button.setData("associatedEditor", editor);
      getTaskEditorPage().getAttributeEditorToolkit().adapt(editor);
    }
  }
  
  private void createRadioButtons(Composite buttonComposite, FormToolkit toolkit, TaskOperation selectedOperation)
  {
    List<TaskOperation> operations = getTaskData().getAttributeMapper().getTaskOperations(
      selectedOperationAttribute);
    if (operations.size() > 0)
    {
      operationButtons = new ArrayList();
      Button selectedButton = null;
      for (TaskOperation operation : operations)
      {
        Button button = toolkit.createButton(buttonComposite, operation.getLabel(), 16);
        button.setFont(TEXT_FONT);
        button.setData("operation", operation);
        
        button.setEnabled(!operation.getTaskAttribute().getMetaData().isDisabled());
        button.setToolTipText(operation.getTaskAttribute()
          .getMetaData()
          .getValue("task.meta.description"));
        
        GridData radioData = new GridData(32);
        TaskAttribute associatedAttribute = getTaskData().getAttributeMapper().getAssoctiatedAttribute(
          operation);
        if (associatedAttribute != null)
        {
          horizontalSpan = 1;
          addAttribute(buttonComposite, toolkit, associatedAttribute, button);
        }
        else
        {
          horizontalSpan = 4;
        }
        button.setLayoutData(radioData);
        button.addSelectionListener(new SelectButtonListener(button));
        operationButtons.add(button);
        if (operation.equals(selectedOperation)) {
          selectedButton = button;
        }
      }
      if ((selectedButton == null) && (!operationButtons.isEmpty())) {
        selectedButton = (Button)operationButtons.get(0);
      }
      setSelectedRadionButton(selectedButton, false);
    }
  }
  
  public boolean getAttachContext()
  {
    if ((attachContextButton == null) || (attachContextButton.isDisposed())) {
      return false;
    }
    return attachContextButton.getSelection();
  }
  
  public void setSubmitEnabled(boolean enabled)
  {
    if ((submitButton != null) && (!submitButton.isDisposed()))
    {
      submitButton.setEnabled(enabled);
      if (enabled) {
        submitButton.setToolTipText(MessageFormat.format(Messages.TaskEditorActionPart_Submit_to_X, new Object[] {
          getTaskEditorPage().getTaskRepository().getRepositoryUrl() }));
      }
    }
  }
  
  private void setSelectedRadionButton(Button selectedButton, boolean updateModel)
  {
    if (selectedButton.getSelection()) {
      return;
    }
    selectedButton.setSelection(true);
    for (Button button : operationButtons) {
      if (button != selectedButton) {
        button.setSelection(false);
      }
    }
    if (updateModel)
    {
      TaskOperation taskOperation = (TaskOperation)selectedButton.getData("operation");
      getTaskData().getAttributeMapper().setTaskOperation(selectedOperationAttribute, taskOperation);
      getModel().attributeChanged(selectedOperationAttribute);
      
      AbstractAttributeEditor editor = (AbstractAttributeEditor)selectedButton.getData("associatedEditor");
      if ((editor instanceof SingleSelectionAttributeEditor)) {
        ((SingleSelectionAttributeEditor)editor).selectDefaultValue();
      }
    }
  }
  
  public void refreshOperations()
  {
    if (operationButtons != null) {
      for (Button button : operationButtons)
      {
        TaskOperation taskOperation = (TaskOperation)button.getData("operation");
        button.setEnabled(!taskOperation.getTaskAttribute().getMetaData().isDisabled());
        button.setToolTipText(taskOperation.getTaskAttribute()
          .getMetaData()
          .getValue("task.meta.description"));
      }
    }
  }
}

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

import org.eclipse.swt.widgets.Text;

class PlanningPart$2$1
  implements Runnable
{
  PlanningPart$2$1(PlanningPart.2 param2) {}
  
  public void run()
  {
    if ((PlanningPart.access$0(PlanningPart.2.access$0(this$1)) != null) && (!PlanningPart.access$0(PlanningPart.2.access$0(this$1)).isDisposed())) {
      PlanningPart.access$1(PlanningPart.2.access$0(this$1));
    }
  }
}

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

import java.util.List;
import org.eclipse.mylyn.internal.tasks.core.AbstractTaskCategory;
import org.eclipse.swt.custom.CCombo;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;

class TaskEditorActionPart$2
  extends SelectionAdapter
{
  TaskEditorActionPart$2(TaskEditorActionPart paramTaskEditorActionPart, List paramList) {}
  
  public void widgetSelected(SelectionEvent event)
  {
    if (TaskEditorActionPart.access$1(this$0).getSelectionIndex() != -1) {
      TaskEditorActionPart.access$2(this$0, (AbstractTaskCategory)val$categories.get(TaskEditorActionPart.access$1(this$0).getSelectionIndex()));
    }
  }
}

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

import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;

class PlanningPart$9
  extends SelectionAdapter
{
  PlanningPart$9(PlanningPart paramPlanningPart) {}
  
  public void widgetSelected(SelectionEvent arg0)
  {
    this$0.markDirty();
  }
}

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

import java.util.Map;
import org.eclipse.mylyn.tasks.core.AbstractRepositoryConnector;
import org.eclipse.mylyn.tasks.core.ITaskMapping;
import org.eclipse.mylyn.tasks.core.TaskRepository;
import org.eclipse.mylyn.tasks.core.data.TaskAttribute;
import org.eclipse.mylyn.tasks.core.data.TaskAttributeMapper;
import org.eclipse.mylyn.tasks.core.data.TaskDataModel;
import org.eclipse.mylyn.tasks.ui.TasksUi;
import org.eclipse.mylyn.tasks.ui.editors.AbstractAttributeEditor;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.ui.forms.widgets.FormToolkit;

public class PriorityAttributeEditor
  extends AbstractAttributeEditor
{
  private PriorityEditor editor;
  private ITaskMapping mapping;
  
  public PriorityAttributeEditor(TaskDataModel manager, TaskAttribute taskAttribute)
  {
    super(manager, taskAttribute);
    boolean noOptions = getAttributeMapper().getOptions(getTaskAttribute()).size() == 0;
    setReadOnly((isReadOnly()) || (noOptions));
  }
  
  public void createControl(Composite parent, FormToolkit toolkit)
  {
    AbstractRepositoryConnector connector = TasksUi.getRepositoryConnector(getModel().getTaskRepository()
      .getConnectorKind());
    mapping = connector.getTaskMapping(getModel().getTaskData());
    editor = new PriorityEditor()
    {
      protected void valueChanged(String value)
      {
        setValue(value);
      }
    };
    editor.setReadOnly(isReadOnly());
    editor.createControl(parent, toolkit);
    setControl(editor.getControl());
    refresh();
  }
  
  public String getValue()
  {
    return getAttributeMapper().getValue(getTaskAttribute());
  }
  
  public String getValueLabel()
  {
    return getAttributeMapper().getValueLabel(getTaskAttribute());
  }
  
  public void refresh()
  {
    if ((editor.getControl() != null) && (!editor.getControl().isDisposed()))
    {
      editor.setLabelByValue(getAttributeMapper().getOptions(getTaskAttribute()));
      updateEditor();
    }
  }
  
  public boolean shouldAutoRefresh()
  {
    return true;
  }
  
  public void setValue(String value)
  {
    String oldValue = getAttributeMapper().getValue(getTaskAttribute());
    if (!oldValue.equals(value))
    {
      getAttributeMapper().setValue(getTaskAttribute(), value);
      attributeChanged();
    }
  }
  
  private void updateEditor()
  {
    editor.select(getValue(), mapping.getPriorityLevel());
    editor.setToolTipText(getValueLabel());
  }
}

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

import org.eclipse.swt.custom.CCombo;
import org.eclipse.swt.custom.CTabFolder;
import org.eclipse.swt.custom.StyledText;
import org.eclipse.swt.events.FocusAdapter;
import org.eclipse.swt.events.FocusEvent;
import org.eclipse.swt.events.FocusListener;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Link;
import org.eclipse.swt.widgets.List;
import org.eclipse.swt.widgets.Spinner;
import org.eclipse.swt.widgets.TabFolder;
import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.Text;
import org.eclipse.swt.widgets.Tree;
import org.eclipse.ui.dialogs.FilteredTree;
import org.eclipse.ui.forms.widgets.Hyperlink;

public class FocusTracker
{
  private Control lastFocusControl;
  private final FocusListener listener = new FocusAdapter()
  {
    public void focusGained(FocusEvent e)
    {
      lastFocusControl = ((Control)widget);
    }
  };
  
  public void track(Composite composite)
  {
    Control[] children = composite.getChildren();
    Control[] arrayOfControl1;
    int j = (arrayOfControl1 = children).length;
    for (int i = 0; i < j; i++)
    {
      Control control = arrayOfControl1[i];
      if (((control instanceof Text)) || ((control instanceof Button)) || ((control instanceof Combo)) || 
        ((control instanceof CCombo)) || ((control instanceof Tree)) || ((control instanceof Table)) || 
        ((control instanceof Spinner)) || ((control instanceof Link)) || 
        ((control instanceof List)) || ((control instanceof TabFolder)) || 
        ((control instanceof CTabFolder)) || ((control instanceof Hyperlink)) || 
        ((control instanceof FilteredTree)) || ((control instanceof StyledText))) {
        control.addFocusListener(listener);
      }
      if ((control instanceof Composite)) {
        track((Composite)control);
      }
    }
  }
  
  public void reset()
  {
    lastFocusControl = null;
  }
  
  public boolean setFocus()
  {
    if ((lastFocusControl != null) && (!lastFocusControl.isDisposed())) {
      return lastFocusControl.setFocus();
    }
    return false;
  }
}

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

import org.eclipse.mylyn.tasks.core.data.TaskAttribute;
import org.eclipse.mylyn.tasks.core.data.TaskAttributeMapper;
import org.eclipse.mylyn.tasks.core.data.TaskDataModel;
import org.eclipse.mylyn.tasks.ui.editors.AbstractAttributeEditor;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.ui.forms.widgets.FormToolkit;

public class BooleanAttributeEditor
  extends AbstractAttributeEditor
{
  private Button button;
  private boolean ignoreNotification;
  private boolean suppressRefresh;
  
  public BooleanAttributeEditor(TaskDataModel manager, TaskAttribute taskAttribute)
  {
    super(manager, taskAttribute);
  }
  
  public void createControl(Composite parent, FormToolkit toolkit)
  {
    button = toolkit.createButton(parent, super.getLabel(), 32);
    button.setEnabled(!isReadOnly());
    button.addSelectionListener(new SelectionAdapter()
    {
      /* Error */
      public void widgetSelected(org.eclipse.swt.events.SelectionEvent e)
      {
        // Byte code:
        //   0: aload_0
        //   1: getfield 40	org/eclipse/mylyn/internal/tasks/ui/editors/BooleanAttributeEditor$1:this$0	Lorg/eclipse/mylyn/internal/tasks/ui/editors/BooleanAttributeEditor;
        //   4: invokestatic 42	org/eclipse/mylyn/internal/tasks/ui/editors/BooleanAttributeEditor:access$0	(Lorg/eclipse/mylyn/internal/tasks/ui/editors/BooleanAttributeEditor;)Z
        //   7: ifne +50 -> 57
        //   10: aload_0
        //   11: getfield 40	org/eclipse/mylyn/internal/tasks/ui/editors/BooleanAttributeEditor$1:this$0	Lorg/eclipse/mylyn/internal/tasks/ui/editors/BooleanAttributeEditor;
        //   14: iconst_1
        //   15: invokestatic 43	org/eclipse/mylyn/internal/tasks/ui/editors/BooleanAttributeEditor:access$1	(Lorg/eclipse/mylyn/internal/tasks/ui/editors/BooleanAttributeEditor;Z)V
        //   18: aload_0
        //   19: getfield 40	org/eclipse/mylyn/internal/tasks/ui/editors/BooleanAttributeEditor$1:this$0	Lorg/eclipse/mylyn/internal/tasks/ui/editors/BooleanAttributeEditor;
        //   22: aload_0
        //   23: getfield 40	org/eclipse/mylyn/internal/tasks/ui/editors/BooleanAttributeEditor$1:this$0	Lorg/eclipse/mylyn/internal/tasks/ui/editors/BooleanAttributeEditor;
        //   26: invokestatic 44	org/eclipse/mylyn/internal/tasks/ui/editors/BooleanAttributeEditor:access$2	(Lorg/eclipse/mylyn/internal/tasks/ui/editors/BooleanAttributeEditor;)Lorg/eclipse/swt/widgets/Button;
        //   29: invokevirtual 46	org/eclipse/swt/widgets/Button:getSelection	()Z
        //   32: invokevirtual 41	org/eclipse/mylyn/internal/tasks/ui/editors/BooleanAttributeEditor:setValue	(Z)V
        //   35: goto +14 -> 49
        //   38: astore_2
        //   39: aload_0
        //   40: getfield 40	org/eclipse/mylyn/internal/tasks/ui/editors/BooleanAttributeEditor$1:this$0	Lorg/eclipse/mylyn/internal/tasks/ui/editors/BooleanAttributeEditor;
        //   43: iconst_0
        //   44: invokestatic 43	org/eclipse/mylyn/internal/tasks/ui/editors/BooleanAttributeEditor:access$1	(Lorg/eclipse/mylyn/internal/tasks/ui/editors/BooleanAttributeEditor;Z)V
        //   47: aload_2
        //   48: athrow
        //   49: aload_0
        //   50: getfield 40	org/eclipse/mylyn/internal/tasks/ui/editors/BooleanAttributeEditor$1:this$0	Lorg/eclipse/mylyn/internal/tasks/ui/editors/BooleanAttributeEditor;
        //   53: iconst_0
        //   54: invokestatic 43	org/eclipse/mylyn/internal/tasks/ui/editors/BooleanAttributeEditor:access$1	(Lorg/eclipse/mylyn/internal/tasks/ui/editors/BooleanAttributeEditor;Z)V
        //   57: return
        // Line number table:
        //   Java source line #46	-> byte code offset #0
        //   Java source line #48	-> byte code offset #10
        //   Java source line #49	-> byte code offset #18
        //   Java source line #50	-> byte code offset #38
        //   Java source line #51	-> byte code offset #39
        //   Java source line #52	-> byte code offset #47
        //   Java source line #51	-> byte code offset #49
        //   Java source line #54	-> byte code offset #57
        // Local variable table:
        //   start	length	slot	name	signature
        //   0	58	0	this	1
        //   0	58	1	e	org.eclipse.swt.events.SelectionEvent
        //   38	10	2	localObject	Object
        // Exception table:
        //   from	to	target	type
        //   10	38	38	finally
      }
    });
    button.setToolTipText(getDescription());
    refresh();
    setControl(button);
  }
  
  public String getLabel()
  {
    return "";
  }
  
  public boolean getValue()
  {
    return getAttributeMapper().getBooleanValue(getTaskAttribute());
  }
  
  public void setValue(boolean value)
  {
    getAttributeMapper().setBooleanValue(getTaskAttribute(), Boolean.valueOf(value));
    attributeChanged();
  }
  
  /* Error */
  public void refresh()
  {
    // Byte code:
    //   0: aload_0
    //   1: getfield 102	org/eclipse/mylyn/internal/tasks/ui/editors/BooleanAttributeEditor:button	Lorg/eclipse/swt/widgets/Button;
    //   4: ifnull +13 -> 17
    //   7: aload_0
    //   8: getfield 102	org/eclipse/mylyn/internal/tasks/ui/editors/BooleanAttributeEditor:button	Lorg/eclipse/swt/widgets/Button;
    //   11: invokevirtual 117	org/eclipse/swt/widgets/Button:isDisposed	()Z
    //   14: ifeq +4 -> 18
    //   17: return
    //   18: aload_0
    //   19: iconst_1
    //   20: putfield 100	org/eclipse/mylyn/internal/tasks/ui/editors/BooleanAttributeEditor:ignoreNotification	Z
    //   23: aload_0
    //   24: getfield 102	org/eclipse/mylyn/internal/tasks/ui/editors/BooleanAttributeEditor:button	Lorg/eclipse/swt/widgets/Button;
    //   27: aload_0
    //   28: invokevirtual 106	org/eclipse/mylyn/internal/tasks/ui/editors/BooleanAttributeEditor:getValue	()Z
    //   31: invokevirtual 119	org/eclipse/swt/widgets/Button:setSelection	(Z)V
    //   34: goto +11 -> 45
    //   37: astore_1
    //   38: aload_0
    //   39: iconst_0
    //   40: putfield 100	org/eclipse/mylyn/internal/tasks/ui/editors/BooleanAttributeEditor:ignoreNotification	Z
    //   43: aload_1
    //   44: athrow
    //   45: aload_0
    //   46: iconst_0
    //   47: putfield 100	org/eclipse/mylyn/internal/tasks/ui/editors/BooleanAttributeEditor:ignoreNotification	Z
    //   50: return
    // Line number table:
    //   Java source line #77	-> byte code offset #0
    //   Java source line #78	-> byte code offset #17
    //   Java source line #82	-> byte code offset #18
    //   Java source line #83	-> byte code offset #23
    //   Java source line #84	-> byte code offset #37
    //   Java source line #85	-> byte code offset #38
    //   Java source line #86	-> byte code offset #43
    //   Java source line #85	-> byte code offset #45
    //   Java source line #87	-> byte code offset #50
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	51	0	this	BooleanAttributeEditor
    //   37	7	1	localObject	Object
    // Exception table:
    //   from	to	target	type
    //   18	37	37	finally
  }
  
  public boolean shouldAutoRefresh()
  {
    return !suppressRefresh;
  }
}

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

public abstract interface RichTextEditor$StateChangedListener
{
  public abstract void stateChanged(RichTextEditor.StateChangedEvent paramStateChangedEvent);
}

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

import org.eclipse.jface.viewers.Viewer;
import org.eclipse.jface.viewers.ViewerFilter;
import org.eclipse.mylyn.tasks.core.ITaskAttachment;

class TaskEditorAttachmentPart$AttachmentTableFilter
  extends ViewerFilter
{
  private boolean filterDeprecatedEnabled;
  
  private TaskEditorAttachmentPart$AttachmentTableFilter(TaskEditorAttachmentPart paramTaskEditorAttachmentPart) {}
  
  public boolean isFilterDeprecatedEnabled()
  {
    return filterDeprecatedEnabled;
  }
  
  public void setFilterDeprecatedEnabled(boolean filterDeprecatedEnabled)
  {
    this.filterDeprecatedEnabled = filterDeprecatedEnabled;
  }
  
  public boolean select(Viewer viewer, Object parentElement, Object element)
  {
    if ((filterDeprecatedEnabled) && 
      ((element instanceof ITaskAttachment))) {
      return !((ITaskAttachment)element).isDeprecated();
    }
    return true;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.internal.tasks.ui.editors.TaskEditorAttachmentPart.AttachmentTableFilter
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 *
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79

Further reading...

For more information on Java 1.5 Tiger, you may find Java 1.5 Tiger, A developer's Notebook by D. Flanagan and B. McLaughlin from O'Reilly of interest.

New!JAR listings


Copyright 2006-2019. Infinite Loop Ltd