Home » Modeling » GMF (Graphical Modeling Framework) » Sort/Filter Compartment Items...
Sort/Filter Compartment Items... [message #183283] |
Wed, 16 April 2008 16:39 |
Eclipse User |
|
|
|
Originally posted by: birar01.ca.com
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
|
|
| |
Re: Sort/Filter Compartment Items... [message #211413 is a reply to message #211375] |
Tue, 18 November 2008 11:02 |
Tatiana Fesenko Messages: 530 Registered: July 2009 |
Senior Member |
|
|
This is a multi-part message in MIME format.
----++Omea_Parts_Splitter.768377615031031
Content-Type: text/plain; charset=koi8-r
Content-Transfer-Encoding: quoted-printable
Hi=20Thomas,
The=20functionality=20works=20properly,=20though=20it=20coul d=20be=20documented=20better=2e=20It's=20used=20in=20UML2=20 Tools=20in=20order=20to=20implement=20DetailLevels=20( http://wiki=2eeclipse=2eorg/index=2ephp/MDT=5f1=2e0=5fNew=5f and=5fNoteworthy#Detail=5fLevels)=2e
How=20elements=20are=20filtered=20from=20compartment=20is=20 defined=20in=20XXXCompartmentEditPart#getChildrenFilteredBy( List=20filterKeys)=2e=20The=20method=20returns=20list=20of=2 0elements=20that=20will=20be=20hidden=20for=20a=20given=20fi lterKey=2e=20
The=20filter=20key=20should=20be=20set=20to=20a=20Node=2e=20 UML2=20Tools=20add=20filterKey=20using=20the=20following=20C ommand:
FilteringStyle=20style=20=3d=20(FilteringStyle)=20view=2eget Style(NotationPackage=2eeINSTANCE=2egetFilteringStyle());
List<EditElementCommand>=20result=20=3d=20new=20ArrayList<EditElementCommand >(2);
SetRequest=20setFilteringRequest=20=3d=20new=20SetRequest(ed itingDomain,=20style,=20NotationPackage=2eeINSTANCE=2egetFil teringStyle=5fFiltering(),=20Filtering=2eAUTOMATIC=5fLITERAL );
result=2eadd(new=20SetValueCommand(setFilteringRequest));
List<String>=20filteringKeys=20=3d=20new=20ArrayList<String >(1);
filteringKeys=2eadd(UMLDetailLevelService=2eFILTER=5fBY=5fVI SIBILITY);
SetRequest=20setKeysRequest=20=3d=20new=20SetRequest(editing Domain,=20style,=20NotationPackage=2eeINSTANCE=2egetFilterin gStyle=5fFilteringKeys(),=20filteringKeys);
result=2eadd(new=20SetValueCommand(setKeysRequest));
Thomas,=20you=20can=20find=20more=20implementation=20details =20in=20org=2eeclipse=2euml2=2ediagram=2eclazz=2edetails=2eA nalysisLevel=20class=2e=20=20I've=20attached=20a=20PSF=20fil e=20referencing=20the=20project=20containing=20the=20class=2 e
Best=20wishes,
Tanya=2e
>=20Hello=20community,
>=20
>=20has=20someone=20been=20able=20to=20implement=20this
>=20"SortFilterCompartmentItemsEditPolicy"-=20functionality=20properly?
> =20Given=20that=20there=20is=20very=20rare=20information=20o n=20how=20the=20abstract=20methods
>=20of=20the
> =20SortFilterContentEditPolicy=20are=20intended=20to=20be=20 implemented,=20it=20is
>=20quiet=20a
>=20hard=20task=2e
> =20After=20some=20trying=20out,=20I=20also=20realized,=20tha t=20the
> =20SortFilterCompartmentItemsEditPolicy=20must=20be=20subcla ssed=20as=20well=2e
>=20However,=20I=20am=20stuck=20on=20this=2e
> =20Any=20hint=20or=20even=20examples=20would=20be=20great=2e
>=20TIA=20&=20Regards
>=20Thomas
>=20"arvinder=20birdi"=20<birar01@ca=2ecom>=20schrieb=20im=20Newsbeitrag
>=20news:fu5a3s$t9$1@build=2eeclipse=2eorg=2e=2e=2e
>=20
>>=20Does=20anyone=20have=20this=20feature=20working?
>>=20
>>=20I=20found=20an=20old=20post=20titled=20"Re:=20Transaction=20problem=20with
>>=20SortFilterPage"=2e=20It=20referenced=20bugzilla=20154998
>>=20
>> =20I'm=20assuming=20the=20two=20editpolicies=20should=20be=2 0added=20like:
>> =20installEditPolicy(EditPolicyRoles=2eSORT=5fFILTER=5fROLE, =20new
>>=20SortFilterCompartmentItemsEditPolicy());
>>=20
>> =20installEditPolicy(EditPolicyRoles=2eSORT=5fFILTER=5fCONTE NT=5fROLE,=20new
>>=20SortFilterContentEditPolicy()=20{
>>=20
>>=20getContents()
>>=20
>>=20getCollectionColumns()
>>=20
>>=20}
>>=20
>> =20to=20the=20EditPart=20that=20extends=20ListCompartmentEdi tPart
>>=20
>> =20I'm=20not=20sure=20what=20getContents()=20and=20getCollec tionColumns()=20are
>>=20supposed=20to=20return=2e
>>=20
>> =20Should=20=20SortFilterElement=20wrap=20EditParts=20or=20V iewObjects?
>>=20
>>=20thanks,
>>=20
>>=20Arvinder
>>=20
----++Omea_Parts_Splitter.768377615031031
Content-Type: application/octet-stream; name="UML2Tools_detailLevels.psf"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="UML2Tools_detailLevels.psf"
PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4NCjxwc2Yg
dmVyc2lvbj0iMi4wIj4NCjxwcm92aWRlciBpZD0ib3JnLmVjbGlwc2UudGVh
bS5jdnMuY29yZS5jdnNuYXR1cmUiPg0KPHByb2plY3QgcmVmZXJlbmNlPSIx
LjAsOnBzZXJ2ZXI6YW5vbnltb3VzQGRldi5lY2xpcHNlLm9yZzovY3Zzcm9v
dC9tb2RlbGluZyxvcmcuZWNsaXBzZS5tZHQvb3JnLmVjbGlwc2UudW1sMnRv
b2xzL3BsdWdpbnMvb3JnLmVjbGlwc2UudW1sMi5kaWFncmFtLmNsYXp6LG9y
Zy5lY2xpcHNlLnVtbDIuZGlhZ3JhbS5jbGF6eiIvPg0KPHByb2plY3QgcmVm
ZXJlbmNlPSIxLjAsOnBzZXJ2ZXI6YW5vbnltb3VzQGRldi5lY2xpcHNlLm9y
ZzovY3Zzcm9vdC9tb2RlbGluZyxvcmcuZWNsaXBzZS5tZHQvb3JnLmVjbGlw
c2UudW1sMnRvb2xzL3BsdWdpbnMvb3JnLmVjbGlwc2UudW1sMi5kaWFncmFt
LmNvbW1vbixvcmcuZWNsaXBzZS51bWwyLmRpYWdyYW0uY29tbW9uIi8+DQo8
L3Byb3ZpZGVyPg0KPC9wc2Y+
----++Omea_Parts_Splitter.768377615031031--
|
|
|
Re: Sort/Filter Compartment Items... [message #211739 is a reply to message #211413] |
Fri, 21 November 2008 12:17 |
Thomas Beyer Messages: 47 Registered: July 2009 |
Member |
|
|
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@borland.com> schrieb im Newsbeitrag
news:6785c526711a8cb178ca6e8cfda@news.eclipse.org...
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@ca.com> schrieb im Newsbeitrag
> news:fu5a3s$t9$1@build.eclipse.org...
>
>> 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
>>
|
|
|
Goto Forum:
Current Time: Wed Feb 05 11:51:19 GMT 2025
Powered by FUDForum. Page generated in 0.04139 seconds
|