Package: BoundFunctionSupport
BoundFunctionSupport
name | instruction | branch | complexity | line | method | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
BoundFunctionSupport() |
|
|
|
|
|
||||||||||||||||||||
addPropertyChangeListener(PropertyChangeListener) |
|
|
|
|
|
||||||||||||||||||||
addPropertyChangeListener(String, PropertyChangeListener) |
|
|
|
|
|
||||||||||||||||||||
fireIndexedPropertyChange(String, int, Object, Object) |
|
|
|
|
|
||||||||||||||||||||
fireIndexedPropertyChange(String, int, boolean, boolean) |
|
|
|
|
|
||||||||||||||||||||
fireIndexedPropertyChange(String, int, int, int) |
|
|
|
|
|
||||||||||||||||||||
firePropertyChange(PropertyChangeEvent) |
|
|
|
|
|
||||||||||||||||||||
firePropertyChange(String, Object, Object) |
|
|
|
|
|
||||||||||||||||||||
firePropertyChange(String, boolean, boolean) |
|
|
|
|
|
||||||||||||||||||||
firePropertyChange(String, int, int) |
|
|
|
|
|
||||||||||||||||||||
fireValueChanged(Object, Object) |
|
|
|
|
|
||||||||||||||||||||
fireValueChanged(boolean, boolean) |
|
|
|
|
|
||||||||||||||||||||
getPropertyChangeListeners() |
|
|
|
|
|
||||||||||||||||||||
getPropertyChangeListeners(String) |
|
|
|
|
|
||||||||||||||||||||
hasListeners(String) |
|
|
|
|
|
||||||||||||||||||||
removePropertyChangeListener(PropertyChangeListener) |
|
|
|
|
|
||||||||||||||||||||
removePropertyChangeListener(String, PropertyChangeListener) |
|
|
|
|
|
||||||||||||||||||||
unbindAll() |
|
|
|
|
|
Coverage
1: /*
2: * #%L
3: * *********************************************************************************************************************
4: *
5: * These Foolish Things - Miscellaneous utilities
6: * http://thesefoolishthings.tidalwave.it - git clone git@bitbucket.org:tidalwave/thesefoolishthings-src.git
7: * %%
8: * Copyright (C) 2009 - 2018 Tidalwave s.a.s. (http://tidalwave.it)
9: * %%
10: * *********************************************************************************************************************
11: *
12: * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
13: * the License. You may obtain a copy of the License at
14: *
15: * http://www.apache.org/licenses/LICENSE-2.0
16: *
17: * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
18: * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
19: * specific language governing permissions and limitations under the License.
20: *
21: * *********************************************************************************************************************
22: *
23: * $Id$
24: *
25: * *********************************************************************************************************************
26: * #L%
27: */
28: package it.tidalwave.role.ui.function;
29:
30: import java.beans.PropertyChangeListener;
31: import java.beans.PropertyChangeSupport;
32: import lombok.Delegate;
33:
34: /***********************************************************************************************************************
35: *
36: * @author Fabrizio Giudici
37: * @version $Id$
38: *
39: **********************************************************************************************************************/
40: public abstract class BoundFunctionSupport<DOMAIN_TYPE, CODOMAIN_TYPE>
41: implements BoundFunction<DOMAIN_TYPE, CODOMAIN_TYPE>
42: {
43: @Delegate // FIXME: weak
44: private final PropertyChangeSupport pcs = new PropertyChangeSupport(this);
45:
46: /*******************************************************************************************************************
47: *
48: * {@inheritDoc}
49: *
50: ******************************************************************************************************************/
51: @Override
52: public void unbindAll()
53: {
54:• for (final PropertyChangeListener listener : pcs.getPropertyChangeListeners().clone())
55: {
56: pcs.removePropertyChangeListener(listener);
57: }
58: }
59:
60: protected void fireValueChanged (final CODOMAIN_TYPE oldValue, final CODOMAIN_TYPE newValue)
61: {
62: pcs.firePropertyChange("value", oldValue, newValue);
63: }
64:
65: protected void fireValueChanged (final boolean oldValue, final boolean newValue)
66: {
67: pcs.firePropertyChange("value", oldValue, newValue);
68: }
69: }