Lines 25-32
Link Here
|
25 |
|
25 |
|
26 |
import org.openide.ErrorManager; |
26 |
import org.openide.ErrorManager; |
27 |
import org.openide.filesystems.*; |
27 |
import org.openide.filesystems.*; |
28 |
import org.openide.loaders.OperationListener; |
|
|
29 |
import org.openide.loaders.OperationEvent; |
30 |
import org.openide.nodes.*; |
28 |
import org.openide.nodes.*; |
31 |
|
29 |
|
32 |
/** |
30 |
/** |
Lines 431-442
Link Here
|
431 |
* @param source the source that the listener should detach from when |
429 |
* @param source the source that the listener should detach from when |
432 |
* listener <CODE>l</CODE> is freed, can be <CODE>null</CODE> |
430 |
* listener <CODE>l</CODE> is freed, can be <CODE>null</CODE> |
433 |
* @return a OperationListener delegating to <CODE>l</CODE>. |
431 |
* @return a OperationListener delegating to <CODE>l</CODE>. |
434 |
*/ |
432 |
* |
435 |
public static OperationListener operation (OperationListener l, Object source) { |
433 |
* //PENDING-JST: Replaced with org.openide.loaders.createWeakOperationListener |
|
|
434 |
* |
435 |
* |
436 |
public static org.openide.loaders.OperationListener operation (org.openide.loaders.OperationListener l, Object source) { |
436 |
WeakListener.Operation wl = new WeakListener.Operation (l); |
437 |
WeakListener.Operation wl = new WeakListener.Operation (l); |
437 |
wl.setSource (source); |
438 |
wl.setSource (source); |
438 |
return wl; |
439 |
return wl; |
439 |
} |
440 |
} |
|
|
441 |
*/ |
440 |
|
442 |
|
441 |
/** A generic WeakListener factory. |
443 |
/** A generic WeakListener factory. |
442 |
* Creates a weak implementation of a listener of type <CODE>lType</CODE>. |
444 |
* Creates a weak implementation of a listener of type <CODE>lType</CODE>. |
Lines 855-936
Link Here
|
855 |
return "removeFocusListener"; // NOI18N |
857 |
return "removeFocusListener"; // NOI18N |
856 |
} |
858 |
} |
857 |
|
859 |
|
858 |
} |
|
|
859 |
|
860 |
/** Weak property change listener |
861 |
*/ |
862 |
final static class Operation extends WeakListener |
863 |
implements OperationListener { |
864 |
/** Constructor. |
865 |
* @param l listener to delegate to |
866 |
*/ |
867 |
public Operation (OperationListener l) { |
868 |
super (OperationListener.class, l); |
869 |
} |
870 |
|
871 |
|
872 |
/** Method name to use for removing the listener. |
873 |
* @return name of method of the source object that should be used |
874 |
* to remove the listener from listening on source of events |
875 |
*/ |
876 |
protected String removeMethodName () { |
877 |
return "removeOperationListener"; // NOI18N |
878 |
} |
879 |
|
880 |
/** Object has been recognized by |
881 |
* {@link DataLoaderPool#findDataObject}. |
882 |
* This allows listeners |
883 |
* to attach additional cookies, etc. |
884 |
* |
885 |
* @param ev event describing the action |
886 |
*/ |
887 |
public void operationPostCreate(OperationEvent ev) { |
888 |
OperationListener l = (OperationListener)super.get (ev); |
889 |
if (l != null) l.operationPostCreate (ev); |
890 |
} |
891 |
/** Object has been successfully copied. |
892 |
* @param ev event describing the action |
893 |
*/ |
894 |
public void operationCopy(OperationEvent.Copy ev) { |
895 |
OperationListener l = (OperationListener)super.get (ev); |
896 |
if (l != null) l.operationCopy (ev); |
897 |
} |
898 |
/** Object has been successfully moved. |
899 |
* @param ev event describing the action |
900 |
*/ |
901 |
public void operationMove(OperationEvent.Move ev) { |
902 |
OperationListener l = (OperationListener)super.get (ev); |
903 |
if (l != null) l.operationMove (ev); |
904 |
} |
905 |
/** Object has been successfully deleted. |
906 |
* @param ev event describing the action |
907 |
*/ |
908 |
public void operationDelete(OperationEvent ev) { |
909 |
OperationListener l = (OperationListener)super.get (ev); |
910 |
if (l != null) l.operationDelete (ev); |
911 |
} |
912 |
/** Object has been successfully renamed. |
913 |
* @param ev event describing the action |
914 |
*/ |
915 |
public void operationRename(OperationEvent.Rename ev) { |
916 |
OperationListener l = (OperationListener)super.get (ev); |
917 |
if (l != null) l.operationRename (ev); |
918 |
} |
919 |
|
920 |
/** A shadow of a data object has been created. |
921 |
* @param ev event describing the action |
922 |
*/ |
923 |
public void operationCreateShadow (OperationEvent.Copy ev) { |
924 |
OperationListener l = (OperationListener)super.get (ev); |
925 |
if (l != null) l.operationCreateShadow (ev); |
926 |
} |
927 |
/** New instance of an object has been created. |
928 |
* @param ev event describing the action |
929 |
*/ |
930 |
public void operationCreateFromTemplate(OperationEvent.Copy ev) { |
931 |
OperationListener l = (OperationListener)super.get (ev); |
932 |
if (l != null) l.operationCreateFromTemplate (ev); |
933 |
} |
934 |
} |
860 |
} |
935 |
|
861 |
|
936 |
|
862 |
|