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 23package com.parctechnologies.eclipse.visualisation; 24/** 25 * Provides a base class for commands which require access to a 26 * viewletType, and a viewletRange (eg. those commands issued from 27 * within ViewletType classes) 28 **/ 29public abstract class ViewletTypeRangeCommand extends SymRefCommand { 30 ViewletRange range; 31 SymRef storeRef; 32 33 public ViewletTypeRangeCommand(ViewletType type, 34 ViewletDataStore store, 35 ViewletRange range) { 36 super(type); 37 this.storeRef = store.getSymRef(); 38 this.range = store.createRange(range); // make a copy of the range 39 } 40 41 /** 42 * Get the value of data store 43 * @return value of data store 44 */ 45 public ViewletDataStore getViewletDataStore() { 46 return (ViewletDataStore)(SymRef.get(storeRef)); 47 } 48 49 /** 50 * Get the ViewletType for this command 51 * @return value of ViewletType 52 */ 53 public ViewletType getViewletType() { 54 return (ViewletType)lookupSymRef(); 55 } 56 57 /** 58 * Get the value of the range 59 * @return value of range 60 */ 61 public ViewletRange getViewletRange() { 62 return range; 63 } 64 65 public abstract void postRecordIssue() ; 66} 67