[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.modeling.gmf] Re: Sort/Filter Compartment Items...

Hello Tatiana,

thank you very much for your detailed information.
My focus was targeted more against the sort functionality.
I am trying to implement some native functionality like in ms excel -> right 
click -> sort by -> select a column (resp. an attribute) and gmf is doing 
the rest. The result shoul be, that the notation as well as the domain model 
lists are updated accordingly. I am trying to use this for 
listcompartmenteditparts.
Haven't been successfull so far.
Do you also haven some suggestions to achieve this?

TIA & Regards
Thomas



"Tatiana Fesenko" <tatiana.fesenko@xxxxxxxxxxx> schrieb im Newsbeitrag 
news:6785c526711a8cb178ca6e8cfda@xxxxxxxxxxxxxxxxxxx
Hi Thomas,

The functionality works properly, though it could be documented better. It's 
used in UML2 Tools in order to implement DetailLevels 
(http://wiki.eclipse.org/index.php/MDT_1.0_New_and_Noteworthy#Detail_Levels).

How elements are filtered from compartment is defined in 
XXXCompartmentEditPart#getChildrenFilteredBy(List filterKeys). The method 
returns list of elements that will be hidden for a given filterKey.
The filter key should be set to a Node. UML2 Tools add filterKey using the 
following Command:

FilteringStyle style = (FilteringStyle) 
view.getStyle(NotationPackage.eINSTANCE.getFilteringStyle());
List<EditElementCommand> result = new ArrayList<EditElementCommand>(2);

SetRequest setFilteringRequest = new SetRequest(editingDomain, style, 
NotationPackage.eINSTANCE.getFilteringStyle_Filtering(), 
Filtering.AUTOMATIC_LITERAL);
result.add(new SetValueCommand(setFilteringRequest));

List<String> filteringKeys = new ArrayList<String>(1);
filteringKeys.add(UMLDetailLevelService.FILTER_BY_VISIBILITY);
SetRequest setKeysRequest = new SetRequest(editingDomain, style, 
NotationPackage.eINSTANCE.getFilteringStyle_FilteringKeys(), filteringKeys);
result.add(new SetValueCommand(setKeysRequest));

Thomas, you can find more implementation details in 
org.eclipse.uml2.diagram.clazz.details.AnalysisLevel class.  I've attached a 
PSF file referencing the project containing the class.

Best wishes,
Tanya.

> Hello community,
>
> has someone been able to implement this
> "SortFilterCompartmentItemsEditPolicy"- functionality properly?
> Given that there is very rare information on how the abstract methods
> of the
> SortFilterContentEditPolicy are intended to be implemented, it is
> quiet a
> hard task.
> After some trying out, I also realized, that the
> SortFilterCompartmentItemsEditPolicy must be subclassed as well.
> However, I am stuck on this.
> Any hint or even examples would be great.
> TIA & Regards
> Thomas
> "arvinder birdi" <birar01@xxxxxx> schrieb im Newsbeitrag
> news:fu5a3s$t9$1@xxxxxxxxxxxxxxxxxxxx
>
>> Does anyone have this feature working?
>>
>> I found an old post titled "Re: Transaction problem with
>> SortFilterPage". It referenced bugzilla 154998
>>
>> I'm assuming the two editpolicies should be added like:
>> installEditPolicy(EditPolicyRoles.SORT_FILTER_ROLE, new
>> SortFilterCompartmentItemsEditPolicy());
>>
>> installEditPolicy(EditPolicyRoles.SORT_FILTER_CONTENT_ROLE, new
>> SortFilterContentEditPolicy() {
>>
>> getContents()
>>
>> getCollectionColumns()
>>
>> }
>>
>> to the EditPart that extends ListCompartmentEditPart
>>
>> I'm not sure what getContents() and getCollectionColumns() are
>> supposed to return.
>>
>> Should  SortFilterElement wrap EditParts or ViewObjects?
>>
>> thanks,
>>
>> Arvinder
>>