|
@@ -125,6 +125,17 @@ public class FrameContainer implements WindowModel {
|
125
|
125
|
this.id = id;
|
126
|
126
|
}
|
127
|
127
|
|
|
128
|
+ /**
|
|
129
|
+ * Indicates whether this container has been assigned an ID yet.
|
|
130
|
+ *
|
|
131
|
+ * <p>The container should not post events until it has an ID.
|
|
132
|
+ *
|
|
133
|
+ * @return True if the container has an ID, false otherwise.
|
|
134
|
+ */
|
|
135
|
+ protected boolean hasId() {
|
|
136
|
+ return id != null;
|
|
137
|
+ }
|
|
138
|
+
|
128
|
139
|
@Override
|
129
|
140
|
public String getIcon() {
|
130
|
141
|
return icon;
|
|
@@ -154,14 +165,18 @@ public class FrameContainer implements WindowModel {
|
154
|
165
|
public void setName(final String name) {
|
155
|
166
|
this.name = name;
|
156
|
167
|
|
157
|
|
- eventBus.publishAsync(new FrameNameChangedEvent(this, name));
|
|
168
|
+ if (hasId()) {
|
|
169
|
+ eventBus.publishAsync(new FrameNameChangedEvent(this, name));
|
|
170
|
+ }
|
158
|
171
|
}
|
159
|
172
|
|
160
|
173
|
@Override
|
161
|
174
|
public void setTitle(final String title) {
|
162
|
175
|
this.title = title;
|
163
|
176
|
|
164
|
|
- eventBus.publishAsync(new FrameTitleChangedEvent(this, title));
|
|
177
|
+ if (hasId()) {
|
|
178
|
+ eventBus.publishAsync(new FrameTitleChangedEvent(this, title));
|
|
179
|
+ }
|
165
|
180
|
}
|
166
|
181
|
|
167
|
182
|
@Override
|
|
@@ -172,14 +187,19 @@ public class FrameContainer implements WindowModel {
|
172
|
187
|
@Override
|
173
|
188
|
public void addComponent(final String component) {
|
174
|
189
|
components.add(component);
|
175
|
|
- eventBus.publishAsync(new FrameComponentAddedEvent(this, component));
|
|
190
|
+
|
|
191
|
+ if (hasId()) {
|
|
192
|
+ eventBus.publishAsync(new FrameComponentAddedEvent(this, component));
|
|
193
|
+ }
|
176
|
194
|
}
|
177
|
195
|
|
178
|
196
|
@Override
|
179
|
197
|
public void removeComponent(final String component) {
|
180
|
198
|
components.remove(component);
|
181
|
199
|
|
182
|
|
- eventBus.publishAsync(new FrameComponentRemovedEvent(this, component));
|
|
200
|
+ if (hasId()) {
|
|
201
|
+ eventBus.publishAsync(new FrameComponentRemovedEvent(this, component));
|
|
202
|
+ }
|
183
|
203
|
}
|
184
|
204
|
|
185
|
205
|
@Override
|
|
@@ -204,7 +224,9 @@ public class FrameContainer implements WindowModel {
|
204
|
224
|
* Called when this container's icon is updated.
|
205
|
225
|
*/
|
206
|
226
|
private void iconUpdated() {
|
207
|
|
- eventBus.publish(new FrameIconChangedEvent(this, icon));
|
|
227
|
+ if (hasId()) {
|
|
228
|
+ eventBus.publish(new FrameIconChangedEvent(this, icon));
|
|
229
|
+ }
|
208
|
230
|
}
|
209
|
231
|
|
210
|
232
|
@Override
|