More on extending Pollo
Al Byers <[email protected]> Wed, 26 Feb 2003 15:26:10 -0700
| Newsgroups | gmane.editors.pollo.devel |
|---|---|
| Message-ID | <[email protected]> |
This is a multi-part message in MIME format. --Boundary_(ID_ZIc+9rtb9I24daeehrUG6g) Content-type: text/plain; charset=us-ascii; format=flowed Content-transfer-encoding: 7BIT I have greatly refactored my AG101 product (http://ag101.sourceforge.net, but the changes are not up there) so that it requires the fewest possible changes to Pollo base code. I have attached a document with those changes. They are mostly changes to permissions and adding noarg constructors so that things can be extended. The biggest architectural problem for me was that fact that PolloFrame instantiates Pollo in its declarations. I ended up passing the instance of Pollo (or its subclass) to PolloFrame (or its subclass), but there is probably a better way. I hope that there is enough interest to make Pollo extensible, for I believe it has a lot of potential in that area. There is certainly nothing in the open source world that has its kind of functionality. -Al -- Al Byers Automation Groups Inc 777 S. State St. Orem, UT 84058 801.400.5111 http://www.automationgroups.com [email protected] We're "Open for Business" (http://www.ofbiz.org) - the leader in Java-based Web services development tools --Boundary_(ID_ZIc+9rtb9I24daeehrUG6g) Content-type: text/plain; name=ambchanges.txt Content-transfer-encoding: 7BIT Content-disposition: inline; filename=ambchanges.txt ./org/outerj/pollo/Pollo.java:46: public Pollo() // -amb Need to inherit? Was private. ./org/outerj/pollo/Pollo.java:305: public Action getNewPolloFrameAction() // -amb Calling it from frame ./org/outerj/pollo/PolloFrame.java:49: protected Pollo pollo = null; // was ->Pollo.getInstance(); This seems to be the most disruptive change. Pollo being instantiated in the class declaration does not give it a change to be something else. I felt it was better to pass the instance of Pollo in, but, perhaps, Pollo could be instantiated within the constructor with a call to Pollo.getInstance(). This is assuming that Pollo or a subclass has already been instantiated and the Pollo.instance var has been set. ./org/outerj/pollo/PolloFrame.java:144: viewMenu.add(Utilities.createMenuItemFromAction(Pollo.getInstance().getNewPolloFrameAction())); // -amb ./org/outerj/pollo/action/NewPolloFrameAction.java:18: protected Pollo pollo; // -amb If PolloFrame does not automatically have a value of Pollo instantiated, then this action must have one embedded so that it can pass it to the PolloFrame constructor. ./org/outerj/pollo/action/NewPolloFrameAction.java:20: public NewPolloFrameAction(Pollo inst) // -amb Needs Pollo instance. See above. ./org/outerj/pollo/action/NewPolloFrameAction.java:22: pollo = inst; // -amb ./org/outerj/pollo/config/ViewTypeConf.java:150: public ArrayList getSchemas(){ // -amb Need to access schemas from outside. ./org/outerj/pollo/EditorPanelImpl.java:80: public EditorPanelImpl(){ // -amb Allows subclassing without calling createMenus, etc. ./org/outerj/pollo/xmleditor/XmlEditor.java:356: public void rebuildView() // -amb This and some other methods that deal with the view need to be callable from my XSL debugging code. For instance, once the program stops at a stylesheet node, I need to be able to tell the XmlEditor to rebuild that view as the highlighted one. ./org/outerj/pollo/xmleditor/XmlEditor.java:410: protected void createViewsRecursive(Node parentNode, View parentView) // -amb See above. ./org/outerj/pollo/xmleditor/XmlEditorPanel.java:51: public XmlEditorPanel(){ // -amb Necessary inorder to subclass ./org/outerj/pollo/xmleditor/attreditor/AttributesTableModel.java:97: public TempAttrEditInfo getTempAttrEditInfo(int row) // -amb Changed from protected so I can call it from AttributesPanel. I use this to determine schema node type (I think). ./org/outerj/pollo/xmleditor/attreditor/AttributesTableModel.java:290: public class TempAttrEditInfo //-amb Was protected. I made it public. ./org/outerj/pollo/xmleditor/chardataeditor/CharDataPanel.java:94: public JTextArea getCharTextArea(){ //-amb Added to get access to charDataTextArea. There are simply places where I need to control what shows in the attributes panel. ./org/outerj/pollo/xmleditor/model/XmlModel.java:751: public void setCurrentMode(int md) // -amb Need to set mode from outside for XSL debugging purpose ./org/outerj/pollo/xmleditor/model/XmlModel.java:756: public void setDocument(Document doc){ // -amb Need to set document from outside for XSL debugging purpose ./org/outerj/pollo/xmleditor/view/ChildrenBlockView.java:24: protected ArrayList childViewList = new ArrayList(10); //-amb, was private, but I need to define subclasses of ElementBlockView so I can put a "break" component on it. ./org/outerj/pollo/xmleditor/view/ChildrenBlockView.java:42: public ArrayList getChildViewList(){ // -amb, too inconvenient not to have this ./org/outerj/pollo/xmleditor/view/ElementBlockView.java:270: protected int max(int val1, int val2, int val3) //-amb Was private, but I created a subclass of ElementBlockView. --Boundary_(ID_ZIc+9rtb9I24daeehrUG6g)-- ------------------------------------------------------- This SF.net email is sponsored by: Scholarships for Techies! Can't afford IT training? All 2003 ictp students receive scholarships. Get hands-on training in Microsoft, Cisco, Sun, Linux/UNIX, and more. www.ictp.com/training/sourceforge.asp