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.IMonitor;
14 import net.sourceforge.phpdt.monitor.core.IMonitorWorkingCopy;
15 import net.sourceforge.phpdt.monitor.core.IProtocolAdapter;
19 public class MonitorWorkingCopy extends Monitor implements IMonitorWorkingCopy {
20 protected Monitor monitor;
23 public MonitorWorkingCopy() { }
26 public MonitorWorkingCopy(Monitor monitor) {
27 this.monitor = monitor;
32 * @see org.eclipse.monitor.internal.IMonitorWorkingCopy#setRemoteHost(java.lang.String)
34 public void setId(String newId) {
39 * @see org.eclipse.monitor.internal.IMonitorWorkingCopy#setRemoteHost(java.lang.String)
41 public void setRemoteHost(String host) {
46 * @see org.eclipse.monitor.internal.IMonitorWorkingCopy#setRemotePort(int)
48 public void setRemotePort(int port) {
53 * @see org.eclipse.monitor.internal.IMonitorWorkingCopy#setLocalPort(int)
55 public void setLocalPort(int port) {
60 * @see org.eclipse.monitor.internal.IMonitorWorkingCopy#setType(IType)
62 public void setProtocolAdapter(IProtocolAdapter t) {
66 public boolean isWorkingCopy() {
70 public IMonitorWorkingCopy getWorkingCopy() {
74 public IMonitor save() {
75 MonitorManager mm = MonitorManager.getInstance();
76 if (monitor != null) {
77 //boolean restart = false;
78 if (monitor.isRunning()) {
80 mm.stopMonitor(monitor);
82 monitor.setInternal(this);
83 mm.monitorChanged(monitor);
85 // mm.startMonitor(monitor);
87 monitor = new Monitor();
88 monitor.setInternal(this);
89 mm.addMonitor(monitor);