Skip to main content

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.

Jump to: navigation, search

Difference between revisions of "Mylyn/Refactoring"

(Task Data)
(Mylar Task Model)
Line 49: Line 49:
 
== Mylar Task Model ==
 
== Mylar Task Model ==
  
Make this model explicit and define it in terms of Java classes. Accessor methods should mirror fields available on AbstractRepositoryTask. This could be separate from the offline storage so connectors without a TaskDataHandler could provide attachment support.
+
Make this model explicit and define it in terms of Java classes. ''Accessor methods should mirror fields available on AbstractRepositoryTask.'' This could be separate from the offline storage so connectors without a TaskDataHandler could provide attachment support.
  
 
  RepositoryTaskData {
 
  RepositoryTaskData {
  boolean isNew
+
    get/set methods for mylar specific access 
  String description
+
  String summary
+
  String newComment
+
  String[] cc
+
  String[] addCC
+
  String[] removeCC
+
 
  }
 
  }
  
 
  RepositoryTaskComment {
 
  RepositoryTaskComment {
 +
  RepositoryTaskAttribute connectorSpecificAtrtibute;
 +
  getAttribute(); // returns connectorSpecificAttribute;
 +
  get/set methods for mylar specific values
 
   String author
 
   String author
 
   Date created
 
   Date created
 
   ...
 
   ...
 
  }
 
  }
 +
RepositoryTaskCommnets should be retrieved from proxy (ITaskDataHandler)
 +
Suggest we have setter methods for values used by abstract editor.
  
  RepositoryTaskAttachment {
+
  RepositoryAttachment {
 
   String filename
 
   String filename
 
   String description
 
   String description
 
   ...
 
   ...
 
  }
 
  }
 +
RepositoryAttachments should be retrieved from proxy (ITaskDataHandler)
  
 
  RepositoryTaskOperation {
 
  RepositoryTaskOperation {
 
   ...
 
   ...
 
  }
 
  }
 
+
Retrieved from ITaskDataHandler (provided with RepositoryTaskData)
 
+
  
 
== Editor/UI ==
 
== Editor/UI ==

Revision as of 14:35, 15 May 2007

Requirements

  • Persistence
    • Provide a generic API for storing task attributes
  • Configuration extraction
  • Presenation api

API

Task Data

ITaskDataManager {
  TaskDataState getTaskDataState(String repositoryUrl, String id);
  void saveTaskDataState(TaskDataState taskState);
  void refactorRepositoryUrl(String oldUrl, String newUrl);
  void removeTaskDataState(String repositoryUrl, String id);
  void saveNewTaskDataState(TaskDataState newTaskDataState);  // (rfc) Sets unique new id
  Set<TaskDataState> getNewTaskDataState(String repositoryUrl); // (rfc)
}


  • TaskDataState created via ITaskDataHandler.buildTaskDataState(RepositoryTaskData newData, RepositoryTaskData oldData, Set<RepositoryTaskAttribute> edits);
  • TaskDataState is an unmodifiable object but not final.
TaskDataState {
   public TaskDataState(RepositoryTaskData newTaskData, RepositoryTaskData oldTaskData, Set<RepositoryTaskAttribute> edits);  // Constructor sets values but does not do computation
   public init();  // Perform constructor specific initialization (i.e. calc changed attributes etc)
   RepositoryTaskData newTaskData;
   RepositoryTaskData oldTaskData;
   Set<RepositoryTaskAttribute> edits;
   isStateModified();
   hasIncomingChanges();
   hasChanged(RepositoryTaskAttribute attribute);
   Set<RepositoryTaskAttribute> getChanged();
   void discardEdits(String repositoryUrl, String id);
}

Task Attributes

RepositoryTaskAttribute {
 boolean isModified()
 boolean hasIncomingChanges()
 void write(IMemento)
 void read(IMemento)
}


Mylar Task Model

Make this model explicit and define it in terms of Java classes. Accessor methods should mirror fields available on AbstractRepositoryTask. This could be separate from the offline storage so connectors without a TaskDataHandler could provide attachment support.

RepositoryTaskData {
   get/set methods for mylar specific access  
}
RepositoryTaskComment {
 RepositoryTaskAttribute connectorSpecificAtrtibute;
 getAttribute(); // returns connectorSpecificAttribute;
 get/set methods for mylar specific values
 String author
 Date created
 ...
}
RepositoryTaskCommnets should be retrieved from proxy (ITaskDataHandler)
Suggest we have setter methods for values used by abstract editor.
RepositoryAttachment {
 String filename
 String description
 ...
}
RepositoryAttachments should be retrieved from proxy (ITaskDataHandler)
RepositoryTaskOperation {
 ...
}
Retrieved from ITaskDataHandler (provided with RepositoryTaskData)

Editor/UI

Connectors provide a factory for UI representation of attributes:

AbstractConnectorUi {
 abstract ITaskUiFactory getTaskUiFactory()
}
ITaskUiFactory {
 String getLabel(RepositoryTaskAttribute attr)
 Control createEditor(RepositoryTaskAttribute attr, Composite parent)
 String getToolTip(RepositoryTaskAttribute attr)
}

Mylar provides default implementations to create an editor for an attribute:

MylarEditorFactory {
 Control createComboEditor(RepositoryTaskAttribute attr, Composite parent, String[] options);
}

Back to the top