Bug #4093

allow kepler to use OS specific UI elements

Added by Chad Berkley over 13 years ago. Updated over 13 years ago.

build system
Target version:
Start date:
Due date:
% Done:


Estimated time:


I've implemented an extension point in kepler to allow us to build OS specific UI tweaks into kepler without breaking the build on other OS. Any module can now have a modules-info/osextension.txt file. The file has two properties: an OS that the extension runs on and a class that implements org.kepler.OSExtension. The interface OSExtension has only one method addOSExtensions() which allows the implementing class to do any tweaks necessary at startup time.

The example use case is for OSX. We want kepler to look like a native OSX application. The only way to do that is to use some OSX specific classes that do not exist on windows or linux (hence any classes that depend on those break the build for other OSs). The way this now works is there is a suite called kepler-mac which has the same modules as kepler, but adds the appleExtension module. The appleExtension module includes an implementation of OSExtension plus the osextension.txt file. The osextension.txt file looks like this:

os=Mac OS X

When Kepler starts up, it checks all modules for the osextension.txt file. It then looks at the current OS to see if the name java returns matches the OS name in osextension.txt. If it does, it attempts to load the class defined in the .txt file and run the addOSExtensions() method.

If you want to use the mac osx extensions, simply do 'ant change-to -Dsuite=kepler-mac' and re-compile. You should see the native OSX menu bar instead of the normal java one.

Additional tasks for the OSX extension is to add the about box into the Applicaiton menu and to make the apple-q ask if you want to save before terminating. Also need to fix the icon in the dock.


#1 Updated by Chad Berkley over 13 years ago

fixed the about box. fixed apple-q. The icon shown is now the java icon. Will try to get the kepler icon to work.

#2 Updated by Chad Berkley over 13 years ago

fixed. osx kepler now has a new icon set that fit the standard osx icon sizes. please open new bugs for any new Mac OSX issues you find.

#3 Updated by Redmine Admin over 9 years ago

Original Bugzilla ID was 4093

Also available in: Atom PDF