1 /**********************************************************************
2 * Copyright (c) 2003 IBM Corporation and others.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Common Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/cpl-v10.html
9 * IBM - Initial API and implementation
10 **********************************************************************/
11 package net.sourceforge.phpdt.monitor.core.internal;
13 import net.sourceforge.phpdt.monitor.core.*;
17 public class MonitorWorkingCopy extends Monitor implements IMonitorWorkingCopy {
18 protected Monitor monitor;
21 public MonitorWorkingCopy() { }
24 public MonitorWorkingCopy(Monitor monitor) {
25 this.monitor = monitor;
30 * @see org.eclipse.monitor.internal.IMonitorWorkingCopy#setRemoteHost(java.lang.String)
32 public void setId(String newId) {
37 * @see org.eclipse.monitor.internal.IMonitorWorkingCopy#setRemoteHost(java.lang.String)
39 public void setRemoteHost(String host) {
44 * @see org.eclipse.monitor.internal.IMonitorWorkingCopy#setRemotePort(int)
46 public void setRemotePort(int port) {
51 * @see org.eclipse.monitor.internal.IMonitorWorkingCopy#setLocalPort(int)
53 public void setLocalPort(int port) {
58 * @see org.eclipse.monitor.internal.IMonitorWorkingCopy#setType(IType)
60 public void setProtocolAdapter(IProtocolAdapter t) {
64 public boolean isWorkingCopy() {
68 public IMonitorWorkingCopy getWorkingCopy() {
72 public IMonitor save() {
73 MonitorManager mm = MonitorManager.getInstance();
74 if (monitor != null) {
75 //boolean restart = false;
76 if (monitor.isRunning()) {
78 mm.stopMonitor(monitor);
80 monitor.setInternal(this);
81 mm.monitorChanged(monitor);
83 // mm.startMonitor(monitor);
85 monitor = new Monitor();
86 monitor.setInternal(this);
87 mm.addMonitor(monitor);