Details
-
Type:
Sub-task
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: None
-
Labels:None
-
Acceptance Test - Add?:No
-
- SPARK-1403.patch
- 07/05/11 09:54 AM
- 71 kB
- Mircea Carasel
-
Hide
- testPlugin.jar
- 07/05/11 10:22 AM
- 9 kB
- Mircea Carasel
-
- lib/plugin-classes.jar 9 kB
- plugin.xml 0.3 kB
Activity
The attached test plugin contains example on how to extend ContactItem through plugin
commited: r12581 = 7de4cd9aa842418178f0280ccf9c5e473671e0f8
1. It introduces a component registry (UIComponentRegistry.java) that offer the possibility for plugin to replace some default components with their own instances
By default Spark implementation are going to be used
Spark classes that can be replaced:
private static Class<? extends ContactItem> contactItemClass = ContactItem.class;
private static Class<? extends ContactInfoWindow> contactInfoWindowClass = ContactInfoWindow.class;
private static Class<? extends ContactGroup> contactGroupClass = ContactGroup.class;
private static Class<? extends ContactList> contactListClass = ContactList.class;
private static Class<? extends StatusBar> statusBarClass = StatusBar.class;
private static Class<? extends CommandPanel> commandPanelClass = CommandPanel.class;
private static Class<? extends SparkTabbedPane> workspaceTabPaneClass = SparkTabbedPane.class;
private static Class<? extends LoginDialog> loginDialogClass = LoginDialog.class;
private static Class<? extends ThemePanel> themePanelClass = ThemePanel.class;
private static Class<? extends ConferenceServices> conferenceServicesClass = ConferenceServices.class;
2. It also contains changes in Spark code to support such mechanism, separates a bit UI building from business login
and exposes some UI elements through protected get/set methods
Example on how a plugin can register its own ContactItem implementation:
public class TestPlugin implements Plugin {
public TestPlugin()
{ UIComponentRegistry.registerContactItem(TestContactItem.class); }....
}
where TestContactItem extends Spark ContactItem:
public class TestContactItem extends ContactItem
{ ... }Phase2:
commited: r12582 = ac966579032b14d708e5cafb625c25a1d5691a80
-Chat and Group Chat changes to support extension through plugin
-created ButtonFactory class responsible with button creations and use it when needed
-UIComponentRegistry is imporved with Chat/GroupCHat registration capabilities
Phase3:
commited: r12583 = c3b1aadf13de5dbb9649868cf12b786174324b9c
-LoginDialog: put username, password, serverName protected get/set methods
-some more get/set methods to expose UI objects
Phase 4:
commited: r12585 = 547e12fda2fa7f16a428a579b33e67510289f755
-GroupChatParticipantList - exposed some fields(protected get methods) and changed some methods from private to protected
-LoginDialog - introduced afterLogin method that does nothing but can be overwritten by subclasses - it is automatically
called after successful login. It is useful when subclasses would like to do some additional settings after login
-created new protected method to retrieve _usernames
commited
r12590 = eb8c807a7f5e25d45af0454395ee16b4f888e8f5
-fix concurency problem in Spark.java
-fix potential Null Pointer Exception in EmoticonManager that may occur when no emoticon package is installed
-expose setText method of JTextPanel functionality in ChatArea (the original is overwritted) to offer the posibility to
inject different Document (HTMLDocument) for Spark TranscriptWindow
commited
r12591 = c1c382df83fa3f1edbf7b84f1ba8a0ab27854a8c
Add eZuce copyright for the new classes
commited
r12592 = aed1f9dec3aca5bd320e4b8a3c45650b9b161abd
make emoticon button icon overridable from plugin
commited
r12594 = 3c0b73c19b25d627c07e21cb3e81802b2cfcfae2
Set message attributes before insertMessage is called - this is useful when transcript window is extended and insertMessage overwritten,
since more information will be available to be displayed for the chat area Document
commited
r12595 = 98a72d7504ae54f566dbce57f889ce729631fbed
make ConferenceServices.getDefaultBookmark protected so it can be overwritten in subclasses
This is a huge rework that is very much welcome. Can you ensure that the community get's some documentation about the capabilities introduced by your changes?
commited
r12839 = cc70289f32e5767add260d7ab0b60199acd4d92c
Settings, tema, register group chat buttons creations are moved to ButtonFactory
window on top chat button creation moved to ButtonFactory
this permits the ability to override UI from plugin
make RolloverButton's decorate method protected
commited
r12842 = 361088d5e6bdfd0d8caf415cc91ed632716d0a82
OTR Plugin - use addComponent from TranscriptWindow for inserting UI panel, instead of duplicating code
-make sure to scrollToBottom after adding OTR UI panel in Transcript window
-make sure to scrollToBottom when message is received in GroupChat
NOTE: scrollToBottom call should be redesigned - to avoid calling it every time a message/component is sent/received
We should develop notify mechanism to trigger scrollToBottom in one single place when message/component is sent/received
commited
r12867 = c36c985912825d81429299353cd81e93e8999fba
SparkTransferManager.java: use TranscriptWindow.addComponent instead of duplicating code
Walter,
I am thinking to close this issue (SPARK-1403) and propose it for Spark 2.7.0 release - what do you think?
I will write some docs by then...
Hi Mircea, if you are happy with the features you have put into it, you should close it. I propose that we let 2.7.0 bake as beta1 in the community a bit.
I mark the ticket as resolved. For any new improvements on this field, also based on community testing, will open new tickets.
commited
r12889 = 7f7e22bef522aba34e863e0186f940570e6ec7fd
SPARK-1403: create dedicate, overridable method for Connection configuration creation
r12898 = 57cd94cf227245a709c9a17794db858278b7d2c4
move OTR button creation in ButtonFactory
commited
r12923 = c346206b38338c06cfef3faee8d51e65162c7dd0
create utility method in VCardManager to load personal vcard
Attached patch description
1. It introduces a component registry (UIComponentRegistry.java) that offer the possibility for plugin to replace some default components with their own instances
By default Spark implementation are going to be used
Spark classes that can be replaced:
+ private static Class<? extends ContactItem> contactItemClass = ContactItem.class;
+ private static Class<? extends ContactInfoWindow> contactInfoWindowClass = ContactInfoWindow.class;
+ private static Class<? extends ContactGroup> contactGroupClass = ContactGroup.class;
+ private static Class<? extends ContactList> contactListClass = ContactList.class;
+ private static Class<? extends StatusBar> statusBarClass = StatusBar.class;
+ private static Class<? extends CommandPanel> commandPanelClass = CommandPanel.class;
+ private static Class<? extends SparkTabbedPane> workspaceTabPaneClass = SparkTabbedPane.class;
+ private static Class<? extends LoginDialog> loginDialogClass = LoginDialog.class;
+ private static Class<? extends ThemePanel> themePanelClass = ThemePanel.class;
+ private static Class<? extends ConferenceServices> conferenceServicesClass = ConferenceServices.class;
2. It also contains minor changes in Spark code to support such mechanism
Example on how a plugin can register its own ContactItem implementation:
public class TestPlugin implements Plugin {
public TestPlugin()
{ UIComponentRegistry.registerContactItem(TestContactItem.class); }....
}
where TestContactItem extends Spark ContactItem:
public class TestContactItem extends ContactItem
{ ... }