1 19 20 package org.netbeans.core.windows.view.ui.toolbars; 21 22 import java.awt.event.ActionEvent ; 23 import java.util.concurrent.Callable ; 24 import javax.swing.AbstractAction ; 25 import org.openide.filesystems.FileObject; 26 import org.openide.filesystems.FileSystem; 27 import org.openide.filesystems.Repository; 28 import org.openide.util.NbBundle; 29 30 34 public class ResetToolbarsAction extends AbstractAction { 35 36 37 public ResetToolbarsAction() { 38 super( NbBundle.getMessage(ResetToolbarsAction.class, "CTL_ResetToolbarsAction") ); } 40 41 public void actionPerformed(ActionEvent e) { 42 FileSystem fs = Repository.getDefault().getDefaultFileSystem(); 43 FileObject fo = fs.findResource( "Toolbars" ); Object attr = fo.getAttribute( "removeWritables" ); if( null != attr && attr instanceof Callable ) { 46 try { 47 ((Callable )attr).call(); 48 } catch (Exception ex) { 49 ex.printStackTrace(); 51 } 52 } 53 ToolbarConfiguration.resetToolbarIconSize(); 54 } 55 56 } 57 | Popular Tags |