Source Code Cross Referenced for ViewOptionPane.java in  » Swing-Library » jEdit » org » gjt » sp » jedit » options » 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 » jEdit » org.gjt.sp.jedit.options 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * ViewOptionPane.java - Editor window options
003:         * :tabSize=8:indentSize=8:noTabs=false:
004:         * :folding=explicit:collapseFolds=1:
005:         *
006:         * Copyright (C) 2003 Slava Pestov
007:         *
008:         * This program is free software; you can redistribute it and/or
009:         * modify it under the terms of the GNU General Public License
010:         * as published by the Free Software Foundation; either version 2
011:         * of the License, or any later version.
012:         *
013:         * This program is distributed in the hope that it will be useful,
014:         * but WITHOUT ANY WARRANTY; without even the implied warranty of
015:         * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
016:         * GNU General Public License for more details.
017:         *
018:         * You should have received a copy of the GNU General Public License
019:         * along with this program; if not, write to the Free Software
020:         * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
021:         */
022:
023:        package org.gjt.sp.jedit.options;
024:
025:        import javax.swing.border.*;
026:        import javax.swing.*;
027:        import java.awt.event.*;
028:        import java.awt.*;
029:        import org.gjt.sp.jedit.*;
030:
031:        public class ViewOptionPane extends AbstractOptionPane {
032:            //{{{ ViewOptionPane constructor
033:            public ViewOptionPane() {
034:                super ("view");
035:            } //}}}
036:
037:            //{{{ _init() method
038:            protected void _init() {
039:                /* View dock layout */
040:                layoutIcon1 = GUIUtilities.loadIcon("dock_layout1.png");
041:                layoutIcon2 = GUIUtilities.loadIcon("dock_layout2.png");
042:                layoutIcon3 = GUIUtilities.loadIcon("dock_layout3.png");
043:                layoutIcon4 = GUIUtilities.loadIcon("dock_layout4.png");
044:
045:                JPanel layoutPanel = new JPanel(new BorderLayout(12, 12));
046:
047:                if (jEdit.getBooleanProperty("view.docking.alternateLayout")) {
048:                    layout = new JLabel(
049:                            jEdit
050:                                    .getBooleanProperty("view.toolbar.alternateLayout") ? layoutIcon4
051:                                    : layoutIcon2);
052:                } else {
053:                    layout = new JLabel(
054:                            jEdit
055:                                    .getBooleanProperty("view.toolbar.alternateLayout") ? layoutIcon3
056:                                    : layoutIcon1);
057:                }
058:
059:                layout.setBorder(new EmptyBorder(12, 12, 12, 12));
060:                layoutPanel.add(BorderLayout.CENTER, layout);
061:
062:                JPanel buttons = new JPanel(new GridLayout(2, 1, 12, 12));
063:                buttons.setBorder(new EmptyBorder(0, 12, 12, 12));
064:                buttons.add(alternateDockingLayout = new JButton(jEdit
065:                        .getProperty("options.view.alternateDockingLayout")));
066:                ActionHandler actionHandler = new ActionHandler();
067:                alternateDockingLayout.addActionListener(actionHandler);
068:                buttons.add(alternateToolBarLayout = new JButton(jEdit
069:                        .getProperty("options.view.alternateToolBarLayout")));
070:                alternateToolBarLayout.addActionListener(actionHandler);
071:                layoutPanel.add(BorderLayout.SOUTH, buttons);
072:
073:                TitledBorder border = new TitledBorder(jEdit
074:                        .getProperty("options.view.viewLayout"));
075:                border.setTitleJustification(TitledBorder.CENTER);
076:                layoutPanel.setBorder(border);
077:
078:                addComponent(layoutPanel);
079:
080:                /* Show full path */
081:                showFullPath = new JCheckBox(jEdit
082:                        .getProperty("options.view.showFullPath"));
083:                showFullPath.setSelected(jEdit
084:                        .getBooleanProperty("view.showFullPath"));
085:                addComponent(showFullPath);
086:
087:                /* Show search bar */
088:                showSearchbar = new JCheckBox(jEdit
089:                        .getProperty("options.view.showSearchbar"));
090:                showSearchbar.setSelected(jEdit
091:                        .getBooleanProperty("view.showSearchbar"));
092:                addComponent(showSearchbar);
093:
094:                /* Beep on search auto wrap */
095:                beepOnSearchAutoWrap = new JCheckBox(jEdit
096:                        .getProperty("options.view.beepOnSearchAutoWrap"));
097:                beepOnSearchAutoWrap.setSelected(jEdit
098:                        .getBooleanProperty("search.beepOnSearchAutoWrap"));
099:                addComponent(beepOnSearchAutoWrap);
100:
101:                /* Show buffer switcher */
102:                showBufferSwitcher = new JCheckBox(jEdit
103:                        .getProperty("options.view.showBufferSwitcher"));
104:                showBufferSwitcher.setSelected(jEdit
105:                        .getBooleanProperty("view.showBufferSwitcher"));
106:                addComponent(showBufferSwitcher);
107:                showBufferSwitcher.addActionListener(actionHandler);
108:
109:                /* Buffer switcher max row count */
110:                bufferSwitcherMaxRowCount = new JTextField(jEdit
111:                        .getProperty("bufferSwitcher.maxRowCount"));
112:                addComponent(
113:                        jEdit
114:                                .getProperty("options.view.bufferSwitcherMaxRowsCount"),
115:                        bufferSwitcherMaxRowCount);
116:                bufferSwitcherMaxRowCount.setEditable(showBufferSwitcher
117:                        .isSelected());
118:            } //}}}
119:
120:            //{{{ _save() method
121:            protected void _save() {
122:                jEdit.setBooleanProperty("view.docking.alternateLayout", layout
123:                        .getIcon() == layoutIcon2
124:                        || layout.getIcon() == layoutIcon4);
125:                jEdit.setBooleanProperty("view.toolbar.alternateLayout", layout
126:                        .getIcon() == layoutIcon3
127:                        || layout.getIcon() == layoutIcon4);
128:                jEdit.setBooleanProperty("view.showFullPath", showFullPath
129:                        .isSelected());
130:                jEdit.setBooleanProperty("view.showSearchbar", showSearchbar
131:                        .isSelected());
132:                jEdit.setBooleanProperty("search.beepOnSearchAutoWrap",
133:                        beepOnSearchAutoWrap.isSelected());
134:                jEdit.setBooleanProperty("view.showBufferSwitcher",
135:                        showBufferSwitcher.isSelected());
136:                jEdit.setProperty("bufferSwitcher.maxRowCount",
137:                        bufferSwitcherMaxRowCount.getText());
138:            } //}}}
139:
140:            //{{{ Private members
141:            private JLabel layout;
142:            private Icon layoutIcon1, layoutIcon2, layoutIcon3, layoutIcon4;
143:            private JButton alternateDockingLayout, alternateToolBarLayout;
144:            private JCheckBox showFullPath;
145:            private JCheckBox showSearchbar;
146:            private JCheckBox beepOnSearchAutoWrap;
147:            private JCheckBox showBufferSwitcher;
148:            private JTextField bufferSwitcherMaxRowCount;
149:
150:            //}}}
151:
152:            //{{{ ActionHandler class
153:            private class ActionHandler implements  ActionListener {
154:                public void actionPerformed(ActionEvent evt) {
155:                    if (evt.getSource() == alternateDockingLayout) {
156:                        if (layout.getIcon() == layoutIcon1)
157:                            layout.setIcon(layoutIcon2);
158:                        else if (layout.getIcon() == layoutIcon2)
159:                            layout.setIcon(layoutIcon1);
160:                        else if (layout.getIcon() == layoutIcon3)
161:                            layout.setIcon(layoutIcon4);
162:                        else if (layout.getIcon() == layoutIcon4)
163:                            layout.setIcon(layoutIcon3);
164:                    } else if (evt.getSource() == alternateToolBarLayout) {
165:                        if (layout.getIcon() == layoutIcon1)
166:                            layout.setIcon(layoutIcon3);
167:                        else if (layout.getIcon() == layoutIcon3)
168:                            layout.setIcon(layoutIcon1);
169:                        else if (layout.getIcon() == layoutIcon2)
170:                            layout.setIcon(layoutIcon4);
171:                        else if (layout.getIcon() == layoutIcon4)
172:                            layout.setIcon(layoutIcon2);
173:                    } else if (evt.getSource() == showBufferSwitcher) {
174:                        bufferSwitcherMaxRowCount
175:                                .setEditable(showBufferSwitcher.isSelected());
176:                    }
177:                }
178:            } //}}}
179:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.