Source Code Cross Referenced for XInplaceEditorExample.java in  » Swing-Library » wings3 » org » wingx » example » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Swing Library » wings3 » org.wingx.example 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * $Id: TextComponentExample.java 2750 2006-08-02 08:10:54Z hengels $
003:         * Copyright 2006 wingS development team.
004:         *
005:         * This file is part of wingS (http://wingsframework.org).
006:         *
007:         * wingS is free software; you can redistribute it and/or modify
008:         * it under the terms of the GNU Lesser General Public License
009:         * as published by the Free Software Foundation; either version 2.1
010:         * of the License, or (at your option) any later version.
011:         *
012:         * Please see COPYING for the complete licence.
013:         */
014:
015:        package org.wingx.example;
016:
017:        import java.awt.event.ActionEvent;
018:        import java.awt.event.ActionListener;
019:        import org.wings.SButton;
020:        import org.wings.SComponent;
021:        import org.wings.SForm;
022:        import org.wings.SGridLayout;
023:        import org.wings.SIcon;
024:        import org.wings.SLabel;
025:        import org.wings.SPanel;
026:        import org.wings.STextField;
027:        import org.wings.SURLIcon;
028:        import org.wings.plaf.WingSetExample;
029:        import org.wings.border.SLineBorder;
030:        import org.wings.event.SDocumentEvent;
031:        import org.wings.event.SDocumentListener;
032:        import org.wingx.XInplaceEditor;
033:
034:        /**
035:         * Example demonstrating the use of component XInplaceEditor.
036:         * @author Christian Schyma
037:         */
038:        public class XInplaceEditorExample implements  WingSetExample {
039:            private final String someText = "\"There is a theory which states that if anybody ever discovers "
040:                    + "exactly what the Universe is for and why it is here, it will "
041:                    + "instantly disappear and be replaced by something even more "
042:                    + "bizarre and inexplicable. There is another theory which states "
043:                    + "that this has already happened.\" \n-- Douglas Adams";
044:
045:            private final SIcon HZ_PICTURE = new SURLIcon(
046:                    "../icons/Hohenzollern.jpg");
047:            private SForm form;
048:
049:            public void activateExample() {
050:                SLabel picture = new SLabel(HZ_PICTURE);
051:                XInplaceEditor pictureDescription = new XInplaceEditor(
052:                        "click here to give me a name!", 49, 1);
053:
054:                SPanel picturePanel = new SPanel(new SGridLayout(1));
055:                picturePanel.add(picture);
056:                picturePanel.add(pictureDescription);
057:
058:                final XInplaceEditor editor = new XInplaceEditor(someText, 80,
059:                        2);
060:                editor.addAjaxDocumentListener(new SDocumentListener() {
061:                    public void changedUpdate(SDocumentEvent e) {
062:                    }
063:
064:                    public void insertUpdate(SDocumentEvent e) {
065:                        e.getDocument()
066:                                .setText(
067:                                        e.getDocument().getText().replaceAll(
068:                                                "foo", ""));
069:                    }
070:
071:                    public void removeUpdate(SDocumentEvent e) {
072:                    }
073:                });
074:
075:                final STextField rowsTextField = new STextField("2");
076:                final STextField colsTextField = new STextField("80");
077:
078:                SButton saveChanges = new SButton("apply changes");
079:                saveChanges.addActionListener(new ActionListener() {
080:                    public void actionPerformed(ActionEvent e) {
081:                        editor.setRows(Integer
082:                                .parseInt(rowsTextField.getText()));
083:                        editor.setCols(Integer
084:                                .parseInt(colsTextField.getText()));
085:                    }
086:                });
087:
088:                SPanel configPanel = new SPanel(new SGridLayout(2));
089:                configPanel.setBorder(new SLineBorder(1));
090:                configPanel.add(new SLabel(
091:                        "In-Place Editor configuration of above example"));
092:                configPanel.add(saveChanges);
093:                configPanel.add(new SLabel("# rows:"));
094:                configPanel.add(rowsTextField);
095:                configPanel.add(new SLabel("# cols:"));
096:                configPanel.add(colsTextField);
097:
098:                SGridLayout gridLayout = new SGridLayout(1);
099:                gridLayout.setHgap(10);
100:                gridLayout.setVgap(20);
101:                form = new SForm(gridLayout);
102:                form.add(picturePanel);
103:                form.add(editor);
104:                form.add(configPanel);
105:            }
106:
107:            public void passivateExample() {
108:                //To change body of implemented methods use File | Settings | File Templates.
109:            }
110:
111:            public SComponent getExample() {
112:                return form;
113:            }
114:
115:            public String getExampleName() {
116:                return "XInplaceEditor";
117:            }
118:
119:            public String getExampleGroup() {
120:                return "Experiment";
121:            }
122:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.