|
|
@ -204,7 +204,8 @@ public class EventPropertyTable extends UIListControlPane { |
|
|
|
* 刷新 |
|
|
|
* 刷新 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public void refresh() { |
|
|
|
public void refresh() { |
|
|
|
isPopulating = true; |
|
|
|
// isPopulating = true;
|
|
|
|
|
|
|
|
System.out.println("in refresh..."); |
|
|
|
int selectionSize = designer.getSelectionModel().getSelection().size(); |
|
|
|
int selectionSize = designer.getSelectionModel().getSelection().size(); |
|
|
|
if (selectionSize == 0 || selectionSize == 1) { |
|
|
|
if (selectionSize == 0 || selectionSize == 1) { |
|
|
|
this.creator = selectionSize == 0 ? designer.getRootComponent() : designer.getSelectionModel() |
|
|
|
this.creator = selectionSize == 0 ? designer.getRootComponent() : designer.getSelectionModel() |
|
|
@ -232,7 +233,8 @@ public class EventPropertyTable extends UIListControlPane { |
|
|
|
populate(nameObjectList.toArray(new NameObject[widget.getListenerSize()])); |
|
|
|
populate(nameObjectList.toArray(new NameObject[widget.getListenerSize()])); |
|
|
|
checkButtonEnabled(); |
|
|
|
checkButtonEnabled(); |
|
|
|
this.repaint(); |
|
|
|
this.repaint(); |
|
|
|
isPopulating = false; |
|
|
|
// isPopulating = false;
|
|
|
|
|
|
|
|
System.out.println("out refresh..."); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
@ -240,12 +242,20 @@ public class EventPropertyTable extends UIListControlPane { |
|
|
|
* @param creator 控件 |
|
|
|
* @param creator 控件 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public void updateWidgetListener(XCreator creator, boolean isSaving) { |
|
|
|
public void updateWidgetListener(XCreator creator, boolean isSaving) { |
|
|
|
DefaultListModel listModel = (DefaultListModel) this.nameableList.getModel(); |
|
|
|
// DefaultListModel listModel = (DefaultListModel) this.nameableList.getModel();
|
|
|
|
|
|
|
|
// (creator.toData()).clearListeners();
|
|
|
|
|
|
|
|
// for (int i = 0, len = listModel.getSize(); i < len; i++) {
|
|
|
|
|
|
|
|
// NameObject nameObject = isSaving ? (NameObject)((ListModelElement) listModel.getElementAt(i)).wrapper : (NameObject)(listModel.getElementAt(i));
|
|
|
|
|
|
|
|
// (creator.toData()).addListener((Listener) nameObject.getObject());
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
(creator.toData()).clearListeners(); |
|
|
|
(creator.toData()).clearListeners(); |
|
|
|
for (int i = 0, len = listModel.getSize(); i < len; i++) { |
|
|
|
Nameable[] res = this.update(); |
|
|
|
NameObject nameObject = isSaving ? (NameObject)((ListModelElement) listModel.getElementAt(i)).wrapper : (NameObject)(listModel.getElementAt(i)); |
|
|
|
for (int i = 0; i < res.length; i++) { |
|
|
|
|
|
|
|
NameObject nameObject = (NameObject)res[i]; |
|
|
|
(creator.toData()).addListener((Listener) nameObject.getObject()); |
|
|
|
(creator.toData()).addListener((Listener) nameObject.getObject()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
designer.fireTargetModified(); |
|
|
|
designer.fireTargetModified(); |
|
|
|
checkButtonEnabled(); |
|
|
|
checkButtonEnabled(); |
|
|
|
} |
|
|
|
} |
|
|
@ -268,6 +278,9 @@ public class EventPropertyTable extends UIListControlPane { |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void saveSettings() { |
|
|
|
public void saveSettings() { |
|
|
|
|
|
|
|
if (isPopulating) { |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
updateWidgetListener(creator, true); |
|
|
|
updateWidgetListener(creator, true); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|