1// BEGIN LICENSE BLOCK 2// Version: CMPL 1.1 3// 4// The contents of this file are subject to the Cisco-style Mozilla Public 5// License Version 1.1 (the "License"); you may not use this file except 6// in compliance with the License. You may obtain a copy of the License 7// at www.eclipse-clp.org/license. 8// 9// Software distributed under the License is distributed on an "AS IS" 10// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See 11// the License for the specific language governing rights and limitations 12// under the License. 13// 14// The Original Code is The ECLiPSe Constraint Logic Programming System. 15// The Initial Developer of the Original Code is Cisco Systems, Inc. 16// Portions created by the Initial Developer are 17// Copyright (C) 2006 Cisco Systems, Inc. All Rights Reserved. 18// 19// Contributor(s): 20// 21// END LICENSE BLOCK 22 23/** 24 * Command which is issued to activate the (internal) frame of a viewer 25 * (activated == true) or deactivate it (activated == false) 26 */ 27package com.parctechnologies.eclipse.visualisation; 28 29import java.beans.PropertyVetoException; 30 31public class ViewerActivationCommand extends ViewerCommand { 32 private Boolean activated; 33 34 public ViewerActivationCommand(Viewer viewer, boolean activated) { 35 super(viewer); 36 this.activated = new Boolean(activated); 37 } 38 39 public void postRecordIssue() { 40 try { 41 getInternalFrame().setSelected(activated.booleanValue()); 42 } catch(PropertyVetoException pve){} 43 if(activated.booleanValue()) { 44 getDesktopManager().activateFrame(getInternalFrame()); 45 46 } else { 47 getDesktopManager().deactivateFrame(getInternalFrame()); 48 } 49 } 50} 51