Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

first commit

  • Loading branch information...
commit 9cb2e11e6509c062fef74a9557c175b9b9b71b3b 0 parents
@ugosan authored
Showing with 629 additions and 0 deletions.
  1. +7 −0 .classpath
  2. +28 −0 .project
  3. +70 −0 .settings/org.eclipse.jdt.core.prefs
  4. +12 −0 META-INF/MANIFEST.MF
  5. BIN  bin/org/ugosan/eclipse/fullscreen/EscActionDelegate.class
  6. BIN  bin/org/ugosan/eclipse/fullscreen/FullScreenActionDelegate.class
  7. BIN  bin/org/ugosan/eclipse/fullscreen/FullScreenActivator.class
  8. BIN  bin/org/ugosan/eclipse/fullscreen/FullScreenPreferenceInitializer.class
  9. BIN  bin/org/ugosan/eclipse/fullscreen/FullScreenPreferencePage.class
  10. BIN  bin/org/ugosan/eclipse/fullscreen/Messages.class
  11. +3 −0  bin/org/ugosan/eclipse/fullscreen/messages.properties
  12. +2 −0  bin/org/ugosan/eclipse/fullscreen/messages_de_DE.properties
  13. +2 −0  bin/org/ugosan/eclipse/fullscreen/messages_zh_CN.properties
  14. +8 −0 build.properties
  15. +10 −0 plugin.properties
  16. +74 −0 plugin.xml
  17. +19 −0 plugin_de_DE.properties
  18. +19 −0 plugin_zh_CN.properties
  19. +54 −0 src/org/ugosan/eclipse/fullscreen/EscActionDelegate.java
  20. +53 −0 src/org/ugosan/eclipse/fullscreen/FullScreenActionDelegate.java
  21. +149 −0 src/org/ugosan/eclipse/fullscreen/FullScreenActivator.java
  22. +29 −0 src/org/ugosan/eclipse/fullscreen/FullScreenPreferenceInitializer.java
  23. +56 −0 src/org/ugosan/eclipse/fullscreen/FullScreenPreferencePage.java
  24. +27 −0 src/org/ugosan/eclipse/fullscreen/Messages.java
  25. +3 −0  src/org/ugosan/eclipse/fullscreen/messages.properties
  26. +2 −0  src/org/ugosan/eclipse/fullscreen/messages_de_DE.properties
  27. +2 −0  src/org/ugosan/eclipse/fullscreen/messages_zh_CN.properties
7 .classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.3"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
28 .project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.ugosan.eclipse.fullscreen</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
70 .settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,70 @@
+#Sat Aug 23 21:32:50 CEST 2008
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.1
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.3
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=ignore
+org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
+org.eclipse.jdt.core.compiler.problem.deprecation=warning
+org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
+org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
+org.eclipse.jdt.core.compiler.problem.discouragedReference=ignore
+org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=ignore
+org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
+org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled
+org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
+org.eclipse.jdt.core.compiler.problem.finalParameterBound=ignore
+org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
+org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
+org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
+org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
+org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore
+org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
+org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
+org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
+org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
+org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
+org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
+org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning
+org.eclipse.jdt.core.compiler.problem.nullReference=warning
+org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
+org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
+org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore
+org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore
+org.eclipse.jdt.core.compiler.problem.rawTypeReference=ignore
+org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore
+org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore
+org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
+org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
+org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
+org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
+org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
+org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=ignore
+org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
+org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
+org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=ignore
+org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.unusedImport=warning
+org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
+org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
+org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
+org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
+org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
+org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
+org.eclipse.jdt.core.compiler.source=1.3
12 META-INF/MANIFEST.MF
@@ -0,0 +1,12 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Fullscreen Plug-in
+Bundle-SymbolicName: org.ugosan.eclipse.fullscreen;singleton:=true
+Bundle-Version: 1.0.0
+Bundle-RequiredExecutionEnvironment: J2SE-1.3
+Bundle-Vendor: Ugo Sangiorgi and Daoen Pan
+Require-Bundle: org.eclipse.ui;bundle-version="3.4.0",
+ org.eclipse.core.runtime;bundle-version="3.4.0"
+Bundle-Localization: plugin
+Bundle-Activator: org.ugosan.eclipse.fullscreen.FullScreenActivator
+Bundle-ActivationPolicy: lazy
BIN  bin/org/ugosan/eclipse/fullscreen/EscActionDelegate.class
Binary file not shown
BIN  bin/org/ugosan/eclipse/fullscreen/FullScreenActionDelegate.class
Binary file not shown
BIN  bin/org/ugosan/eclipse/fullscreen/FullScreenActivator.class
Binary file not shown
BIN  bin/org/ugosan/eclipse/fullscreen/FullScreenPreferenceInitializer.class
Binary file not shown
BIN  bin/org/ugosan/eclipse/fullscreen/FullScreenPreferencePage.class
Binary file not shown
BIN  bin/org/ugosan/eclipse/fullscreen/Messages.class
Binary file not shown
3  bin/org/ugosan/eclipse/fullscreen/messages.properties
@@ -0,0 +1,3 @@
+FullScreenPreferencePage_0=Hide Menu Bar in Full Screen Mode
+FullScreenPreferencePage_1=Hide Status Bar in Full Screen Mode
+
2  bin/org/ugosan/eclipse/fullscreen/messages_de_DE.properties
@@ -0,0 +1,2 @@
+
+FullScreenPreferencePage_0 = Kein Menu Bar im Vollbild-Modus
2  bin/org/ugosan/eclipse/fullscreen/messages_zh_CN.properties
@@ -0,0 +1,2 @@
+
+FullScreenPreferencePage_0 = \u5168\u5C4F\u65F6\u9690\u85CF\u83DC\u5355\u680F
8 build.properties
@@ -0,0 +1,8 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ plugin.xml,\
+ plugin.properties,\
+ plugin_de_DE.properties,\
+ plugin_zh_CN.properties
10 plugin.properties
@@ -0,0 +1,10 @@
+fullScreen=&Full Screen
+fullScreenActionSet=Full Screen
+fullScreenActionSetDesc=Full screen support for eclipse
+fullScreenCommand=Full Screen
+fullScreenCommandDesc=set window full screen
+fullScreenPreferenceNode=Full Screen
+
+esc=Escape Full Screen
+escCommand=Exit Full Screen
+escCommandDesc=Exits full screen mode
74 plugin.xml
@@ -0,0 +1,74 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.2"?>
+<plugin>
+ <extension
+ point="org.eclipse.ui.actionSets">
+ <actionSet
+ description="%fullScreenActionSetDesc"
+ id="cn.pande.eclipsex.fullscreen.actionSet"
+ label="%fullScreenActionSet"
+ visible="true">
+ <action
+ class="org.ugosan.eclipse.fullscreen.FullScreenActionDelegate"
+ definitionId="cn.pande.eclipsex.fullscreen.fullscreenCommand"
+ id="cn.pande.eclipsex.fullscreen.fullscreenAction"
+ label="%fullScreen"
+ menubarPath="window/additions"
+ style="push">
+ </action>
+ <action
+ class="org.ugosan.eclipse.fullscreen.EscActionDelegate"
+ definitionId="cn.pande.eclipsex.fullscreen.escCommand"
+ id="cn.pande.eclipsex.fullscreen.escAction"
+ label="%esc"
+ style="push">
+ </action>
+ </actionSet>
+ </extension>
+ <extension
+ point="org.eclipse.ui.commands">
+ <command
+ categoryId="org.eclipse.ui.category.window"
+ description="%fullScreenCommandDesc"
+ id="cn.pande.eclipsex.fullscreen.fullscreenCommand"
+ name="%fullScreenCommand">
+ </command>
+ <command
+ categoryId="org.eclipse.ui.category.window"
+ description="%escCommandDesc"
+ id="cn.pande.eclipsex.fullscreen.escCommand"
+ name="%escCommand">
+ </command>
+ </extension>
+ <extension
+ point="org.eclipse.ui.bindings">
+ <key
+ commandId="cn.pande.eclipsex.fullscreen.fullscreenCommand"
+ contextId="org.eclipse.ui.contexts.window"
+ schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
+ sequence="M1+M3+Z">
+ </key>
+ <key
+ commandId="cn.pande.eclipsex.fullscreen.escCommand"
+ contextId="org.eclipse.ui.contexts.window"
+ schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
+ sequence="ESC">
+ </key>
+ </extension>
+ <extension
+ point="org.eclipse.ui.preferencePages">
+ <page
+ category="org.eclipse.ui.preferencePages.Workbench"
+ class="org.ugosan.eclipse.fullscreen.FullScreenPreferencePage"
+ id="cn.pande.eclipsex.fullscreen.fullScreenPage"
+ name="%fullScreenPreferenceNode">
+ </page>
+ </extension>
+ <extension
+ point="org.eclipse.core.runtime.preferences">
+ <initializer
+ class="org.ugosan.eclipse.fullscreen.FullScreenPreferenceInitializer">
+ </initializer>
+ </extension>
+
+</plugin>
19 plugin_de_DE.properties
@@ -0,0 +1,19 @@
+#Generated by ResourceBundle Editor (http://eclipse-rbe.sourceforge.net)
+
+esc = Vollbild entkommen
+
+escCommand = Vollbild entkommen
+
+escCommandDesc = Vollbild entkommen
+
+fullScreen = Vollbild
+
+fullScreenActionSet = Vollbild
+
+fullScreenActionSetDesc = Vollbild unterst\u00FCtzen
+
+fullScreenCommand = Vollbild
+
+fullScreenCommandDesc = Vollbild kommen
+
+fullScreenPreferenceNode = Vollbild
19 plugin_zh_CN.properties
@@ -0,0 +1,19 @@
+#Generated by ResourceBundle Editor (http://eclipse-rbe.sourceforge.net)
+
+esc = \u9000\u51FA\u5168\u5C4F
+
+escCommand = \u9000\u51FA\u5168\u5C4F
+
+escCommandDesc = \u9000\u51FA\u5168\u5C4F\u6A21\u5F0F
+
+fullScreen = \u5168\u5C4F
+
+fullScreenActionSet = \u5168\u5C4F
+
+fullScreenActionSetDesc = \u652F\u6301\u5168\u5C4F\u6A21\u5F0F\u7684Eclipse
+
+fullScreenCommand = \u5168\u5C4F
+
+fullScreenCommandDesc = \u8FDB\u5165\u5168\u5C4F\u6A21\u5F0F
+
+fullScreenPreferenceNode = \u5168\u5C4F
54 src/org/ugosan/eclipse/fullscreen/EscActionDelegate.java
@@ -0,0 +1,54 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Ugo Sangiorgi and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Ugo Sangiorgi <ugo.sangiorgi@gmail.com> - Initial contribution
+ * gr8vyguy <http://code.google.com/u/gr8vyguy/> - Original code
+ *******************************************************************************/
+package org.ugosan.eclipse.fullscreen;
+
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.IWorkbenchWindowActionDelegate;
+
+public class EscActionDelegate implements IWorkbenchWindowActionDelegate {
+
+ private IWorkbenchWindow window;
+
+ /*
+ * @see org.eclipse.ui.IWorkbenchWindowActionDelegate#dispose()
+ */
+ public void dispose() {
+ this.window = null;
+ }
+
+ /*
+ * @see org.eclipse.ui.IWorkbenchWindowActionDelegate#init(org.eclipse.ui.IWorkbenchWindow)
+ */
+ public void init(IWorkbenchWindow window) {
+ this.window = window;
+ }
+
+ /*
+ * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
+ */
+ public void run(IAction action) {
+ Shell mainShell = window.getShell();
+ if (mainShell.getFullScreen()) {
+ FullScreenActivator.getDefault().setFullScreen(mainShell, false);
+ }
+ }
+
+ /*
+ * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
+ */
+ public void selectionChanged(IAction action, ISelection selection) {
+ }
+
+}
53 src/org/ugosan/eclipse/fullscreen/FullScreenActionDelegate.java
@@ -0,0 +1,53 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Ugo Sangiorgi and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Ugo Sangiorgi <ugo.sangiorgi@gmail.com> - Initial contribution
+ * gr8vyguy <http://code.google.com/u/gr8vyguy/> - Original code
+ *******************************************************************************/
+package org.ugosan.eclipse.fullscreen;
+
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.IWorkbenchWindowActionDelegate;
+
+public class FullScreenActionDelegate implements IWorkbenchWindowActionDelegate {
+
+ private IWorkbenchWindow window;
+
+ /*
+ * @see org.eclipse.ui.IWorkbenchWindowActionDelegate#dispose()
+ */
+ public void dispose() {
+ this.window = null;
+ }
+
+ /*
+ * @see org.eclipse.ui.IWorkbenchWindowActionDelegate#init(org.eclipse.ui.IWorkbenchWindow)
+ */
+ public void init(IWorkbenchWindow window) {
+ this.window = window;
+ }
+
+ /*
+ * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
+ */
+ public void run(IAction action) {
+ Shell mainShell = window.getShell();
+ FullScreenActivator.getDefault().setFullScreen(mainShell,
+ !mainShell.getFullScreen());
+ }
+
+ /*
+ * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
+ */
+ public void selectionChanged(IAction action, ISelection selection) {
+ }
+
+}
149 src/org/ugosan/eclipse/fullscreen/FullScreenActivator.java
@@ -0,0 +1,149 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Ugo Sangiorgi and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Ugo Sangiorgi <ugo.sangiorgi@gmail.com> - Initial contribution
+ * gr8vyguy <http://code.google.com/u/gr8vyguy/> - Original code
+ *******************************************************************************/
+package org.ugosan.eclipse.fullscreen;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.preferences.InstanceScope;
+import org.eclipse.jface.action.IStatusLineManager;
+import org.eclipse.swt.widgets.Canvas;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.IActionBars;
+import org.eclipse.ui.IViewSite;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.IWorkbenchPartSite;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+import org.osgi.service.prefs.Preferences;
+
+public class FullScreenActivator extends AbstractUIPlugin {
+
+ public static final String ID = "org.ugosan.eclipse.fullscreen"; //$NON-NLS-1$
+ public static final String HIDE_MENU_BAR = "hide_menu_bar"; //$NON-NLS-1$
+ public static final String HIDE_STATUS_BAR = "hide_status_bar"; //$NON-NLS-1$
+
+ private static FullScreenActivator INSTANCE;
+ private Map controlLists;
+ private Map menuBars;
+
+ public static FullScreenActivator getDefault() {
+ return INSTANCE;
+ }
+
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ controlLists = new HashMap();
+ menuBars = new HashMap();
+ INSTANCE = this;
+ }
+
+ public void stop(BundleContext context) throws Exception {
+ INSTANCE = null;
+ controlLists.clear();
+ controlLists = null;
+ menuBars.clear();
+ menuBars = null;
+ super.stop(context);
+ }
+
+ /**
+ * Set the workbench window full screen state.
+ *
+ * @param window the workbench window
+ * @param fullScreen new full screen state
+ */
+ public void setFullScreen(Shell mainShell, boolean fullScreen) {
+ if (mainShell == null || mainShell.isDisposed())
+ return;
+
+ if (fullScreen) {
+ List controls = hideTrimControls(mainShell);
+ controlLists.put(mainShell, controls);
+ if (getHideMenuBar()) {
+ Menu menuBar = mainShell.getMenuBar();
+ mainShell.setMenuBar(null);
+ menuBars.put(mainShell, menuBar);
+ }
+
+ } else {
+ showTrimControls(mainShell);
+ controlLists.remove(mainShell);
+ Menu menuBar = mainShell.getMenuBar();
+ if (menuBar == null) {
+ menuBar = (Menu) menuBars.get(mainShell);
+ mainShell.setMenuBar(menuBar);
+ menuBars.remove(mainShell);
+ }
+ }
+
+ mainShell.setFullScreen(fullScreen);
+ mainShell.layout();
+ }
+
+ private void showTrimControls(Shell mainShell) {
+ List controls = (List) controlLists.get(mainShell);
+ if (controls != null) {
+ for (int i = 0; i < controls.size(); i++) {
+ Control control = (Control) controls.get(i);
+ control.setVisible(true);
+ }
+ }
+ }
+
+ private List hideTrimControls(Shell mainShell) {
+ List controls = new ArrayList();
+ Control[] children = mainShell.getChildren();
+ for (int i = 0; i < children.length; i++) {
+ Control child = children[i];
+ if (child.isDisposed() || !child.isVisible())
+ continue;
+ if (child.getClass().equals(Canvas.class))
+ continue;
+ if (child.getClass().equals(Composite.class))
+ continue;
+
+ // org.eclipse.jface.action.StatusLine is an internal class
+ //the only way to hide it is by getting its name in string form
+ //TODO: find a more elegant way to do fetch the status line
+ if (!getHideStatusBar() && child.getClass().toString().contains("StatusLine")){
+ child.setVisible(true);
+ }else{
+ child.setVisible(false);
+ }
+ controls.add(child);
+ }
+ return controls;
+ }
+
+ private boolean getHideMenuBar() {
+ Preferences preferences = Platform.getPreferencesService()
+ .getRootNode().node(InstanceScope.SCOPE).node(ID);
+ return preferences.getBoolean(HIDE_MENU_BAR, true);
+ }
+
+ private boolean getHideStatusBar() {
+ Preferences preferences = Platform.getPreferencesService()
+ .getRootNode().node(InstanceScope.SCOPE).node(ID);
+ return preferences.getBoolean(HIDE_STATUS_BAR, true);
+ }
+}
29 src/org/ugosan/eclipse/fullscreen/FullScreenPreferenceInitializer.java
@@ -0,0 +1,29 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Ugo Sangiorgi and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Ugo Sangiorgi <ugo.sangiorgi@gmail.com> - Initial contribution
+ * gr8vyguy <http://code.google.com/u/gr8vyguy/> - Original code
+ *******************************************************************************/
+package org.ugosan.eclipse.fullscreen;
+
+import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
+import org.eclipse.core.runtime.preferences.InstanceScope;
+import org.eclipse.ui.preferences.ScopedPreferenceStore;
+
+
+public class FullScreenPreferenceInitializer extends
+ AbstractPreferenceInitializer {
+
+ public void initializeDefaultPreferences() {
+ ScopedPreferenceStore preferences = new ScopedPreferenceStore(
+ new InstanceScope(), FullScreenActivator.ID);
+ preferences.setDefault(FullScreenActivator.HIDE_MENU_BAR, true);
+ preferences.setDefault(FullScreenActivator.HIDE_STATUS_BAR, true);
+ }
+
+}
56 src/org/ugosan/eclipse/fullscreen/FullScreenPreferencePage.java
@@ -0,0 +1,56 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Ugo Sangiorgi and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Ugo Sangiorgi <ugo.sangiorgi@gmail.com> - Initial contribution
+ * gr8vyguy <http://code.google.com/u/gr8vyguy/> - Original code
+ *******************************************************************************/
+package org.ugosan.eclipse.fullscreen;
+
+import java.io.IOException;
+
+import org.eclipse.core.runtime.preferences.InstanceScope;
+import org.eclipse.jface.preference.BooleanFieldEditor;
+import org.eclipse.jface.preference.FieldEditorPreferencePage;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPreferencePage;
+import org.eclipse.ui.preferences.ScopedPreferenceStore;
+
+public class FullScreenPreferencePage extends FieldEditorPreferencePage
+ implements IWorkbenchPreferencePage {
+
+ private ScopedPreferenceStore preferences;
+
+ public FullScreenPreferencePage() {
+ super(GRID);
+ preferences = new ScopedPreferenceStore(new InstanceScope(),
+ FullScreenActivator.ID);
+ setPreferenceStore(preferences);
+ }
+
+ protected void createFieldEditors() {
+ BooleanFieldEditor boolEditor = new BooleanFieldEditor(
+ FullScreenActivator.HIDE_MENU_BAR,
+ Messages.FullScreenPreferencePage_0, getFieldEditorParent());
+ addField(boolEditor);
+ BooleanFieldEditor boolEditor_status = new BooleanFieldEditor(
+ FullScreenActivator.HIDE_STATUS_BAR,
+ Messages.FullScreenPreferencePage_1, getFieldEditorParent());
+ addField(boolEditor_status);
+ }
+
+ public void init(IWorkbench workbench) {
+ }
+
+ public boolean performOk() {
+ try {
+ preferences.save();
+ } catch (IOException e) {
+ }
+ return super.performOk();
+ }
+}
27 src/org/ugosan/eclipse/fullscreen/Messages.java
@@ -0,0 +1,27 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Ugo Sangiorgi and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Ugo Sangiorgi <ugo.sangiorgi@gmail.com> - Initial contribution
+ * gr8vyguy <http://code.google.com/u/gr8vyguy/> - Original code
+ *******************************************************************************/
+package org.ugosan.eclipse.fullscreen;
+
+import org.eclipse.osgi.util.NLS;
+
+public class Messages extends NLS {
+ private static final String BUNDLE_NAME = "cn.pande.eclipsex.fullscreen.internal.messages"; //$NON-NLS-1$
+ public static String FullScreenPreferencePage_0;
+ public static String FullScreenPreferencePage_1;
+ static {
+ // initialize resource bundle
+ NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+ }
+
+ private Messages() {
+ }
+}
3  src/org/ugosan/eclipse/fullscreen/messages.properties
@@ -0,0 +1,3 @@
+FullScreenPreferencePage_0=Hide Menu Bar in Full Screen Mode
+FullScreenPreferencePage_1=Hide Status Bar in Full Screen Mode
+
2  src/org/ugosan/eclipse/fullscreen/messages_de_DE.properties
@@ -0,0 +1,2 @@
+
+FullScreenPreferencePage_0 = Kein Menu Bar im Vollbild-Modus
2  src/org/ugosan/eclipse/fullscreen/messages_zh_CN.properties
@@ -0,0 +1,2 @@
+
+FullScreenPreferencePage_0 = \u5168\u5C4F\u65F6\u9690\u85CF\u83DC\u5355\u680F
Please sign in to comment.
Something went wrong with that request. Please try again.