PTP
Release 5.0

org.eclipse.ptp.ui.managers
Class MachineManager

java.lang.Object
  extended by org.eclipse.ptp.ui.managers.AbstractElementManager
      extended by org.eclipse.ptp.ui.managers.MachineManager
All Implemented Interfaces:
IElementManager, IMachineManager

public class MachineManager
extends AbstractElementManager
implements IMachineManager


Field Summary
protected  org.eclipse.ptp.core.elements.IPMachine cur_machine
           
protected  String DEFAULT_TITLE
           
 
Fields inherited from class org.eclipse.ptp.ui.managers.AbstractElementManager
cur_set_id, elementHandlers, jListeners, modelPresentation, setListeners
 
Fields inherited from interface org.eclipse.ptp.ui.IElementManager
ADD_ELEMENT_TYPE, CHANGE_SET_TYPE, CREATE_SET_TYPE, DELETE_SET_TYPE, EMPTY_ID, REMOVE_ELEMENT_TYPE
 
Constructor Summary
MachineManager()
           
 
Method Summary
 void addMachine(org.eclipse.ptp.core.elements.IPMachine mac)
          Add a new machine to machineList.
 void addNode(org.eclipse.ptp.core.elements.IPNode node)
          Add a node to the view
 void clear()
          clean all setting
protected  IElement createNodeElement(IElementSet set, String key, String name, org.eclipse.ptp.core.elements.IPNode node)
           
 org.eclipse.ptp.core.elements.IPMachine findMachineById(String id)
          Find a machine using its ID
 org.eclipse.ptp.core.elements.IPNode findNode(String id)
          Find node using its ID
 org.eclipse.ptp.core.elements.IPMachine getCurrentMachine()
          Get current machine
 String getFullyQualifiedName(String id)
          Get fully qualified name of element
 org.eclipse.swt.graphics.Image getImage(IElement element)
          Get element image
 org.eclipse.ptp.core.elements.IPMachine[] getMachines()
          Get machines in the view
 String getName(String id)
          Get name of element
 org.eclipse.ptp.core.elements.IPElement initial(org.eclipse.ptp.core.elements.IPUniverse universe)
          initial elements
 void removeMachine(org.eclipse.ptp.core.elements.IPMachine machine)
          Remove machine from the view
 void removeNode(org.eclipse.ptp.core.elements.IPNode node)
          Remove node from the view
 void setCurrentSetId(String set_id)
          set current set ID
 void setMachine(org.eclipse.ptp.core.elements.IPMachine machine)
          Set current machine.
 void shutdown()
          Shutdown the manager
 int size()
          Get element size
 
Methods inherited from class org.eclipse.ptp.ui.managers.AbstractElementManager
addJobChangedListener, addSetListener, addToSet, addToSet, createSet, fireJobChangedEvent, fireSetEvent, getCurrentSetId, getElementHandler, removeElementHandler, removeFromSet, removeJobChangedListener, removeSet, removeSetListener, setElementHandler
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.eclipse.ptp.ui.IElementManager
addSetListener, addToSet, addToSet, createSet, fireSetEvent, getCurrentSetId, getElementHandler, removeElementHandler, removeFromSet, removeSet, removeSetListener, setElementHandler
 

Field Detail

cur_machine

protected org.eclipse.ptp.core.elements.IPMachine cur_machine

DEFAULT_TITLE

protected final String DEFAULT_TITLE
Constructor Detail

MachineManager

public MachineManager()
Method Detail

addMachine

public void addMachine(org.eclipse.ptp.core.elements.IPMachine mac)
Description copied from interface: IMachineManager
Add a new machine to machineList. Add any new nodes to the element handler for the machine.

Specified by:
addMachine in interface IMachineManager
Parameters:
mac - machine

addNode

public void addNode(org.eclipse.ptp.core.elements.IPNode node)
Description copied from interface: IMachineManager
Add a node to the view

Specified by:
addNode in interface IMachineManager
Parameters:
node - node

clear

public void clear()
Description copied from interface: IElementManager
clean all setting

Specified by:
clear in interface IElementManager
Overrides:
clear in class AbstractElementManager

findMachineById

public org.eclipse.ptp.core.elements.IPMachine findMachineById(String id)
Description copied from interface: IMachineManager
Find a machine using its ID

Specified by:
findMachineById in interface IMachineManager
Parameters:
id - ID of machine
Returns:
machine

findNode

public org.eclipse.ptp.core.elements.IPNode findNode(String id)
Description copied from interface: IMachineManager
Find node using its ID

Specified by:
findNode in interface IMachineManager
Parameters:
id - node ID
Returns:
null is not found

getCurrentMachine

public org.eclipse.ptp.core.elements.IPMachine getCurrentMachine()
Description copied from interface: IMachineManager
Get current machine

Specified by:
getCurrentMachine in interface IMachineManager
Returns:
current machine

getFullyQualifiedName

public String getFullyQualifiedName(String id)
Description copied from interface: IElementManager
Get fully qualified name of element

Specified by:
getFullyQualifiedName in interface IElementManager
Parameters:
id - element ID
Returns:
fully quallified name of element

getMachines

public org.eclipse.ptp.core.elements.IPMachine[] getMachines()
Description copied from interface: IMachineManager
Get machines in the view

Specified by:
getMachines in interface IMachineManager
Returns:
machines

getName

public String getName(String id)
Description copied from interface: IElementManager
Get name of element

Specified by:
getName in interface IElementManager
Parameters:
id - element ID
Returns:
name of element

getImage

public org.eclipse.swt.graphics.Image getImage(IElement element)
Description copied from interface: IElementManager
Get element image

Specified by:
getImage in interface IElementManager
Specified by:
getImage in class AbstractElementManager
Parameters:
element - IElement
Returns:
element image

initial

public org.eclipse.ptp.core.elements.IPElement initial(org.eclipse.ptp.core.elements.IPUniverse universe)
Description copied from interface: IElementManager
initial elements

Specified by:
initial in interface IElementManager
Returns:
first element name

removeMachine

public void removeMachine(org.eclipse.ptp.core.elements.IPMachine machine)
Description copied from interface: IMachineManager
Remove machine from the view

Specified by:
removeMachine in interface IMachineManager

removeNode

public void removeNode(org.eclipse.ptp.core.elements.IPNode node)
Description copied from interface: IMachineManager
Remove node from the view

Specified by:
removeNode in interface IMachineManager
Parameters:
node - node

setCurrentSetId

public void setCurrentSetId(String set_id)
Description copied from interface: IElementManager
set current set ID

Specified by:
setCurrentSetId in interface IElementManager
Parameters:
set_id - set ID

setMachine

public void setMachine(org.eclipse.ptp.core.elements.IPMachine machine)
Description copied from interface: IMachineManager
Set current machine. If the machine has never been set before, add an entry to the machineList, and add the nodes to the element handler.

Specified by:
setMachine in interface IMachineManager
Parameters:
machine - machine

shutdown

public void shutdown()
Description copied from interface: IElementManager
Shutdown the manager

Specified by:
shutdown in interface IElementManager
Overrides:
shutdown in class AbstractElementManager

size

public int size()
Description copied from interface: IElementManager
Get element size

Specified by:
size in interface IElementManager
Returns:
size of element

createNodeElement

protected IElement createNodeElement(IElementSet set,
                                     String key,
                                     String name,
                                     org.eclipse.ptp.core.elements.IPNode node)
Parameters:
set -
key -
name -
Returns:

PTP
Release 5.0

Copyright (c) 2011 IBM Corporation and others. All Rights Reserved.