diff options
Diffstat (limited to 'demos/org.eclipse.fx.demo.contacts.app/src/org/eclipse/fx/demo/contacts/handlers/SwitchThemeHandler.java')
-rwxr-xr-x | demos/org.eclipse.fx.demo.contacts.app/src/org/eclipse/fx/demo/contacts/handlers/SwitchThemeHandler.java | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/demos/org.eclipse.fx.demo.contacts.app/src/org/eclipse/fx/demo/contacts/handlers/SwitchThemeHandler.java b/demos/org.eclipse.fx.demo.contacts.app/src/org/eclipse/fx/demo/contacts/handlers/SwitchThemeHandler.java new file mode 100755 index 000000000..7cc4b6a17 --- /dev/null +++ b/demos/org.eclipse.fx.demo.contacts.app/src/org/eclipse/fx/demo/contacts/handlers/SwitchThemeHandler.java @@ -0,0 +1,29 @@ +/******************************************************************************* + * Copyright (c) 2010 BestSolution.at 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: + * Tom Schindl <tom.schindl@bestsolution.at> - initial API and implementation + * Kai T��dter - Adoption to contacts demo + ******************************************************************************/ +package org.eclipse.fx.demo.contacts.handlers; + +import javax.inject.Named; + +import org.eclipse.e4.core.di.annotations.Execute; +import org.eclipse.e4.core.di.annotations.Optional; +import org.eclipse.fx.ui.services.theme.ThemeManager; + +@SuppressWarnings("restriction") +public class SwitchThemeHandler { + @Execute + public void switchTheme(@Named("contacts.commands.switchtheme.themeid") String themeId, + @Optional ThemeManager themeManager) { + if (themeManager != null) { + themeManager.setCurrentThemeId(themeId); + } + } +}
\ No newline at end of file |