Changeset 211
- Timestamp:
- 08/11/08 14:57:02 (16 years ago)
- Location:
- trunk/src/org/expeditee/items/widgets
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/expeditee/items/widgets/HeavyDutyInteractiveWidget.java
r207 r211 374 374 375 375 @Override 376 p ublicvoid onParentStateChanged(int eventType) {376 protected void onParentStateChanged(int eventType) { 377 377 378 378 switch (eventType) { -
trunk/src/org/expeditee/items/widgets/InteractiveWidget.java
r210 r211 688 688 _d4.setFloating(vfloating[3]); 689 689 690 onSizeChanged(); 690 691 } 691 692 … … 1253 1254 */ 1254 1255 protected void onMoved() { 1255 1256 } 1257 1258 /** 1259 * Invoked whenever the widget have moved. 1260 * Can override. 1261 * 1262 */ 1263 protected void onSizeChanged() { 1256 1264 } 1257 1265 … … 1369 1377 */ 1370 1378 protected Long getStrippedDataLong(String tag, Long defaultValue) { 1371 1372 1379 1373 1380 String strippedStr = getStrippedDataString(tag); 1374 1381 … … 1385 1392 } 1386 1393 1387 1394 /** 1395 * All data is removed that is prefixed with the given tag. 1396 * 1397 * @param tag 1398 * The prefix of the data lines to remove. Must be larger the zero and not null. 1399 * 1400 * @throws IllegalArgumentException 1401 * If tag is null. 1402 * 1403 * @throws NullPointerException 1404 * If tag is empty. 1405 * 1406 */ 1407 protected void removeData(String tag) { 1408 updateData(tag, null); 1409 } 1410 1411 /** 1412 * Updates the data with a given tag. 1413 * All data is removed that is prefixed with the given tag. Then 1414 * a new line is added (if not null). 1415 * 1416 * Note that passing newData with null is the equivelant of removing 1417 * tag lines. 1418 * 1419 * @param tag 1420 * The prefix of the data lines to remove. Must be larger the zero and not null. 1421 * 1422 * @param newData 1423 * The new line to add. Can be null - for not adding anything. 1424 * 1425 * @throws IllegalArgumentException 1426 * If tag is null. 1427 * 1428 * @throws NullPointerException 1429 * If tag is empty. 1430 * 1431 * @see #removeData(String) 1432 * 1433 */ 1434 protected void updateData(String tag, String newData) { 1435 if (tag == null) throw new NullPointerException("tag"); 1436 else if(tag.length() == 0) throw new IllegalArgumentException("tag is empty"); 1437 1438 // Get current data 1439 List<String> data = getCurrentRepresentation().getData(); 1440 1441 if (data != null) { 1442 for (int i = 0; i < data.size(); i++) { 1443 String str = data.get(i); 1444 if (str != null && str.startsWith(tag)) { 1445 data.remove(i); 1446 } 1447 } 1448 } 1449 1450 if (newData != null) { 1451 data.add(newData); 1452 } 1453 1454 } 1388 1455 1389 1456 }
Note:
See TracChangeset
for help on using the changeset viewer.