1 20 package org.apache.directory.ldapstudio.schemas.controller.actions; 21 22 23 import org.apache.directory.ldapstudio.schemas.Activator; 24 import org.apache.directory.ldapstudio.schemas.Messages; 25 import org.apache.directory.ldapstudio.schemas.PluginConstants; 26 import org.eclipse.jface.action.Action; 27 import org.eclipse.jface.viewers.TreeViewer; 28 import org.eclipse.ui.plugin.AbstractUIPlugin; 29 30 31 37 public class HideObjectClassesAction extends Action 38 { 39 40 public static final String HIDE_OBJECT_CLASSES_DS_KEY = HideObjectClassesAction.class.getName() 41 + ".dialogsettingkey"; 43 44 private TreeViewer viewer; 45 46 47 53 public HideObjectClassesAction( TreeViewer viewer ) 54 { 55 super( Messages.getString( "HideObjectClassesAction.Hide_Object_Classes" ), AS_CHECK_BOX ); setToolTipText( getText() ); 57 setId( PluginConstants.CMD_HIDE_OBJECT_CLASSES ); 58 setImageDescriptor( AbstractUIPlugin.imageDescriptorFromPlugin( Activator.PLUGIN_ID, 59 PluginConstants.IMG_HIDE_OBJECT_CLASSES ) ); 60 setEnabled( true ); 61 this.viewer = viewer; 62 63 if ( Activator.getDefault().getDialogSettings().get( HIDE_OBJECT_CLASSES_DS_KEY ) == null ) 65 { 66 Activator.getDefault().getDialogSettings().put( HIDE_OBJECT_CLASSES_DS_KEY, false ); 67 } 68 69 setChecked( Activator.getDefault().getDialogSettings().getBoolean( HIDE_OBJECT_CLASSES_DS_KEY ) ); 71 } 72 73 74 77 public void run() 78 { 79 setChecked( isChecked() ); 80 Activator.getDefault().getDialogSettings().put( HIDE_OBJECT_CLASSES_DS_KEY, isChecked() ); 81 82 viewer.refresh(); 83 } 84 } 85 | Popular Tags |