Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
Difference between revisions of "Mylyn/Porting Guide"
< Mylyn
(→Context Framework) |
m (sorting changes only) |
||
Line 30: | Line 30: | ||
** moved from <code>org.eclipse.mylar.context.core</code> to <code>org.eclipse.mylar.core</code> | ** moved from <code>org.eclipse.mylar.context.core</code> to <code>org.eclipse.mylar.core</code> | ||
− | == Tasks | + | == Tasks API == |
− | * <code> | + | * <code>AbstractRepositoryConnector</code> |
− | ** | + | ** + getLastSyncTimestamp(TaskRepository repository, Set<AbstractRepositoryTask> changedTasks) (may change as part of [https://bugs.eclipse.org/bugs/show_bug.cgi?id=176934 bug#176934]) |
+ | ** <code>getSupportedVersions()</code> has been removed ([https://bugs.eclipse.org/bugs/show_bug.cgi?id=176815 #1768159]) | ||
− | * <code> | + | * <code>AbstractRepositoryConnectorUi</code> |
− | ** | + | ** <code>openRemoteTask(String repositoryUrl, String id)</code>: removed, this method no longer needs to be implemented by the connector. Instead classes can rely on the new <code>openRepositoryTask(..)</code> method, and override it if necessary. |
− | ** | + | ** getRepositoryUrl and all ID/URL methods: now final, change via setters |
+ | ** + findHyperlinks(...) override to detect hyperlinks in editors | ||
− | * <code> | + | *<code>AbstractRepositorySettingsPage</code> validation changes. |
− | ** <code> | + | **<code>setNeedsValidation(boolean needsValidation)</code> if true validate button will be visible |
− | + | **<code>getValidator(TaskRepository repository)</code> return an instance of <code>Validator</code>. | |
− | ** <code> | + | |
− | * <code> | + | * <code>AbstractRepositoryTaskEditor</code> |
− | ** | + | **<code>attributeChanged()</code> Anything that needs to be saved must be in attribute form and passed to this method. Most if this is all done for you but if you override AbstractRepositoryTaskEditor.createCustomAttributeLayout() then you will want to ensure that attributeChanged is called upon editing. Utility method createTextField() handles this call. |
− | + | ** <code>createLabel()</code> Utility method added. It will put an '*' at the front of the label if the attribute has been modified. Eventually this will be applied upon editing but currently only happens after re-freshing or re-opening the editor. | |
− | ** | + | ** <code>SECTION_NAME</code> is an enum that holds default titles for the default sections. To override these default titles, set the appropriate (SECTION_NAME, new name) in <code>alternateSectionLabels</code> on <code>AbstractRepositoryTaskEditor</code>. |
− | ** ( | + | ** <code>updateEditor()</code> refreshes editor with new input in-place. |
+ | |||
+ | * <code>AbstractRepositoryQuery</code> | ||
+ | ** Constrctor no longer takes number of hits. Connectors can use QueryHitCollector.MAX_HITS (currently 5000) when setting max number of hits to return. | ||
* <code>AbstractRepositoryTask</code> .....''updates in progress'' | * <code>AbstractRepositoryTask</code> .....''updates in progress'' | ||
Line 60: | Line 64: | ||
** with: | ** with: | ||
ITask task = TasksUiPlugin.getTaskListManager().getTaskList().getTask(repository.getUrl(), taskId); | ITask task = TasksUiPlugin.getTaskListManager().getTaskList().getTask(repository.getUrl(), taskId); | ||
− | |||
− | |||
− | |||
* <code>AbstractQueryHit</code> | * <code>AbstractQueryHit</code> | ||
** <code>setDescription(..)</code> renamed to <code>setSummary(..)</code> | ** <code>setDescription(..)</code> renamed to <code>setSummary(..)</code> | ||
− | * <code> | + | *<code> AttributeContainer</code> |
− | ** <code> | + | **<code>getAttributeFactory()</code> new method |
− | + | ||
− | + | ||
− | * <code> | + | * <code>DateRangeContainer</code> |
− | ** | + | ** getChildren() now returns set of underlying task objects (not DateRangeActivityDelegates which will be deprecated) |
− | ** | + | ** getDateRangeDelegates() returns the delegate formerly returned by getChildren() |
* <code>ITaskListElement</code>: now extends <code>java.lang.Comparable</code>, so Collections support of sorting can be used, since task list elements have a natural ordering. Default implementations are provided for tasks and containers. ([https://bugs.eclipse.org/bugs/show_bug.cgi?id=171590 bug 171590]) | * <code>ITaskListElement</code>: now extends <code>java.lang.Comparable</code>, so Collections support of sorting can be used, since task list elements have a natural ordering. Default implementations are provided for tasks and containers. ([https://bugs.eclipse.org/bugs/show_bug.cgi?id=171590 bug 171590]) | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
* <code>ITaskDataHandler</code> | * <code>ITaskDataHandler</code> | ||
Line 101: | Line 84: | ||
** <code>getDateForAttributeType(...)</code> moved to <code>AbstractAttributeFactory</code> | ** <code>getDateForAttributeType(...)</code> moved to <code>AbstractAttributeFactory</code> | ||
− | *<code> | + | * <code>ITaskListExternalizer</code> |
− | **<code> | + | ** <code>readTask(..)</code> renamed to <code>createTask(..)</code>, no longer needs to set taskId, label, or repositoryUrl |
− | + | * <code>DelegatingTaskExternalizer</code> | |
− | + | ** <code>readTaskInfo(..)</code> and <code>readQueryHitInfo(..)</code> are now called automatically and are private. Use your <code>createTask(..)</code> or <code>createQueryHit(..)</code> methods to customize reading additional attributes. | |
− | + | ||
− | + | ||
− | **<code> | + | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
* <code>TaskRepository</code> | * <code>TaskRepository</code> | ||
Line 124: | Line 97: | ||
** <code>updateOfflineState</code> is now <code>saveIncoming</code> and <code>saveOutgoing</code>. | ** <code>updateOfflineState</code> is now <code>saveIncoming</code> and <code>saveOutgoing</code>. | ||
** <code>discardOutgoing</code> discards any pending outgoing changes | ** <code>discardOutgoing</code> discards any pending outgoing changes | ||
+ | |||
+ | * <code>RepositoryTaskAttribute</code> | ||
+ | ** getID() -> getId() | ||
+ | |||
+ | *<code>RepositoryTaskData</code> | ||
+ | **constructor now requires a task kind (string) (i.e. <code>Task.DEFAULT_TASK_KIND</code>) | ||
+ | **<code>getTaskKind</code> return the task kind | ||
+ | **<code>setNew(boolean)</code> '''signifies that this is unsubmitted task data. Used by editor factory to determine if existing or new editor to be opened'''. | ||
+ | |||
+ | * <code>Task</code> .....''updates in progress'' | ||
+ | ** <code>getTooltipText()</code>: deleted, not used | ||
+ | ** Due dates are now supported <code>getDueDate(), setDueDate()</code> | ||
+ | ** handleIdentifier: now private | ||
+ | ** get/setUrl are now get/setTaskUrl (to disambiguate with get/setRepositoryUrl()) | ||
+ | ** (-) <code>getElapsedTime()</code> | ||
+ | ** (-) <code>setElapsedTime()</code> | ||
* <code>TaskEditor</code> | * <code>TaskEditor</code> | ||
** <code>protected void pageChange(intNewPageIndex)</code> method removed (only called super) | ** <code>protected void pageChange(intNewPageIndex)</code> method removed (only called super) | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
* <code>TaskList</code> | * <code>TaskList</code> | ||
** <code>getChangeListeners()</code>: returns a <code>Set</code> instead of <code>List</code> | ** <code>getChangeListeners()</code>: returns a <code>Set</code> instead of <code>List</code> | ||
+ | |||
+ | * <code>TaskListImages</code> | ||
+ | ** renamed to <code>TasksUiImages</code> (still an internal class, should move to API) | ||
* <code>TaskListManager</code> | * <code>TaskListManager</code> | ||
** <code>setDueDate()</code> used to set due date on a task and cause notification of local info changed. | ** <code>setDueDate()</code> used to set due date on a task and cause notification of local info changed. | ||
** <code>isDue(ITask)</code> true if task's due date isn't null and date has past | ** <code>isDue(ITask)</code> true if task's due date isn't null and date has past | ||
+ | |||
+ | * <code>TasksUiUtil</code> | ||
+ | ** <code>openUrl(String url)</code>: moved to <code>openBrowser(String url)</code> | ||
+ | |||
+ | * <code>QueryHitCollector</code> | ||
+ | ** MAX_HITS constant can be used as standard default number of hits handled per query. User notified when >= hits returned. | ||
== Context Framework == | == Context Framework == |
Revision as of 19:48, 10 April 2007
This document will have Mylar 2.0 specific API changes added to it as we make them. If interested in keeping up with these changes we suggest setting a watch for this page.
Contents
Porting from Mylar 1.0 to 2.0
Pending Changes
The following changes are being considered but not yet implemented.
-
TaskRepository
:- rename
getKind()
togetConnectorKind()
- Make class FINAL
- rename
-
AbstractRepositoryConnector
:- rename
createTaskFromExistingKey(..)
toaddExistingTask(..)
- rename getRepositoryType() to getConnectorKind()
- rename
-
AbstractRepositoryTask
- rename getRepositoryKind() to getConnectorKind()
Task
- renamte getRepositoryKind() to getConnectorKind()
-
IRepositoryConstants
- rename PROPERTY_KIND to PROPERTY_CONNECTOR_KIND
General
- All library dependencies have moved
-
MylarStatusHandler
andIStatusHandler
- moved from
org.eclipse.mylar.context.core
toorg.eclipse.mylar.core
- moved from
Tasks API
-
AbstractRepositoryConnector
- + getLastSyncTimestamp(TaskRepository repository, Set<AbstractRepositoryTask> changedTasks) (may change as part of bug#176934)
-
getSupportedVersions()
has been removed (#1768159)
-
AbstractRepositoryConnectorUi
-
openRemoteTask(String repositoryUrl, String id)
: removed, this method no longer needs to be implemented by the connector. Instead classes can rely on the newopenRepositoryTask(..)
method, and override it if necessary. - getRepositoryUrl and all ID/URL methods: now final, change via setters
- + findHyperlinks(...) override to detect hyperlinks in editors
-
AbstractRepositorySettingsPage
validation changes.setNeedsValidation(boolean needsValidation)
if true validate button will be visiblegetValidator(TaskRepository repository)
return an instance ofValidator
.
-
AbstractRepositoryTaskEditor
attributeChanged()
Anything that needs to be saved must be in attribute form and passed to this method. Most if this is all done for you but if you override AbstractRepositoryTaskEditor.createCustomAttributeLayout() then you will want to ensure that attributeChanged is called upon editing. Utility method createTextField() handles this call.-
createLabel()
Utility method added. It will put an '*' at the front of the label if the attribute has been modified. Eventually this will be applied upon editing but currently only happens after re-freshing or re-opening the editor. -
SECTION_NAME
is an enum that holds default titles for the default sections. To override these default titles, set the appropriate (SECTION_NAME, new name) inalternateSectionLabels
onAbstractRepositoryTaskEditor
. -
updateEditor()
refreshes editor with new input in-place.
-
AbstractRepositoryQuery
- Constrctor no longer takes number of hits. Connectors can use QueryHitCollector.MAX_HITS (currently 5000) when setting max number of hits to return.
-
AbstractRepositoryTask
.....updates in progress- getIdLabel() -> getTasKey()
- constructor changed
- getLastRefreshTimeInMinutes(Date) removed
- no more static methods (use RepositoryTaskHandleUtil)
- Replace this idiom:
String handleIdentifier = AbstractRepositoryTask.getHandle(repository.getUrl(), taskId); ITask task = TasksUiPlugin.getTaskListManager().getTaskList().getTask(handle);
- with:
ITask task = TasksUiPlugin.getTaskListManager().getTaskList().getTask(repository.getUrl(), taskId);
-
AbstractQueryHit
-
setDescription(..)
renamed tosetSummary(..)
-
AttributeContainer
getAttributeFactory()
new method
-
DateRangeContainer
- getChildren() now returns set of underlying task objects (not DateRangeActivityDelegates which will be deprecated)
- getDateRangeDelegates() returns the delegate formerly returned by getChildren()
-
ITaskListElement
: now extendsjava.lang.Comparable
, so Collections support of sorting can be used, since task list elements have a natural ordering. Default implementations are provided for tasks and containers. (bug 171590)
-
ITaskDataHandler
-
getChangedSinceLastSync()
method moved toAbstractRepositoryConnector
- New comment now held in an attribute:
RepositoryTaskAttribute.COMMENT_NEW
will need to update handler and factory to produce connector specific attribute -
initializeTaskData(TaskRepository repository, RepositoryTaskData data, IProgressMonitor monitor)
called by NewTaskWizard to initialize new taskData objects (currently only in use by Trac but will adopt). -
getAttributeFactory(String repositoryUrl, String repositoryKind, String taskKind)
signature changed -
getDateForAttributeType(...)
moved toAbstractAttributeFactory
-
-
ITaskListExternalizer
-
readTask(..)
renamed tocreateTask(..)
, no longer needs to set taskId, label, or repositoryUrl
-
-
DelegatingTaskExternalizer
-
readTaskInfo(..)
andreadQueryHitInfo(..)
are now called automatically and are private. Use yourcreateTask(..)
orcreateQueryHit(..)
methods to customize reading additional attributes.
-
-
TaskRepository
- TaskRepository.isAnonymous()
- TaskRepository.setAnonymous(boolean)
- (-) TaskRepository.getDefaultProxy() (Renamed and moved to WebClientUtil.getPlatformProxy())
- RepositorySynchronizationManager
-
updateOfflineState
is nowsaveIncoming
andsaveOutgoing
. -
discardOutgoing
discards any pending outgoing changes
-
-
RepositoryTaskAttribute
- getID() -> getId()
RepositoryTaskData
- constructor now requires a task kind (string) (i.e.
Task.DEFAULT_TASK_KIND
) getTaskKind
return the task kindsetNew(boolean)
signifies that this is unsubmitted task data. Used by editor factory to determine if existing or new editor to be opened.
- constructor now requires a task kind (string) (i.e.
-
Task
.....updates in progress-
getTooltipText()
: deleted, not used - Due dates are now supported
getDueDate(), setDueDate()
- handleIdentifier: now private
- get/setUrl are now get/setTaskUrl (to disambiguate with get/setRepositoryUrl())
- (-)
getElapsedTime()
- (-)
setElapsedTime()
-
-
TaskEditor
-
protected void pageChange(intNewPageIndex)
method removed (only called super)
-
-
TaskList
-
getChangeListeners()
: returns aSet
instead ofList
-
-
TaskListImages
- renamed to
TasksUiImages
(still an internal class, should move to API)
- renamed to
-
TaskListManager
-
setDueDate()
used to set due date on a task and cause notification of local info changed. -
isDue(ITask)
true if task's due date isn't null and date has past
-
-
TasksUiUtil
-
openUrl(String url)
: moved toopenBrowser(String url)
-
-
QueryHitCollector
- MAX_HITS constant can be used as standard default number of hits handled per query. User notified when >= hits returned.
Context Framework
-
AbstractContextStore
-
notifyContextStoreMoved()
: change tocontextStoreMoved()
-
-
AbstractContextStructureBridge
-
getDegreesOfSeparation()
: moved toAbstractRelationProvider
-
getRelationshipProviders()
: moved to extensions point, e.g.:
-
<extension point="org.eclipse.mylar.context.core.bridges"> <relationProvider class="org.eclipse.mylar.internal.java.search.JavaImplementorsProvider" contentType="java"/> </extension>
Monitor Framework
MylarMonitorUiPlugin
- (-) setInactivityTimeout(...)
-
org.eclipse.mylar.monitor
: split intomonitor.core
andmonitor.ui
, organize imports and update extension point IDs -
HandleObfuscator
- moved to
InteractionEventObfuscator
- moved to
-
org.eclipse.mylar.monitor.usage.core
andorg.eclipse.mylar.monitor.usage.ui
- moved to
..mylar.monitor.core
,..mylar.monitor.usage
and..mylar.monitor.usage.internal
- moved to