1 11 package org.eclipse.jdt.internal.ui.javaeditor.saveparticipant; 12 13 import org.eclipse.core.runtime.Assert; 14 15 20 public class SaveParticipantDescriptor { 21 22 23 private final IPostSaveListener fPostSaveListener; 24 25 private ISaveParticipantPreferenceConfiguration fPreferenceConfiguration; 26 27 33 SaveParticipantDescriptor(IPostSaveListener listener) { 34 Assert.isNotNull(listener); 35 36 fPostSaveListener= listener; 37 } 38 39 45 public IPostSaveListener getPostSaveListener() { 46 return fPostSaveListener; 47 } 48 49 55 public ISaveParticipantPreferenceConfiguration createPreferenceConfiguration() { 56 return new AbstractSaveParticipantPreferenceConfiguration() { 57 58 protected String getPostSaveListenerId() { 59 return fPostSaveListener.getId(); 60 } 61 62 protected String getPostSaveListenerName() { 63 return fPostSaveListener.getName(); 64 } 65 }; 66 } 67 68 74 public ISaveParticipantPreferenceConfiguration getPreferenceConfiguration() { 75 if (fPreferenceConfiguration == null) 76 fPreferenceConfiguration= createPreferenceConfiguration(); 77 78 return fPreferenceConfiguration; 79 } 80 81 86 public String getId() { 87 return fPostSaveListener.getId(); 88 } 89 90 } 91 | Popular Tags |