Revision 10530 trunk/frameworks/_fwAndami/src/com/iver/andami/ui/mdiFrame/NewStatusBar.java

View differences:

NewStatusBar.java
473 473
	 * Adds a control to the status bar
474 474
	 */
475 475
	public void addControl(String id, Component control) {
476
		controlContainer.add(control);
477
		if (!controls.containsKey(control.getName()))
478
				controls.put(control.getName(), control);
479
		else
476
		if (!controls.containsKey(control.getName())) {
477
			controls.put(control.getName(), control);
478
			controlContainer.add(control);
479
		}
480
		else {
480 481
			logger.debug("NewStatusBar.addControl -- control 'id' already exists"+ id);
482
		}
481 483
	}
482 484

  
483 485
	/**
486
	 * Remove a control from the status bar
487
	 */
488
	public Component removeControl(String id) {
489
		try {
490
			Component component = (Component) controls.get(id);
491
			controlContainer.remove(component);
492
			controls.remove(id);
493
			return component;
494
		}
495
		catch (ClassCastException ex) {
496
			logger.debug("NewStatusBar.removeControl -- control "+id+"doesn't exist");
497
		}
498
		return null;
499
	}
500
	
501
	/**
484 502
	 * Gets a control from the status bar
485 503
	 */
486
	public Component getControl(String id, Component control) {
504
	public Component getControl(String id) {
487 505
		return (Component) controls.get(id);
488 506
	}
489 507
} //  @jve:decl-index=0:visual-constraint="10,10"

Also available in: Unified diff