Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright (c) 2011 Michael Ruflin, Andr� Locher, Claudia von Bastian. This file is part of Tatool. Tatool is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Tatool is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with Tatool. If not, see <http://www.gnu.org/licenses/>. /
 
 package ch.tatool.core.element.handler;
 
 import java.util.List;
 
This handler takes care of resetting status panel states (enabled, reset). It is used for example to disable the timer status panel, to display it as grayed out when not used.

Author(s):
Michael Ruflin
 
 public class StatusPanelStateHandler extends NodeImpl implements ExecutionPhaseListener {
 
 	private List<StringresetIds;
 	private List<StringdisableIds;
 	private List<StringenableIds;
 	
 	public void processExecutionPhase(ExecutionContext event) {
 		if (! event.getPhase().equals()) {
 			return;
 		}
 		
 		// fetch the status region
 		StatusRegionImpl statusRegion = StatusRegionUtil.getInstance(); 
 		
 		// reset
 		if ( != null) {
 			for (String id : ) {
 				StatusPanel panel = statusRegion.getStatusPanel(id);
 				if (panel != null) {
 					panel.reset();
 				}
 			}
 		}
 		
 		// disable
 		if ( != null) {
 			for (String id : ) {
 				StatusPanel panel = statusRegion.getStatusPanel(id);
 				if (panel != null) {
 					panel.setEnabled(false);
 				}
 			}
 		}
 		
 		// enable
 		if ( != null) {
 			for (String id : ) {
 				StatusPanel panel = statusRegion.getStatusPanel(id);
 				if (panel != null) {
 					panel.setEnabled(true);
 				}
 			}
 		}
 	}
 
 	// Getters and setters
 	
 	public List<StringgetResetIds() {
 		return ;
 	}
 
 	public void setResetIds(List<StringresetIds) {
 		this. = resetIds;
 	}
 
 	public List<StringgetDisableIds() {
 		return ;
 	}
 
 	public void setDisableIds(List<StringdisableIds) {
 		this. = disableIds;
	}
	public List<StringgetEnableIds() {
		return ;
	}
	public void setEnableIds(List<StringenableIds) {
		this. = enableIds;
	}
		return ;
	}

Set the phase in which to execute the reset/enable/disable actions.

Parameters:
phase the phase in which to execute the actions. Default is PRE_PROCESS
	public void setPhase(ExecutionPhase phase) {
		this. = phase;
	}
New to GrepCode? Check out our FAQ X