1 11 package org.eclipse.team.internal.ccvs.ui.subscriber; 12 13 import org.eclipse.jface.viewers.ISelectionProvider; 14 import org.eclipse.team.internal.ccvs.ui.CVSUIPlugin; 15 import org.eclipse.team.internal.ccvs.ui.ICVSUIConstants; 16 import org.eclipse.team.internal.ccvs.ui.Policy; 17 import org.eclipse.team.internal.ui.Utils; 18 import org.eclipse.team.ui.synchronize.ISynchronizePageConfiguration; 19 import org.eclipse.team.ui.synchronize.SynchronizeModelAction; 20 21 25 public abstract class CVSParticipantAction extends SynchronizeModelAction { 26 27 protected CVSParticipantAction(ISynchronizePageConfiguration configuration) { 28 super(null, configuration); 29 Utils.initAction(this, getBundleKeyPrefix(), Policy.getActionBundle()); 30 } 31 32 protected CVSParticipantAction(ISynchronizePageConfiguration configuration, ISelectionProvider provider, String bundleKey) { 33 super(null, configuration, provider); 34 Utils.initAction(this, bundleKey, Policy.getActionBundle()); 35 } 36 37 42 protected String getBundleKeyPrefix() { 43 String name = getClass().getName(); 44 int lastDot = name.lastIndexOf("."); if (lastDot == -1) { 46 return name; 47 } 48 return name.substring(lastDot + 1) + "."; } 50 51 protected boolean needsToSaveDirtyEditors() { 52 int option = CVSUIPlugin.getPlugin().getPreferenceStore().getInt(ICVSUIConstants.PREF_SAVE_DIRTY_EDITORS); 53 return option != ICVSUIConstants.OPTION_NEVER; 54 } 55 56 59 protected boolean confirmSaveOfDirtyEditor() { 60 int option = CVSUIPlugin.getPlugin().getPreferenceStore().getInt(ICVSUIConstants.PREF_SAVE_DIRTY_EDITORS); 61 return option == ICVSUIConstants.OPTION_PROMPT; 62 } 63 } 64 | Popular Tags |