Source Code Cross Referenced for MacOSPlugin.java in  » Swing-Library » jEdit » jars » MacOS » macos » 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 » jars.MacOS.macos 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /* 
002:         * :tabSize=8:indentSize=8:noTabs=false:
003:         * :folding=explicit:collapseFolds=1:
004:         *
005:         * MacOSPlugin.java - Main class Mac OS Plugin
006:         * Copyright (C) 2001, 2002 Kris Kopicki
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 macos;
024:
025:        //{{{ Imports
026:        import java.util.Vector;
027:        import javax.swing.*;
028:        import org.gjt.sp.jedit.*;
029:        import org.gjt.sp.jedit.gui.*;
030:        import org.gjt.sp.jedit.msg.*;
031:        import org.gjt.sp.util.Log;
032:        import macos.menu.*;
033:        import macos.script.*;
034:        import com.apple.cocoa.application.*;
035:        import com.apple.eawt.Application;
036:
037:        //}}}
038:
039:        public class MacOSPlugin extends EBPlugin {
040:            //{{{ Variables
041:            static boolean started = false;
042:            private boolean osok;
043:            private Delegate delegate;
044:
045:            //}}}
046:
047:            //{{{ start() method
048:            public void start() {
049:                if (osok = osok()) {
050:                    delegate = new Delegate();
051:                    NSApplication app = NSApplication.sharedApplication();
052:
053:                    Macros.registerHandler(new AppleScriptHandler());
054:                    Application app2 = new Application();
055:                    app2.addApplicationListener(delegate);
056:                    app2.setEnabledPreferencesMenu(true);
057:                    app2.setEnabledAboutMenu(true);
058:
059:                    app.setDelegate(delegate);
060:                    //app.setServicesProvider(delegate);
061:                }
062:            } //}}}
063:
064:            //{{{ handleMessage() method
065:            public void handleMessage(EBMessage message) {
066:                if (osok) {
067:                    // Set type/creator codes for files
068:                    if (message instanceof  BufferUpdate)
069:                        delegate.handleFileCodes((BufferUpdate) message);
070:                    else if (message instanceof  PropertiesChanged) {
071:                        boolean b = jEdit
072:                                .getBooleanProperty(
073:                                        "MacOSPlugin.useSelection",
074:                                        jEdit
075:                                                .getBooleanProperty("MacOSPlugin.default.useSelection"));
076:                        if (b)
077:                            jEdit.setColorProperty("view.selectionColor",
078:                                    UIManager.getColor("textHighlight"));
079:                    }
080:                    // This is necessary to have a file opened from the Finder
081:                    // before jEdit is running set as the currently active
082:                    // buffer.
083:                    else if (!started && message instanceof  ViewUpdate)
084:                        delegate.handleOpenFile((ViewUpdate) message);
085:                }
086:            }//}}}
087:
088:            //{{{ osok() method
089:            private boolean osok() {
090:                final String osname = jEdit
091:                        .getProperty("MacOSPlugin.depend.os.name");
092:                final String mrjversion = jEdit
093:                        .getProperty("MacOSPlugin.depend.mrj.version");
094:
095:                if (!System.getProperty("os.name").equals(osname)) {
096:                    // According to Slava this is better
097:                    Log.log(Log.ERROR, this , jEdit
098:                            .getProperty("MacOSPlugin.dialog.osname.message"));
099:                    return false;
100:                }
101:                if (MiscUtilities.compareStrings(System
102:                        .getProperty("mrj.version"), mrjversion, false) < 0) {
103:                    SwingUtilities.invokeLater(new Runnable() {
104:                        public void run() {
105:                            GUIUtilities.error(null,
106:                                    "MacOSPlugin.dialog.mrjversion",
107:                                    new Object[] { mrjversion });
108:                        }
109:                    });
110:                    return false;
111:                }
112:
113:                return true;
114:            }//}}}
115:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.