|
What this is
Other links
The source code/* * Sun Public License Notice * * The contents of this file are subject to the Sun Public License * Version 1.0 (the "License"). You may not use this file except in * compliance with the License. A copy of the License is available at * http://www.sun.com/ * * The Original Code is NetBeans. The Initial Developer of the Original * Code is Sun Microsystems, Inc. Portions Copyright 1997-2004 Sun * Microsystems, Inc. All Rights Reserved. */ package org.netbeans.modules.editor; import java.awt.Component; import java.awt.event.ActionEvent; import javax.swing.Action; import javax.swing.ActionMap; import javax.swing.ImageIcon; import javax.swing.JEditorPane; import javax.swing.JMenu; import javax.swing.JMenuItem; import javax.swing.JPopupMenu; import javax.swing.text.Document; import javax.swing.text.JTextComponent; import javax.swing.text.Keymap; import org.netbeans.editor.BaseAction; import org.netbeans.editor.BaseKit; import org.netbeans.editor.Settings; import org.netbeans.editor.SettingsNames; import org.netbeans.editor.Utilities; import org.openide.cookies.EditorCookie; import org.openide.loaders.DataObject; import org.openide.util.HelpCtx; import org.openide.util.NbBundle; import org.openide.util.actions.Presenter; import org.openide.util.actions.SystemAction; /** * Code Folding action displayed under Menu/View/ * * @author Martin Roskanin */ public class NbCodeFoldingAction extends GlobalContextAction implements Presenter.Menu{ /** Creates a new instance of NbCodeFoldingAction */ public NbCodeFoldingAction() { } public final HelpCtx getHelpCtx() { return HelpCtx.DEFAULT_HELP; } public String getName() { return NbBundle.getBundle(NbCodeFoldingAction.class).getString( "Menu/View/CodeFolds"); //NOI18N } public void resultChanged(org.openide.util.LookupEvent ev) { } public boolean isEnabled() { return false; } /** Get a menu item that can present this action in a {@link javax.swing.JMenu}. * @return the representation for this action */ public JMenuItem getMenuPresenter(){ return new CodeFoldsMenu(getName()); } private static JTextComponent getComponent(){ return Utilities.getFocusedComponent(); } public void actionPerformed (java.awt.event.ActionEvent ev){ } private BaseKit getKit(){ JTextComponent component = getComponent(); return (component == null) ? BaseKit.getKit(NbEditorKit.class) : Utilities.getKit(component); } private static Object getSettingValue(BaseKit kit, String settingName) { return Settings.getValue(kit.getClass(), settingName); } /** Get the value of the boolean setting from the |
... this post is sponsored by my books ... | |
#1 New Release! |
FP Best Seller |
Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.
A percentage of advertising revenue from
pages under the /java/jwarehouse
URI on this website is
paid back to open source projects.