![]() |
![]() |
org.eclipse.mylyn.tasks.ui_3.7.1.v20120425-0100} while ((min < mid) && (mid < max)) { String s1 = t.substring(0, mid); String s2 = t.substring(l - mid, l); int l1 = textExtentDRAW_FLAGSx; int l2 = textExtentDRAW_FLAGSx; if (l1 + w + l2 > width) { max = mid; mid = (max + min) / 2; } else if (l1 + w + l2 < width) { min = mid; mid = (max + min) / 2; } else { min = max; } } gc.dispose(); if (mid == 0) { return t; } return t.substring(0, mid) + "..." + t.substring(l - mid, l); } public static String shortenText(Drawable composite, String text, int maxWidth) { String returnText = text; GC gc = new GC(composite); if (textExtentx > maxWidth) { for (int i = text.length(); i > 0; i--) { String subString = text.substring(0, i); subString = subString + "..."; if (textExtentx < maxWidth) { returnText = subString; break; } } } gc.dispose(); return returnText; } } /* Location: * Qualified Name: org.eclipse.mylyn.internal.tasks.ui.notifications.TaskDiffUtil * Java Class Version: 5 (49.0) * JD-Core Version: 0.7.1 */ package org.eclipse.mylyn.internal.tasks.ui.notifications; import java.util.Date; import org.eclipse.core.runtime.Assert; import org.eclipse.jface.viewers.DecoratingLabelProvider; import org.eclipse.jface.viewers.LabelProvider; import org.eclipse.mylyn.commons.notifications.core.AbstractNotification; import org.eclipse.mylyn.commons.notifications.ui.AbstractUiNotification; import org.eclipse.mylyn.commons.ui.CommonImages; import org.eclipse.mylyn.internal.tasks.core.AbstractTask; import org.eclipse.mylyn.internal.tasks.ui.util.TasksUiInternal; import org.eclipse.mylyn.tasks.core.ITask; import org.eclipse.mylyn.tasks.core.ITask.SynchronizationState; import org.eclipse.mylyn.tasks.ui.TaskElementLabelProvider; import org.eclipse.swt.graphics.Image; import org.eclipse.swt.widgets.Display; import org.eclipse.ui.IDecoratorManager; import org.eclipse.ui.IWorkbench; import org.eclipse.ui.PlatformUI; public class TaskListNotification extends AbstractUiNotification { private static final String ID_EVENT_TASK_CHANGED = "org.eclipse.mylyn.tasks.ui.events.TaskChanged"; private static DecoratingLabelProvider labelProvider; protected final ITask task; protected Date date; private String description; private final Object token; public TaskListNotification(ITask task) { this("org.eclipse.mylyn.tasks.ui.events.TaskChanged", task, null); } public TaskListNotification(String eventId, ITask task) { this(eventId, task, null); } public TaskListNotification(ITask task, Object token) { this("org.eclipse.mylyn.tasks.ui.events.TaskChanged", task, token); } public TaskListNotification(String eventId, ITask task, Object token) { super(eventId); Assert.isNotNull(task); this.task = task; this.token = token; } private LabelProvider getLabelProvider() { if (labelProvider == null) { labelProvider = new DecoratingLabelProvider(new TaskElementLabelProvider(true), PlatformUI.getWorkbench() .getDecoratorManager() .getLabelDecorator()); } return labelProvider; } public String getDescription() { return description; } public String getLabel() { return getLabelProvider().getText(task); } public void setDescription(String description) { this.description = description; } public void open() { PlatformUI.getWorkbench().getDisplay().syncExec(new Runnable() { public void run() { TasksUiInternal.refreshAndOpenTaskListElement(task); } }); } public Image getNotificationImage() { return getLabelProvider().getImage(task); } protected ITask getTask() { return task; } public Image getNotificationKindImage() { if (task.getSynchronizationState() == ITask.SynchronizationState.INCOMING_NEW) { return CommonImages.getImage(CommonImages.OVERLAY_SYNC_INCOMMING_NEW); } if (task.getSynchronizationState() == ITask.SynchronizationState.OUTGOING_NEW) { return CommonImages.getImage(CommonImages.OVERLAY_SYNC_OUTGOING_NEW); } return CommonImages.getImage(CommonImages.OVERLAY_SYNC_INCOMMING); } public Date getDate() { return date; } public void setDate(Date date) { this.date = date; } public int compareTo(AbstractNotification anotherNotification) throws ClassCastException { Date anotherDate = anotherNotification.getDate(); if ((date != null) && (anotherDate != null)) { return date.compareTo(anotherDate) * -1; } if (date == null) { return 1; } return -1; } public int hashCode() { int result = 1; result = 31 * result + (date == null ? 0 : date.hashCode()); result = 31 * result + (description == null ? 0 : description.hashCode()); result = 31 * result + (task == null ? 0 : task.hashCode()); return result; } public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } TaskListNotification other = (TaskListNotification)obj; if (date == null) { if (date != null) { return false; } } else if (!date.equals(date)) { return false; } if (description == null) { if (description != null) { return false; } } else if (!description.equals(description)) { return false; } if (task == null) { if (task != null) { return false; } } else if (!task.equals(task)) { return false; } return true; } public Object getAdapter(Class adapter) { if (adapter == AbstractTask.class) { return task; } return null; } public Object getToken() { return token; } } /* Location: * Qualified Name: org.eclipse.mylyn.internal.tasks.ui.notifications.TaskListNotification * Java Class Version: 5 (49.0) * JD-Core Version: 0.7.1 */ package org.eclipse.mylyn.internal.tasks.ui.notifications; import org.eclipse.mylyn.internal.commons.notifications.feed.ServiceMessage; class TaskListServiceMessageControl$1 implements Runnable { TaskListServiceMessageControl$1(TaskListServiceMessageControl paramTaskListServiceMessageControl, ServiceMessage paramServiceMessage) {} public void run() { this$0.setMessage(val$message); TaskListServiceMessageControl.access$0(this$0, ""); } } /* Location: * Qualified Name: org.eclipse.mylyn.internal.tasks.ui.notifications.TaskListServiceMessageControl.1 * Java Class Version: 5 (49.0) * JD-Core Version: 0.7.1 */ package org.eclipse.mylyn.internal.tasks.ui.notifications; import org.eclipse.mylyn.internal.tasks.core.AbstractTask; import org.eclipse.mylyn.internal.tasks.core.data.TaskDataManager; import org.eclipse.mylyn.internal.tasks.ui.TasksUiPlugin; import org.eclipse.swt.events.MouseAdapter; import org.eclipse.swt.events.MouseEvent; import org.eclipse.swt.widgets.Label; class TaskListNotificationPopup$1 extends MouseAdapter { TaskListNotificationPopup$1(TaskListNotificationPopup paramTaskListNotificationPopup, AbstractTask paramAbstractTask, Label paramLabel) {} public void mouseUp(MouseEvent e) { TasksUiPlugin.getTaskDataManager().setTaskRead(val$task, true); val$notificationLabelIcon.setImage(null); val$notificationLabelIcon.setToolTipText(null); } } /* Location: * Qualified Name: org.eclipse.mylyn.internal.tasks.ui.notifications.TaskListNotificationPopup.1 * Java Class Version: 5 (49.0) * JD-Core Version: 0.7.1 */ package org.eclipse.mylyn.internal.tasks.ui.notifications; import org.eclipse.core.commands.Command; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Status; import org.eclipse.mylyn.internal.tasks.core.LocalTask; import org.eclipse.mylyn.internal.tasks.ui.actions.AddRepositoryAction; import org.eclipse.mylyn.internal.tasks.ui.util.TasksUiInternal; import org.eclipse.mylyn.internal.tasks.ui.wizards.Messages; import org.eclipse.mylyn.tasks.ui.TasksUiUtil; import org.eclipse.osgi.util.NLS; import org.eclipse.swt.events.SelectionAdapter; import org.eclipse.swt.events.SelectionEvent; import org.eclipse.ui.IWorkbench; import org.eclipse.ui.PlatformUI; import org.eclipse.ui.handlers.IHandlerService; class TaskListServiceMessageControl$2 extends SelectionAdapter { TaskListServiceMessageControl$2(TaskListServiceMessageControl paramTaskListServiceMessageControl) {} public void widgetSelected(SelectionEvent e) { if (text == null) { return; } String action = TaskListServiceMessageControl.getAction(text); if ("create-local-task".equals(action)) { this$0.closeMessage(); LocalTask task = TasksUiInternal.createNewLocalTask(null); TasksUiUtil.openTask(task); } else if ("connect".equals(action)) { this$0.closeMessage(); new AddRepositoryAction().run(); } else if ("discovery".equals(action)) { this$0.closeMessage(); Command discoveryWizardCommand = TasksUiInternal.getConfiguredDiscoveryWizardCommand(); if ((discoveryWizardCommand != null) && (discoveryWizardCommand.isEnabled())) { IHandlerService handlerService = (IHandlerService)PlatformUI.getWorkbench().getService( IHandlerService.class); try { handlerService.executeCommand(discoveryWizardCommand.getId(), null); } catch (Exception e1) { IStatus status = new Status(4, "org.eclipse.mylyn.tasks.ui", NLS.bind( Messages.SelectRepositoryConnectorPage_discoveryProblemMessage, new Object[] { e1.getMessage() }), e1); TasksUiInternal.logAndDisplayStatus( Messages.SelectRepositoryConnectorPage_discoveryProblemTitle, status); } } } else if (TasksUiInternal.isValidUrl(text)) { TasksUiUtil.openUrl(text); } } } /* Location: * Qualified Name: org.eclipse.mylyn.internal.tasks.ui.notifications.TaskListServiceMessageControl.2 * Java Class Version: 5 (49.0) * JD-Core Version: 0.7.1 */ package org.eclipse.mylyn.internal.tasks.ui.notifications; import org.eclipse.mylyn.commons.notifications.ui.AbstractUiNotification; import org.eclipse.swt.widgets.Shell; import org.eclipse.ui.IWorkbench; import org.eclipse.ui.IWorkbenchWindow; import org.eclipse.ui.PlatformUI; import org.eclipse.ui.forms.events.HyperlinkAdapter; import org.eclipse.ui.forms.events.HyperlinkEvent; class TaskListNotificationPopup$2 extends HyperlinkAdapter { TaskListNotificationPopup$2(TaskListNotificationPopup paramTaskListNotificationPopup, AbstractUiNotification paramAbstractUiNotification) {} public void linkActivated(HyperlinkEvent e) { val$notification.open(); IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow(); if (window != null) { Shell windowShell = window.getShell(); if (windowShell != null) { if (windowShell.getMinimized()) { windowShell.setMinimized(false); } windowShell.open(); windowShell.forceActive(); } } } } /* Location: * Qualified Name: org.eclipse.mylyn.internal.tasks.ui.notifications.TaskListNotificationPopup.2 * Java Class Version: 5 (49.0) * JD-Core Version: 0.7.1 */ package org.eclipse.mylyn.internal.tasks.ui.notifications; import java.util.ArrayList; import java.util.Collections; import java.util.HashSet; import java.util.List; import java.util.Set; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.NullProgressMonitor; import org.eclipse.core.runtime.Status; import org.eclipse.mylyn.commons.core.StatusHandler; import org.eclipse.mylyn.commons.notifications.ui.AbstractUiNotification; import org.eclipse.mylyn.internal.tasks.core.data.ITaskDataManagerListener; import org.eclipse.mylyn.internal.tasks.core.data.SynchronizationManger; import org.eclipse.mylyn.internal.tasks.core.data.TaskDataDiff; import org.eclipse.mylyn.internal.tasks.core.data.TaskDataManager; import org.eclipse.mylyn.internal.tasks.core.data.TaskDataManagerEvent; import org.eclipse.mylyn.internal.tasks.ui.ITaskListNotificationProvider; import org.eclipse.mylyn.internal.tasks.ui.views.PresentationFilter; import org.eclipse.mylyn.tasks.core.ITask; import org.eclipse.mylyn.tasks.core.ITask.SynchronizationState; import org.eclipse.mylyn.tasks.core.data.ITaskDataWorkingCopy; import org.eclipse.mylyn.tasks.core.data.TaskData; import org.eclipse.mylyn.tasks.ui.AbstractRepositoryConnectorUi; import org.eclipse.mylyn.tasks.ui.TasksUi; public class TaskListNotifier implements ITaskDataManagerListener, ITaskListNotificationProvider { private final TaskDataManager taskDataManager; private final List<TaskListNotification> notificationQueue = new ArrayList(); public boolean enabled; private final SynchronizationManger synchronizationManger; public TaskListNotifier(TaskDataManager taskDataManager, SynchronizationManger synchronizationManger) { this.taskDataManager = taskDataManager; this.synchronizationManger = synchronizationManger; } public TaskListNotification getNotification(ITask task, Object token) { if (task.getSynchronizationState() == ITask.SynchronizationState.INCOMING_NEW) { TaskListNotification notification = new TaskListNotification(task, token); notification.setDescription(Messages.TaskListNotifier_New_unread_task); return notification; } if (task.getSynchronizationState() == ITask.SynchronizationState.INCOMING) { TaskDataDiff diff = getDiff(task); if ((diff != null) && (diff.hasChanged())) { TaskListNotification notification = new TaskListNotification(task, token); notification.setDescription(TaskDiffUtil.toString(diff, 60, true)); return notification; } } return null; } public TaskDataDiff getDiff(ITask task) { try { ITaskDataWorkingCopy workingCopy = taskDataManager.getTaskDataState(task); if (workingCopy != null) { return synchronizationManger.createDiff(workingCopy.getRepositoryData(), workingCopy.getLastReadData(), new NullProgressMonitor()); } } catch (CoreException e) { StatusHandler.log(new Status(4, "org.eclipse.mylyn.tasks.ui", "Failed to get task data for task: \"" + task + "\"", e)); } return null; } public void taskDataUpdated(TaskDataManagerEvent event) { synchronized (notificationQueue) { if (!enabled) { return; } } if ((event.getToken() != null) && (event.getTaskDataChanged()) && (PresentationFilter.getInstance().isInVisibleQuery(event.getTask()))) { AbstractRepositoryConnectorUi connectorUi = TasksUi.getRepositoryConnectorUi(event.getTaskData() .getConnectorKind()); if (!connectorUi.hasCustomNotifications()) { TaskListNotification notification = getNotification(event.getTask(), event.getToken()); if (notification != null) { synchronized (notificationQueue) { if (enabled) { notificationQueue.add(notification); } } } } } } public Set<AbstractUiNotification> getNotifications() { synchronized (notificationQueue) { if (notificationQueue.isEmpty()) { return Collections.emptySet(); } HashSet<AbstractUiNotification> result = new HashSet(notificationQueue); notificationQueue.clear(); return result; } } public void editsDiscarded(TaskDataManagerEvent event) {} public void setEnabled(boolean enabled) { synchronized (notificationQueue) { if (!enabled) { notificationQueue.clear(); } this.enabled = enabled; } } /* Error */ public boolean isEnabled() { // Byte code: // 0: aload_0 // 1: getfield 196 org/eclipse/mylyn/internal/tasks/ui/notifications/TaskListNotifier:notificationQueue Ljava/util/List; // 4: dup // 5: astore_1 // 6: monitorenter // 7: aload_0 // 8: getfield 195 org/eclipse/mylyn/internal/tasks/ui/notifications/TaskListNotifier:enabled Z // 11: aload_1 // 12: monitorexit // 13: ireturn // 14: aload_1 // 15: monitorexit // 16: athrow // Line number table: // Java source line #139 -> byte code offset #0 // Java source line #140 -> byte code offset #7 // Java source line #139 -> byte code offset #14 // Local variable table: // start length slot name signature // 0 17 0 this TaskListNotifier // 5 10 1 Ljava/lang/Object; Object // Exception table: // from to target type // 7 13 14 finally // 14 16 14 finally } } /* Location: * Qualified Name: org.eclipse.mylyn.internal.tasks.ui.notifications.TaskListNotifier * Java Class Version: 5 (49.0) * JD-Core Version: 0.7.1 */ package org.eclipse.mylyn.internal.tasks.ui.notifications; import java.net.MalformedURLException; import java.net.URL; import java.util.Collections; import java.util.Date; import org.eclipse.core.commands.Command; import org.eclipse.core.commands.ExecutionEvent; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Status; import org.eclipse.jface.dialogs.Dialog; import org.eclipse.jface.preference.IPreferenceStore; import org.eclipse.mylyn.commons.notifications.feed.IServiceMessageListener; import org.eclipse.mylyn.commons.notifications.feed.ServiceMessageEvent; import org.eclipse.mylyn.commons.notifications.ui.NotificationControl; import org.eclipse.mylyn.internal.commons.notifications.feed.ServiceMessage; import org.eclipse.mylyn.internal.tasks.core.LocalTask; import org.eclipse.mylyn.internal.tasks.ui.TasksUiPlugin; import org.eclipse.mylyn.internal.tasks.ui.actions.AddRepositoryAction; import org.eclipse.mylyn.internal.tasks.ui.util.TasksUiInternal; import org.eclipse.mylyn.internal.tasks.ui.wizards.Messages; import org.eclipse.mylyn.tasks.ui.TasksUiUtil; import org.eclipse.osgi.util.NLS; import org.eclipse.swt.events.SelectionAdapter; import org.eclipse.swt.events.SelectionEvent; import org.eclipse.swt.events.SelectionListener; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Display; import org.eclipse.ui.IWorkbench; import org.eclipse.ui.PlatformUI; import org.eclipse.ui.handlers.IHandlerService; public class TaskListServiceMessageControl extends NotificationControl implements IServiceMessageListener { private ServiceMessage currentMessage; public TaskListServiceMessageControl(Composite parent) { super(parent); setPreferencesPageId("org.eclipse.mylyn.tasks.ui.preferences"); } static ExecutionEvent createExecutionEvent(Command command, IHandlerService handlerService) { return new ExecutionEvent(command, Collections.emptyMap(), null, TasksUiInternal.createDiscoveryWizardEvaluationContext(handlerService)); } protected void closeMessage() { if (currentMessage != null) { TasksUiPlugin.getDefault().getPreferenceStore().setValue("org.eclipse.mylyn.tasks.ui.servicemessage.id", currentMessage.getId()); } close(); } public void handleEvent(ServiceMessageEvent event) { switch (event.getEventKind()) { case MESSAGE_UPDATE: IPreferenceStore preferenceStore = TasksUiPlugin.getDefault().getPreferenceStore(); preferenceStore.setValue("org.eclipse.mylyn.tasks.ui.servicemessage.checktime", new Date().getTime()); String lastMessageId = preferenceStore.getString("org.eclipse.mylyn.tasks.ui.servicemessage.id"); for (final ServiceMessage message : event.getMessages()) { if ((message.isValid()) && (!message.getId().equals("-1"))) { if (message.getId().compareTo(lastMessageId) > 0) { Display.getDefault().asyncExec(new Runnable() { public void run() { setMessage(message); setEventId(""); } }); break; } } } break; case STOP: close(); } } public void setMessage(ServiceMessage message) { if (message != null) { ensureControl(); if ((message.getETag() != null) && (message.getLastModified() != null)) { IPreferenceStore preferenceStore = TasksUiPlugin.getDefault().getPreferenceStore(); preferenceStore.setValue("org.eclipse.mylyn.tasks.ui.servicemessage.etag", message.getETag()); preferenceStore.setValue("org.eclipse.mylyn.tasks.ui.servicemessage.lastmodified", message.getLastModified()); } currentMessage = message; setTitle(message.getTitle()); setTitleImage(Dialog.getImage(message.getImage())); setDescription(message.getDescription()); } } public SelectionListener getLinkListener() { new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { if (text == null) { return; } String action = TaskListServiceMessageControl.getAction(text); if ("create-local-task".equals(action)) { closeMessage(); LocalTask task = TasksUiInternal.createNewLocalTask(null); TasksUiUtil.openTask(task); } else if ("connect".equals(action)) { closeMessage(); new AddRepositoryAction().run(); } else if ("discovery".equals(action)) { closeMessage(); Command discoveryWizardCommand = TasksUiInternal.getConfiguredDiscoveryWizardCommand(); if ((discoveryWizardCommand != null) && (discoveryWizardCommand.isEnabled())) { IHandlerService handlerService = (IHandlerService)PlatformUI.getWorkbench().getService( IHandlerService.class); try { handlerService.executeCommand(discoveryWizardCommand.getId(), null); } catch (Exception e1) { IStatus status = new Status(4, "org.eclipse.mylyn.tasks.ui", NLS.bind( Messages.SelectRepositoryConnectorPage_discoveryProblemMessage, new Object[] { e1.getMessage() }), e1); TasksUiInternal.logAndDisplayStatus( Messages.SelectRepositoryConnectorPage_discoveryProblemTitle, status); } } } else if (TasksUiInternal.isValidUrl(text)) { TasksUiUtil.openUrl(text); } } }; } public static String getAction(String action) { if (action.startsWith("http")) { try { URL url = new URL(action); String query = url.getQuery(); if ((query != null) && (query.startsWith("action="))) { int i = query.indexOf("&"); if (i != -1) { action = query.substring(7, i); } else { action = query.substring(7); } } else { return null; } } catch (MalformedURLException localMalformedURLException) { return null; } } return action.toLowerCase(); } } /* Location: * Qualified Name: org.eclipse.mylyn.internal.tasks.ui.notifications.TaskListServiceMessageControl * Java Class Version: 5 (49.0) * JD-Core Version: 0.7.1 */ package org.eclipse.mylyn.internal.tasks.ui.notifications; import org.eclipse.mylyn.tasks.ui.TasksUiUtil; import org.eclipse.swt.widgets.Shell; import org.eclipse.ui.IViewPart; import org.eclipse.ui.IWorkbench; import org.eclipse.ui.IWorkbenchWindow; import org.eclipse.ui.PlatformUI; import org.eclipse.ui.forms.events.HyperlinkAdapter; import org.eclipse.ui.forms.events.HyperlinkEvent; class TaskListNotificationPopup$3 extends HyperlinkAdapter { TaskListNotificationPopup$3(TaskListNotificationPopup paramTaskListNotificationPopup) {} public void linkActivated(HyperlinkEvent e) { TasksUiUtil.openTasksViewInActivePerspective().setFocus(); IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow(); if (window != null) { Shell windowShell = window.getShell(); if (windowShell != null) { windowShell.setMaximized(true); windowShell.open(); } } } } /* Location: * Qualified Name: org.eclipse.mylyn.internal.tasks.ui.notifications.TaskListNotificationPopup.3 * Java Class Version: 5 (49.0) * JD-Core Version: 0.7.1 */ package org.eclipse.mylyn.internal.tasks.ui.notifications; import org.eclipse.mylyn.internal.tasks.ui.util.TasksUiInternal; class TaskListNotification$1 implements Runnable { TaskListNotification$1(TaskListNotification paramTaskListNotification) {} public void run() { TasksUiInternal.refreshAndOpenTaskListElement(this$0.task); } } /* Location: * Qualified Name: org.eclipse.mylyn.internal.tasks.ui.notifications.TaskListNotification.1 * Java Class Version: 5 (49.0) * JD-Core Version: 0.7.1 */ package org.eclipse.mylyn.internal.tasks.ui.notifications; import org.eclipse.osgi.util.NLS; public class Messages extends NLS { private static final String BUNDLE_NAME = "org.eclipse.mylyn.internal.tasks.ui.notifications.messages"; public static String TaskDataDiff_more_; public static String TaskDiffUtil_attachment; public static String TaskDiffUtil_Comment_by_X; public static String TaskDiffUtil_Unknown; public static String TaskListNotificationPopup_Mark_Task_Read; public static String TaskListNotificationPopup_more; public static String TaskListNotifier_New_unread_task; static {} public static void reloadMessages() { NLS.initializeMessages("org.eclipse.mylyn.internal.tasks.ui.notifications.messages", Messages.class); } } /* Location: * Qualified Name: org.eclipse.mylyn.internal.tasks.ui.notifications.Messages * Java Class Version: 5 (49.0) * JD-Core Version: 0.7.1 */ package org.eclipse.mylyn.internal.tasks.ui; import org.eclipse.core.runtime.IAdapterFactory; import org.eclipse.mylyn.tasks.core.ITask; import org.eclipse.mylyn.tasks.core.ITaskAttachment; import org.eclipse.mylyn.tasks.core.ITaskComment; import org.eclipse.mylyn.tasks.core.TaskRepository; import org.eclipse.mylyn.tasks.ui.editors.TaskEditor; import org.eclipse.mylyn.tasks.ui.editors.TaskEditorInput; public class TasksAdapterFactory implements IAdapterFactory { private static final Class<?>[] ADAPTER_LIST = { ITask.class, TaskRepository.class }; public Class[] getAdapterList() { return ADAPTER_LIST; } public Object getAdapter(Object adaptable, Class adapterType) { if (adapterType == ITask.class) { if ((adaptable instanceof TaskEditor)) { return ((TaskEditor)adaptable).getTaskEditorInput().getTask(); } if ((adaptable instanceof TaskEditorInput)) { return ((TaskEditorInput)adaptable).getTask(); } if ((adaptable instanceof ITaskAttachment)) { return ((ITaskAttachment)adaptable).getTask(); } if ((adaptable instanceof ITaskComment)) { return ((ITaskComment)adaptable).getTask(); } } if (adapterType == TaskRepository.class) { if ((adaptable instanceof TaskEditor)) { return ((TaskEditor)adaptable).getTaskEditorInput().getTaskRepository(); } if ((adaptable instanceof TaskEditorInput)) { return ((TaskEditorInput)adaptable).getTaskRepository(); } if ((adaptable instanceof ITaskAttachment)) { return ((ITaskAttachment)adaptable).getTaskRepository(); } if ((adaptable instanceof ITaskComment)) { return ((ITaskComment)adaptable).getTask(); } } return null; } } /* Location: * Qualified Name: org.eclipse.mylyn.internal.tasks.ui.TasksAdapterFactory * Java Class Version: 5 (49.0) * JD-Core Version: 0.7.1 */ package org.eclipse.mylyn.internal.tasks.ui; import org.eclipse.core.runtime.IAdapterFactory; import org.eclipse.mylyn.internal.tasks.core.TaskRepositoryManager; import org.eclipse.mylyn.tasks.core.AbstractRepositoryConnector; import org.eclipse.mylyn.tasks.core.IRepositoryManager; import org.eclipse.mylyn.tasks.core.TaskRepository; import org.eclipse.mylyn.tasks.ui.AbstractRepositoryConnectorUi; import org.eclipse.mylyn.tasks.ui.TasksUi; import org.eclipse.ui.IActionFilter; public class TaskRepositoryAdapterFactory implements IAdapterFactory { private static final Class[] ADAPTER_TYPES = { IActionFilter.class }; public Class[] getAdapterList() { return ADAPTER_TYPES; } public Object getAdapter(Object adaptable, Class adapterType) { if ((adaptable instanceof TaskRepository)) { new IActionFilter() { public boolean testAttribute(Object target, String name, String value) { TaskRepository repository = (TaskRepository)target; if ("offline".equals(name)) { return Boolean.valueOf(value).booleanValue() == repository.isOffline(); } if ("supportQuery".equals(name)) { AbstractRepositoryConnectorUi connectorUi = TasksUiPlugin.getConnectorUi(repository.getConnectorKind()); AbstractRepositoryConnector connector = TasksUiPlugin.getRepositoryManager() .getRepositoryConnector(repository.getConnectorKind()); return (connectorUi.getQueryWizard(repository, null) != null) && (connector.canQuery(repository)); } if ("supportNewTask".equals(name)) { AbstractRepositoryConnector connector = TasksUi.getRepositoryManager().getRepositoryConnector( repository.getConnectorKind()); return connector.canCreateNewTask(repository); } if ("hasRepository".equals(name)) { return !repository.getConnectorKind().equals("local"); } return false; } }; } return null; } } /* Location: * Qualified Name: org.eclipse.mylyn.internal.tasks.ui.TaskRepositoryAdapterFactory * Java Class Version: 5 (49.0) * JD-Core Version: 0.7.1 */ package org.eclipse.mylyn.internal.tasks.ui; import org.eclipse.jface.fieldassist.IContentProposalProvider; import org.eclipse.jface.text.contentassist.IContentAssistProcessor; import org.eclipse.jface.viewers.ILabelProvider; import org.eclipse.mylyn.internal.tasks.ui.editors.RepositoryCompletionProcessor; import org.eclipse.mylyn.tasks.core.TaskRepository; import org.eclipse.mylyn.tasks.ui.ITasksUiFactory; public class TasksUiFactory implements ITasksUiFactory { public IContentProposalProvider createPersonContentProposalProvider(TaskRepository repository) { return new PersonProposalProvider(repository.getRepositoryUrl(), repository.getConnectorKind()); } public ILabelProvider createPersonContentProposalLabelProvider(TaskRepository repository) { return new PersonProposalLabelProvider(); } public IContentAssistProcessor createTaskContentAssistProcessor(TaskRepository repository) { return new RepositoryCompletionProcessor(repository); } } /* Location: * Qualified Name: org.eclipse.mylyn.internal.tasks.ui.TasksUiFactory * Java Class Version: 5 (49.0) * JD-Core Version: 0.7.1 */ package org.eclipse.mylyn.internal.tasks.ui; import java.text.MessageFormat; import java.util.Date; import java.util.List; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.jobs.Job; import org.eclipse.jface.dialogs.MessageDialog; import org.eclipse.mylyn.internal.tasks.ui.util.TaskOpenEvent; import org.eclipse.mylyn.internal.tasks.ui.util.TaskOpenListener; import org.eclipse.mylyn.internal.tasks.ui.util.TasksUiInternal; import org.eclipse.mylyn.tasks.core.ITask; import org.eclipse.mylyn.tasks.core.data.TaskAttribute; import org.eclipse.mylyn.tasks.core.data.TaskAttributeMapper; import org.eclipse.mylyn.tasks.core.data.TaskData; import org.eclipse.mylyn.tasks.ui.TasksUiUtil; import org.eclipse.mylyn.tasks.ui.editors.TaskEditor; import org.eclipse.ui.IWorkbenchPage; public class OpenRepositoryTaskJob extends Job { private final String repositoryUrl; private final String repositoryKind; private final String taskId; private final String taskUrl; private ITask task; private TaskOpenListener listener; private final long timestamp; public OpenRepositoryTaskJob(String repositoryKind, String repositoryUrl, String taskId, String taskUrl, IWorkbenchPage page) { this(repositoryKind, repositoryUrl, taskId, taskUrl, 0L, page); } public OpenRepositoryTaskJob(String repositoryKind, String repositoryUrl, String taskId, String taskUrl, long timestamp, IWorkbenchPage page) { super(MessageFormat.format(Messages.OpenRepositoryTaskJob_Opening_repository_task_X, new Object[] { taskId })); this.repositoryKind = repositoryKind; this.taskId = taskId; this.repositoryUrl = repositoryUrl; this.taskUrl = taskUrl; this.timestamp = timestamp; } public ITask getTask() { return task; } public void setListener(TaskOpenListener listener) { this.listener = listener; } /* Error */ public org.eclipse.core.runtime.IStatus run(org.eclipse.core.runtime.IProgressMonitor monitor) { // Byte code: // 0: aload_1 // 1: getstatic 158 org/eclipse/mylyn/internal/tasks/ui/Messages:OpenRepositoryTaskJob_Opening_Remote_Task Ljava/lang/String; // 4: bipush 10 // 6: invokeinterface 183 3 0 // 11: invokestatic 178 org/eclipse/mylyn/tasks/ui/TasksUi:getRepositoryManager ()Lorg/eclipse/mylyn/tasks/core/IRepositoryManager; // 14: aload_0 // 15: getfield 161 org/eclipse/mylyn/internal/tasks/ui/OpenRepositoryTaskJob:repositoryKind Ljava/lang/String; // 18: aload_0 // 19: getfield 162 org/eclipse/mylyn/internal/tasks/ui/OpenRepositoryTaskJob:repositoryUrl Ljava/lang/String; // 22: invokeinterface 185 3 0 // 27: astore_2 // 28: aload_2 // 29: ifnonnull +26 -> 55 // 32: invokestatic 181 org/eclipse/ui/PlatformUI:getWorkbench ()Lorg/eclipse/ui/IWorkbench; // 35: invokeinterface 187 1 0 // 40: new 76 org/eclipse/mylyn/internal/tasks/ui/OpenRepositoryTaskJob$1 // 43: dup // 44: aload_0 // 45: invokespecial 171 org/eclipse/mylyn/internal/tasks/ui/OpenRepositoryTaskJob$1:<init> (Lorg/eclipse/mylyn/internal/tasks/ui/OpenRepositoryTaskJob;)V // 48: invokevirtual 180 org/eclipse/swt/widgets/Display:asyncExec (Ljava/lang/Runnable;)V // 51: getstatic 157 org/eclipse/core/runtime/Status:OK_STATUS Lorg/eclipse/core/runtime/IStatus; // 54: areturn // 55: invokestatic 178 org/eclipse/mylyn/tasks/ui/TasksUi:getRepositoryManager ()Lorg/eclipse/mylyn/tasks/core/IRepositoryManager; // 58: aload_0 // 59: getfield 161 org/eclipse/mylyn/internal/tasks/ui/OpenRepositoryTaskJob:repositoryKind Ljava/lang/String; // 62: invokeinterface 184 2 0 // 67: astore_3 // 68: aload_3 // 69: aload_2 // 70: aload_0 // 71: getfield 163 org/eclipse/mylyn/internal/tasks/ui/OpenRepositoryTaskJob:taskId Ljava/lang/String; // 74: aload_1 // 75: invokevirtual 176 org/eclipse/mylyn/tasks/core/AbstractRepositoryConnector:getTaskData (Lorg/eclipse/mylyn/tasks/core/TaskRepository;Ljava/lang/String;Lorg/eclipse/core/runtime/IProgressMonitor;)Lorg/eclipse/mylyn/tasks/core/data/TaskData; // 78: astore 4 // 80: aload 4 // 82: ifnull +58 -> 140 // 85: aload_0 // 86: invokestatic 179 org/eclipse/mylyn/tasks/ui/TasksUi:getRepositoryModel ()Lorg/eclipse/mylyn/tasks/core/IRepositoryModel; // 89: aload_2 // 90: aload 4 // 92: invokevirtual 177 org/eclipse/mylyn/tasks/core/data/TaskData:getTaskId ()Ljava/lang/String; // 95: invokeinterface 186 3 0 // 100: putfield 166 org/eclipse/mylyn/internal/tasks/ui/OpenRepositoryTaskJob:task Lorg/eclipse/mylyn/tasks/core/ITask; // 103: invokestatic 175 org/eclipse/mylyn/internal/tasks/ui/TasksUiPlugin:getTaskDataManager ()Lorg/eclipse/mylyn/internal/tasks/core/data/TaskDataManager; // 106: aload_0 // 107: getfield 166 org/eclipse/mylyn/internal/tasks/ui/OpenRepositoryTaskJob:task Lorg/eclipse/mylyn/tasks/core/ITask; // 110: aload 4 // 112: iconst_1 // 113: invokevirtual 169 org/eclipse/mylyn/internal/tasks/core/data/TaskDataManager:putUpdatedTaskData (Lorg/eclipse/mylyn/tasks/core/ITask;Lorg/eclipse/mylyn/tasks/core/data/TaskData;Z)V // 116: invokestatic 181 org/eclipse/ui/PlatformUI:getWorkbench ()Lorg/eclipse/ui/IWorkbench; // 119: invokeinterface 187 1 0 // 124: new 77 org/eclipse/mylyn/internal/tasks/ui/OpenRepositoryTaskJob$2 // 127: dup // 128: aload_0 // 129: aload 4 // 131: invokespecial 172 org/eclipse/mylyn/internal/tasks/ui/OpenRepositoryTaskJob$2:<init> (Lorg/eclipse/mylyn/internal/tasks/ui/OpenRepositoryTaskJob;Lorg/eclipse/mylyn/tasks/core/data/TaskData;)V // 134: invokevirtual 180 org/eclipse/swt/widgets/Display:asyncExec (Ljava/lang/Runnable;)V // 137: goto +68 -> 205 // 140: invokestatic 181 org/eclipse/ui/PlatformUI:getWorkbench ()Lorg/eclipse/ui/IWorkbench; // 143: invokeinterface 187 1 0 // 148: new 78 org/eclipse/mylyn/internal/tasks/ui/OpenRepositoryTaskJob$3 // 151: dup // 152: aload_0 // 153: invokespecial 173 org/eclipse/mylyn/internal/tasks/ui/OpenRepositoryTaskJob$3:<init> (Lorg/eclipse/mylyn/internal/tasks/ui/OpenRepositoryTaskJob;)V // 156: invokevirtual 180 org/eclipse/swt/widgets/Display:asyncExec (Ljava/lang/Runnable;)V // 159: goto +46 -> 205 // 162: astore 4 // 164: invokestatic 181 org/eclipse/ui/PlatformUI:getWorkbench ()Lorg/eclipse/ui/IWorkbench; // 167: invokeinterface 187 1 0 // 172: new 79 org/eclipse/mylyn/internal/tasks/ui/OpenRepositoryTaskJob$4 // 175: dup // 176: aload_0 // 177: aload 4 // 179: invokespecial 174 org/eclipse/mylyn/internal/tasks/ui/OpenRepositoryTaskJob$4:<init> (Lorg/eclipse/mylyn/internal/tasks/ui/OpenRepositoryTaskJob;Lorg/eclipse/core/runtime/CoreException;)V // 182: invokevirtual 180 org/eclipse/swt/widgets/Display:asyncExec (Ljava/lang/Runnable;)V // 185: aload_1 // 186: invokeinterface 182 1 0 // 191: goto +20 -> 211 // 194: astore 5 // 196: aload_1 // 197: invokeinterface 182 1 0 // 202: aload 5 // 204: athrow // 205: aload_1 // 206: invokeinterface 182 1 0 // 211: getstatic 157 org/eclipse/core/runtime/Status:OK_STATUS Lorg/eclipse/core/runtime/IStatus; // 214: areturn // Line number table: // Java source line #89 -> byte code offset #0 // Java source line #90 -> byte code offset #11 // Java source line #91 -> byte code offset #28 // Java source line #92 -> byte code offset #32 // Java source line #107 -> byte code offset #51 // Java source line #110 -> byte code offset #55 // Java source line #112 -> byte code offset #68 // Java source line #113 -> byte code offset #80 // Java source line #114 -> byte code offset #85 // Java source line #115 -> byte code offset #103 // Java source line #116 -> byte code offset #116 // Java source line #146 -> byte code offset #140 // Java source line #152 -> byte code offset #162 // Java sour 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
|