Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 364126 - Make GaServiceImpl extensible
Summary: Make GaServiceImpl extensible
Status: CLOSED FIXED
Alias: None
Product: Graphiti
Classification: Modeling
Component: Core (show other bugs)
Version: 0.8.0   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: 0.9.0   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard: Juno M6 Theme_round_offs
Keywords:
Depends on:
Blocks:
 
Reported: 2011-11-18 04:41 EST by Karsten Thoms CLA
Modified: 2012-06-29 04:19 EDT (History)
1 user (show)

See Also:
michael.wenz: juno+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Karsten Thoms CLA 2011-11-18 04:41:54 EST
I would like to overwrite some behavior of GaServiceImpl by subclassing it without the need to provide a complete copy of the class.

Unfortunately, the class is final. Please make the class non-final and just set methods that are not intended to be overwritten to final.

Especially I want to have influence on default text attributes without the need to set its attributes or style afterwards. The methods
  setDefaultTextAttributes
  setDefaultGraphicsAlgorithmValues
should thus be protected and non-final.
Comment 1 Michael Wenz CLA 2011-11-22 11:05:02 EST
Influenceing the default text is a reasonable request and should be opened up. On the other hand we need also to make sure that we do not complicate stuff for the default usecase and the case of using styles. Needs some closer look to ensure that.
Comment 2 Michael Wenz CLA 2012-03-15 12:27:51 EDT
I have move GaServiceImpl to an API package and opened it up for subclassing. Since I don't think that besides the 2 methods you mentioned there is anything that's needed to be changed by clients, I made all methods final except for the 2 you requested for change. Opening up lateron in case of need is of course still an option.
You are now free to create an instance of a subclass of the Graphiti services class, but you are responsible by yourself for the creation of that class and how you make it available for usage throughout your tool.

Checked-in and pushed to Eclipse:
commit 4c4be0c960a6affa3cfd82061969cdc6601a51c2
Author: mwenz <michael.wenz@sap.com> 2012-03-15 17:14:28
Committer: mwenz <michael.wenz@sap.com> 2012-03-15 17:14:28
Parent: 48900bb913c380a8ff8d0a2704d6b79244262b6d (Corrected merge error)
Branches: origin/master, master
Comment 3 Michael Wenz CLA 2012-03-20 09:36:07 EDT
Corrected milestone: it's part of M6, not M5
Comment 4 Michael Wenz CLA 2012-04-11 10:53:15 EDT
Bookkeeping: Set target release
Comment 5 Michael Wenz CLA 2012-06-29 04:19:48 EDT
Part of Graphiti 0.9.0 (Eclipse Juno)