|
|
|
@ -22,6 +22,8 @@ public class NewColorSelectBox extends AbstractSelectBox<Color> implements UIObs
|
|
|
|
|
private Color color; |
|
|
|
|
private NewColorSelectPane colorPane = new NewColorSelectPane(); |
|
|
|
|
private UIObserverListener uiObserverListener; |
|
|
|
|
private String newColorSelectBoxName = ""; |
|
|
|
|
private GlobalNameListener globalNameListener = null; |
|
|
|
|
|
|
|
|
|
public NewColorSelectBox(int preferredWidth) { |
|
|
|
|
initBox(preferredWidth); |
|
|
|
@ -36,6 +38,9 @@ public class NewColorSelectBox extends AbstractSelectBox<Color> implements UIObs
|
|
|
|
|
if(uiObserverListener == null){ |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
if (globalNameListener != null && shouldResponseNameListener()){ |
|
|
|
|
globalNameListener.setGlobalName(newColorSelectBoxName); |
|
|
|
|
} |
|
|
|
|
uiObserverListener.doChange(); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
@ -98,16 +103,16 @@ public class NewColorSelectBox extends AbstractSelectBox<Color> implements UIObs
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public void registerNameListener(GlobalNameListener listener) { |
|
|
|
|
|
|
|
|
|
globalNameListener = listener; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public boolean shouldResponseNameListener() { |
|
|
|
|
return false; |
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public void setGlobalName(String name) { |
|
|
|
|
|
|
|
|
|
newColorSelectBoxName = name; |
|
|
|
|
} |
|
|
|
|
} |