Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright (c) 2008, 2013 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html Contributors: IBM Corporation - initial API and implementation Alexander Kurtakov <akurtako@redhat.com> - bug 415649 /
  
  package org.eclipse.pde.internal.ua.ui.editor.ctxhelp;
  
  import java.util.List;
  
  import  org.eclipse.swt.SWT;
  import  org.eclipse.swt.dnd.DND;
  import  org.eclipse.swt.graphics.Cursor;
  import  org.eclipse.swt.widgets.Composite;
  import  org.eclipse.swt.widgets.Display;
  import  org.eclipse.swt.widgets.ToolBar;
Tree section for the context help editor. Displays the structure of the xml file and adds actions allowing manipulation of the structure.

Since:
3.4
See also:
CtxHelpEditor
  
  public class CtxHelpTreeSection extends TreeSection {
  	private CtxHelpModel fModel;
  	private TreeViewer fTree;
  
  	/*
  	 * The indices for each button attached to the Tree Viewer. This type of UI
  	 * form does not permit direct access to each particular button. However,
  	 * using these indices, one can perform any typical SWT operation on any
  	 * button.
  	 */
  	private static final int F_BUTTON_ADD_CONTEXT = 0;
  	private static final int F_BUTTON_ADD_TOPIC = 2;
  	private static final int F_BUTTON_ADD_COMMAND = 3;
  	private static final int F_BUTTON_REMOVE = 5;
  	private static final int F_BUTTON_UP = 6;
  	private static final int F_BUTTON_DOWN = 7;
  
  	// When one of the move buttons is pressed, a flag is used to determine the
  	// direction
  	private static final int F_UP_FLAG = -1;
  	private static final int F_DOWN_FLAG = 1;
  
  	// The actions that will add each type of object
  
  	// The object removal action
  
  	// The action for opening a link from the context menu
  
  	// Used to temporarily store the target of a drop operation
  	// so that it does not have be be recalculated
If items are dragged and dropped within this tree, then this flag inhibits reselection on the removal (drag) action, thus ensuring that the selected objects are the ones that were dropped.
 
 	private boolean fDragFromHere;

Action that allows a linked file to be opened in the editor

Since:
3.4
 
 	class OpenLinkAction extends Action {
 
 		public OpenLinkAction() {
 		}
 
 		public void setTarget(CtxHelpTopic target) {
 			 = target;
 		}
 
 		public void run() {
 			if ( != null) {
 			}
 		}
 	}
 
 	public CtxHelpTreeSection(PDEFormPage formPage, Composite parent) {
 		super(formPageparent.new String[] {
 	}
 
 	/*
 	 * (non-Javadoc)
 	 * 
 	 * @see
 	 * org.eclipse.pde.internal.ui.editor.PDESection#createClient(org.eclipse
 	 * .ui.forms.widgets.Section, org.eclipse.ui.forms.widgets.FormToolkit)
 	 */
 	protected void createClient(Section sectionFormToolkit toolkit) {
 
 		Composite container = createClientContainer(section, 2, toolkit);
 		createTree(containertoolkit);
 		toolkit.paintBordersFor(container);
 
 		section.setClient(container);
 
 
 		createSectionToolbar(sectiontoolkit);
 
 		// Create the adapted listener for the filter entry field
 	}

Creates the commands used in this section.
 
 	private void createCommands() {
 			public void run() {
 				if ( != null) {
 					String id = PDELabelUtility.generateName(getChildNames(),
 					context.setID(id);
 					addChild(context);
 				}
 			}
 		};
 			public void run() {
 				if ( != null) {
 					String label = PDELabelUtility.generateName(
 					topic.setLabel(label);
 					addChild(topic);
 				}
 			}
 		};
 			public void run() {
 				if ( != null) {
 					String label = PDELabelUtility.generateName(
 					command.setLabel(label);
 					addChild(command);
 				}
 			}
 		};
 
 	}

Adds a link (with hand cursor) for tree 'Collapse All' action, which collapses the tree down to the second level

Parameters:
section The section that the toolbar will belong to
toolkit The toolkit that will be used to make the toolbar
 
 	private void createSectionToolbar(Section sectionFormToolkit toolkit) {
 		ToolBarManager toolBarManager = new ToolBarManager(SWT.FLAT);
 		ToolBar toolbar = toolBarManager.createControl(section);
 
 		final Cursor handCursor = Display.getCurrent().getSystemCursor(
 				SWT.CURSOR_HAND);
 		toolbar.setCursor(handCursor);
 
 		// Add collapse action to the tool bar
 		toolBarManager.add(new CollapseAction(,
 		toolBarManager.update(true);
 		section.setTextClient(toolbar);
 	}

Create the tree widget that will contain the structure

Parameters:
container The container of the tree widget
toolkit The toolkit used to create the tree
 
 	private void createTree(Composite containerFormToolkit toolkit) {
 		TreePart treePart = getTreePart();
 		createViewerPartControl(container, SWT.MULTI, 2, toolkit);
 
 		 = treePart.getTreeViewer();
 		.setLabelProvider(PDEUserAssistanceUIPlugin.getDefault()
 
 		PDEUserAssistanceUIPlugin.getDefault().getLabelProvider().connect(this);
 
 		// Create listener for the outline view 'link with editor' toggle button
 	}
 
 	/*
 	 * (non-Javadoc)
 	 * 
 	 * @see
 	 * org.eclipse.pde.internal.ui.editor.TreeSection#createTreeViewer(org.eclipse
 	 * .swt.widgets.Composite, int)
 	 */
 	protected TreeViewer createTreeViewer(Composite parentint style) {
 		 = new FormFilteredTree(parentstylenew PatternFilter());
 		parent.setData("filtered".); //$NON-NLS-1$
 	}

Initialize the tree viewer widget and its buttons.
 
 	private void initializeTreeViewer() {
 		if ( == null) {
 			return;
 		}
 
 		.setInput(root);
 
 		// Buttons must be disabled if file is not editable
 
 	}
 
 	/*
 	 * (non-Javadoc)
 	 * 
 	 * @see org.eclipse.ui.forms.AbstractFormPart#setFormInput(java.lang.Object)
 	 */
 	public boolean setFormInput(Object object) {
 		// This method allows the outline view to select items in the tree
 		// (Invoked by org.eclipse.ui.forms.editor.IFormPage.selectReveal(Object
 		// object))
 		if (object instanceof CtxHelpObject) {
 			.setSelection(new StructuredSelection(object), true);
 
 			// Verify that something was actually selected
 			ISelection selection = .getSelection();
 			if (selection != null && !selection.isEmpty()) {
 				return true;
 			}
 		}
 		return false;
 	}

Returns:
the selection of the tree
 
 	public ISelection getSelection() {
 		return .getSelection();
 	}

Parameters:
selection the new selection for the tree section
 
 	public void setSelection(ISelection selection) {
 		.setSelection(selection);
 	}

Fire a selection change event and refresh the viewer's selection
 
 	public void fireSelection() {
 	}
 
 	/*
 	 * (non-Javadoc)
 	 * 
 	 * @see
 	 * org.eclipse.pde.internal.ui.editor.TreeSection#selectionChanged(org.eclipse
 	 * .jface.viewers.IStructuredSelection)
 	 */
 	protected void selectionChanged(IStructuredSelection selection) {
 	}

Update the buttons in the section based on the current selection
 
 	public void updateButtons() {
 		if (!.isEditable()) {
 			return;
 		}
 
 		CtxHelpObject firstSelectedObject = (CtxHelpObjectselection
 
 		// Add Context
 
 		// Add Topic
 		boolean enableAdd = false;
 		if (firstSelectedObject != null) {
 			if (firstSelectedObject.canAddSibling(.)) {
 				enableAdd = true;
 			} else if (firstSelectedObject
 				enableAdd = true;
 			}
 		}
 
 		// Add Command
 		enableAdd = false;
 		if (firstSelectedObject != null) {
 			if (firstSelectedObject
 				enableAdd = true;
 			} else if (firstSelectedObject
 				enableAdd = true;
 			}
 		}
 
 		// Remove button
 
 		// Up and Down buttons
 		boolean canMoveUp = true;
 		boolean canMoveDown = true;
 		if (firstSelectedObject == null
 				|| firstSelectedObject.getType() == .
 				|| firstSelectedObject.getType() == .
 				|| selection.size() > 1) {
 			canMoveUp = false;
 			canMoveDown = false;
 		} else {
 			CtxHelpObject parent = firstSelectedObject.getParent();
 			if (parent != null) {
 				int index = parent.indexOf(firstSelectedObject);
 				if (index == 0) {
 					canMoveUp = false;
 				}
 				if (index >= parent.getChildCount() - 1) {
 					canMoveDown = false;
 				}
 			}
 		}
 	}
 
 	/*
 	 * (non-Javadoc)
 	 * 
 	 * @see
 	 * org.eclipse.pde.internal.ui.editor.StructuredViewerSection#fillContextMenu
 	 * (org.eclipse.jface.action.IMenuManager)
 	 */
 	protected void fillContextMenu(IMenuManager manager) {
 		Object object = selection.getFirstElement();
 		// Has to be null or a CtxHelpObject object
 		CtxHelpObject firstSelectedObject = (CtxHelpObjectobject;
 
 		// Populate the "New" sub-menu
 		if (firstSelectedObject != null) {
 			MenuManager submenu = new MenuManager(
 			boolean addMenu = false;
 			if (updateAddContextActionWithSelection(firstSelectedObject)) {
 				addMenu = true;
 			}
 			if (updateAddTopicActionWithSelection(firstSelectedObject)) {
 				submenu.add();
 				addMenu = true;
 			}
 			if (updateAddCommandActionWithSelection(firstSelectedObject)) {
 				addMenu = true;
 			}
 			if (addMenu) {
 				manager.add(submenu);
 				manager.add(new Separator());
 			}
 		}
 
 		// Add the open link and show in actions
 		if (firstSelectedObject instanceof CtxHelpTopic
 				&& ((CtxHelpTopicfirstSelectedObject).getLocation() != null) {
 			.setTarget((CtxHelpTopicfirstSelectedObject);
 			manager.add();
 			manager.add(new Separator());
 		}
 
 		// Add clipboard actions
 		manager.add(new Separator());
 
 		// Add remove action
 		if (updateRemoveActionWithSelection(selection)) {
 			manager.add(new Separator());
 		}
 
 	}

Creates and a new submenu in the given menu manager and adds actions to allow a linked file to be opened in various views.

Parameters:
manager menu manager to add the submenu to
 
 	private void fillContextMenuShowInAction(IMenuManager manager) {
 
 		// Add a label for the keybinding for Show In action, if one exists
 		IBindingService bindingService = (IBindingService) PlatformUI
 		if (bindingService != null) {
 			String keyBinding = bindingService
 					.getBestActiveBindingFormattedFor("org.eclipse.ui.navigate.showInQuickMenu"); //$NON-NLS-1$
 			if (keyBinding != null) {
 				showInLabel += '\t' + keyBinding;
 			}
 		}
 
 		IMenuManager showInMenu = new MenuManager(showInLabel);
 
 		manager.add(showInMenu);
 	}

Updates the add context action if the action should be available for the selection. Updates enablement, parent object and target object. Returns true if the action should be available to the selection.

Parameters:
selectedObject selected object
Returns:
true if the action should be available for the current selection, false otherwise
 
 			CtxHelpObject selectedObject) {
 		if (selectedObject != null
 			return true;
 		} else if (selectedObject != null
 				&& selectedObject.canAddChild(.)) {
 			return true;
 			return true;
 		}
 		return false;
 	}

Updates the add topic action if the action should be available for the selection. Updates enablement, parent object and target object. Returns true if the action should be available to the selection.

Parameters:
selectedObject selected object
Returns:
true if the action should be available for the current selection, false otherwise
 
 			CtxHelpObject selectedObject) {
 		if (selectedObject != null) {
 			if (selectedObject.canAddSibling(.)) {
 				return true;
 			} else if (selectedObject.canAddChild(.)) {
 				return true;
 			}
 		}
 		return false;
 	}

Updates the add topic action if the action should be available for the selection. Updates enablement, parent object and target object. Returns true if the action should be available to the selection.

Parameters:
selectedObject selected object
Returns:
true if the action should be available for the current selection, false otherwise
 
 			CtxHelpObject selectedObject) {
 		if (selectedObject != null) {
 			if (selectedObject.canAddSibling(.)) {
 				return true;
 			} else if (selectedObject
 				return true;
 			}
 		}
 		return false;
 	}

Updates the remove action if the action should be available for the selection. Updates enablement, parent object and target object. Returns true if the action should be available to the selection.

Parameters:
selectedObject selected object
Returns:
true if the action should be available for the current selection, false otherwise
 
 			IStructuredSelection selection) {
 		List objectsToRemove = getRemovableObjectFromSelection(selection);
 				.toArray(new CtxHelpObject[objectsToRemove.size()]));
 		return objectsToRemove.size() > 0;
 	}

Returns a list of objects that is the subset of objects in the selection that can be removed.

Parameters:
selection the selection
Returns:
list of CtxHelpObjects that can be removed, possibly empty.
 
 		List objectsToRemove = new ArrayList();
 		for (Iterator iterator = selection.iterator(); iterator.hasNext();) {
 			Object currentObject = iterator.next();
 			if (currentObject instanceof CtxHelpObject
 					&& ((CtxHelpObjectcurrentObject).canBeRemoved()) {
 				objectsToRemove.add(currentObject);
 			}
 		}
 		return objectsToRemove;
 	}
 
 	/*
 	 * (non-Javadoc)
 	 * 
 	 * @see
 	 * org.eclipse.pde.internal.ui.editor.PDESection#doGlobalAction(java.lang
 	 * .String)
 	 */
 	public boolean doGlobalAction(String actionId) {
 		boolean cutAction = actionId.equals(..getId());
 
 		if (cutAction || actionId.equals(..getId())) {
 			return !cutAction;
 		}
 
 		if (actionId.equals(..getId())) {
 			return true;
 		}
 
 		return false;
 	}
 
 	/*
 	 * (non-Javadoc)
 	 * 
 	 * @see
 	 * org.eclipse.pde.internal.ui.editor.StructuredViewerSection#canPaste(java
 	 * .lang.Object, java.lang.Object[])
 	 */
 	protected boolean canPaste(Object targetObjectObject[] sourceObjects) {
 		return canDropCopy(targetObjectsourceObjects,
 	}
 
 	/*
 	 * (non-Javadoc)
 	 * 
 	 * @see
 	 * org.eclipse.pde.internal.ui.editor.StructuredViewerSection#doPaste(java
 	 * .lang.Object, java.lang.Object[])
 	 */
 	protected void doPaste(Object targetObjectObject[] sourceObjects) {
 		doDropCopy(targetObjectsourceObjects.);
 	}
 
 	/*
 	 * (non-Javadoc)
 	 * 
 	 * @see
 	 * org.eclipse.pde.internal.ui.editor.TreeSection#handleDoubleClick(org.
 	 * eclipse.jface.viewers.IStructuredSelection)
 	 */
 	protected void handleDoubleClick(IStructuredSelection selection) {
 		Object selected = selection.getFirstElement();
 		if (selected instanceof CtxHelpTopic) {
 			open((CtxHelpTopicselected);
 		} else if (selected instanceof CtxHelpObject) {
 			.setExpandedState(selected, !.getExpandedState(selected));
 		}
 	}

Opens the file that is linked in the given topic.

Parameters:
topic the topic containing a link to a file
 
 	public void open(CtxHelpTopic topic) {
 		IPath resourcePath = topic.getLocation();
 		if (!isEditable() || resourcePath == null || resourcePath.isEmpty()) {
 			MessageDialog.openWarning(
 					PDEUserAssistanceUIPlugin.getActiveWorkbenchShell(),
 			return;
 		}
 
 				.findMember(resourcePath);
 		if (resource != null && resource instanceof IFile) {
 			IPath path = resource.getFullPath();
 			if (HelpEditorUtil.hasValidPageExtension(path)) {
 				try {
 					IDE.openEditor(PDEUserAssistanceUIPlugin.getActivePage(),
 							(IFileresourcetrue);
 				} catch (PartInitException e) { // suppress exception
 				}
 			} else {
 				MessageDialog.openWarning(
 						PDEUserAssistanceUIPlugin.getActiveWorkbenchShell(),
 			}
 		} else {
 			MessageDialog.openWarning(
 					PDEUserAssistanceUIPlugin.getActiveWorkbenchShell(),
 		}
 	}
 
 	/*
 	 * (non-Javadoc)
 	 * 
 	 * @see
 	 * org.eclipse.pde.internal.ui.editor.StructuredViewerSection#buttonSelected
 	 * (int)
 	 */
 	protected void buttonSelected(int index) {
 		Object object = selection.getFirstElement();
 		CtxHelpObject firstSelectedObject = (CtxHelpObjectobject;
 		switch (index) {
 			break;
 			updateAddTopicActionWithSelection(firstSelectedObject);
 			break;
 			break;
 			break;
 		case :
 			break;
 			break;
 		}
 	}

Move an object within the structure.

Parameters:
positionFlag The direction that the object will move, either F_UP_FLAG or F_DOWN_FLAG
 
 	private void handleMoveAction(int positionFlag) {
 
 		Object object = sel.getFirstElement();
 		if (object == null) {
 			return;
 		} else if (object instanceof CtxHelpObject) {
 			CtxHelpObject ctxHelpObject = (CtxHelpObjectobject;
 			CtxHelpObject parent = ctxHelpObject.getParent();
 			if (parent != null) {
 				parent.moveChild(ctxHelpObjectpositionFlag);
 				.setSelection(new StructuredSelection(ctxHelpObject), true);
 			}
 		}
 
 	}
 
 	/*
 	 * (non-Javadoc)
 	 * 
 	 * @see org.eclipse.ui.forms.AbstractFormPart#dispose()
 	 */
 	public void dispose() {
 		PDEUserAssistanceUIPlugin.getDefault().getLabelProvider()
 				.disconnect(this);
 		super.dispose();
 	}
 
 	/*
 	 * (non-Javadoc)
 	 * 
 	 * @see org.eclipse.pde.internal.ui.editor.StructuredViewerSection#
 	 * isDragAndDropEnabled()
 	 */
 	protected boolean isDragAndDropEnabled() {
 		return true;
 	}
 
 	/*
 	 * (non-Javadoc)
 	 * 
 	 * @see org.eclipse.pde.internal.ui.editor.StructuredViewerSection#
 	 * getSupportedDNDOperations()
 	 */
 	public int getSupportedDNDOperations() {
 		return DND.DROP_MOVE | DND.DROP_COPY;
 	}
 
 	/*
 	 * (non-Javadoc)
 	 * 
 	 * @see
 	 * org.eclipse.pde.internal.ui.editor.StructuredViewerSection#doDropCopy
 	 * (java.lang.Object, java.lang.Object[], int)
 	 */
 	public void doDropCopy(Object targetObjectObject[] sourceObjects,
 			int targetLocation) {
 		if ( != null) {
 			if ( != null) {
 				if (targetLocation == .) {
 					for (int i = 0; i < sourceObjects.lengthi++) {
 						((CtxHelpObjectsourceObjects[i]).reconnect(
 								(CtxHelpObjectsourceObjects[i],
 					}
 				} else {
 					for (int i = sourceObjects.length - 1; i >= 0; i--) {
 						((CtxHelpObjectsourceObjects[i]).reconnect(
 								(CtxHelpObjectsourceObjects[i],
 					}
 				}
 			} else {
 				for (int i = 0; i < sourceObjects.lengthi++) {
 					((CtxHelpObjectsourceObjects[i]).reconnect(
 							.addChild((CtxHelpObjectsourceObjects[i]);
 				}
 			}
 		}
 	}
 
 	/*
 	 * (non-Javadoc)
 	 * 
 	 * @see
 	 * org.eclipse.pde.internal.ui.editor.StructuredViewerSection#doDropMove
 	 * (java.lang.Object, java.lang.Object[], int)
 	 */
 	public void doDropMove(Object targetObjectObject[] sourceObjects,
 			int targetLocation) {
 		doDropCopy(targetObjectsourceObjectstargetLocation);
 	}
 
 	/*
 	 * (non-Javadoc)
 	 * 
 	 * @see
 	 * org.eclipse.pde.internal.ui.editor.StructuredViewerSection#canDropCopy
 	 * (java.lang.Object, java.lang.Object[], int)
 	 */
 	public boolean canDropCopy(Object targetObjectObject[] sourceObjects,
 			int targetLocation) {
 		// Add as a child of the root
 		if (targetObject == null
 				|| !(targetObject instanceof CtxHelpObject || ((CtxHelpObjecttargetObject)
 			for (int i = 0; i < sourceObjects.lengthi++) {
 				if (!(sourceObjects[iinstanceof CtxHelpObject)
 								((CtxHelpObjectsourceObjects[i]).getType())) {
 					return false;
 				}
 			}
 			return true;
 		}
 
 		CtxHelpObject dropTarget = (CtxHelpObjecttargetObject;
 
 		// Add as a child of the target
 		if (targetLocation == .) {
 			boolean result = true;
 			for (int i = 0; i < sourceObjects.lengthi++) {
 				if (!(sourceObjects[iinstanceof CtxHelpObject)
 						|| !dropTarget
 								.canAddChild(((CtxHelpObjectsourceObjects[i])
 										.getType())) {
 					result = false;
 					break;
 				}
 			}
 			// If adding as a child works, do so, otherwise try as a sibling
 			if (result) {
 				 = dropTarget;
 				return true;
 			}
 		}
 
 		// Add as a sibling of the target
 		for (int i = 0; i < sourceObjects.lengthi++) {
 			if (!(sourceObjects[iinstanceof CtxHelpObject)
 					|| !dropTarget
 							.canAddSibling(((CtxHelpObjectsourceObjects[i])
 									.getType())) {
 				return false;
 			}
 		}
 		 = dropTarget.getParent();
 		 = dropTarget;
 		return true;
 	}
 
 	/*
 	 * (non-Javadoc)
 	 * 
 	 * @see
 	 * org.eclipse.pde.internal.ui.editor.StructuredViewerSection#canDropMove
 	 * (java.lang.Object, java.lang.Object[], int)
 	 */
 	public boolean canDropMove(Object targetObjectObject[] sourceObjects,
 			int targetLocation) {
 		// Same as drop copy operation
 		return canDropCopy(targetObjectsourceObjectstargetLocation);
 	}
 
 	/*
 	 * (non-Javadoc)
 	 * 
 	 * @see
 	 * org.eclipse.pde.internal.ui.editor.StructuredViewerSection#canDragCopy
 	 * (java.lang.Object[])
 	 */
 	public boolean canDragCopy(Object[] sourceObjects) {
 		// Allow anything to be drag copied
 		return true;
 	}
 
 	/*
 	 * (non-Javadoc)
 	 * 
 	 * @see
 	 * org.eclipse.pde.internal.ui.editor.StructuredViewerSection#canDragMove
 	 * (java.lang.Object[])
 	 */
 	public boolean canDragMove(Object[] sourceObjects) {
 		for (int i = 0; i < sourceObjects.lengthi++) {
 			if (!(sourceObjects[iinstanceof CtxHelpObject)
 					|| !((CtxHelpObjectsourceObjects[i]).canBeRemoved()) {
 				return false;
 			}
 		}
 		 = true;
 		return true;
 	}
 
 	/*
 	 * (non-Javadoc)
 	 * 
 	 * @see
	 * org.eclipse.pde.internal.ui.editor.StructuredViewerSection#doDragRemove
	 * (java.lang.Object[])
	 */
	public void doDragRemove(Object[] sourceObjects) {
		 = false;
	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * org.eclipse.pde.internal.ui.editor.PDESection#modelChanged(org.eclipse
	 * .pde.core.IModelChangedEvent)
	 */
	public void modelChanged(IModelChangedEvent event) {
		// No need to call super, world changed event handled here
else if (event.getChangeType() == .) {
else if (event.getChangeType() == .) {
else if ((event.getChangeType() == .)
else if (event.getChangeType() == .) {
	}

Handles the swap event

Parameters:
event the swap event
		Object[] objects = event.getChangedObjects();
		CtxHelpObject object = (CtxHelpObjectobjects[0];
		if (object != null) {
			.refresh(object);
	}

The model is stale, refresh the UI

Parameters:
event The world-change event
	}

Handle insertions in the model

Parameters:
event the insertion event
		Object[] objects = event.getChangedObjects();
		for (int i = 0; i < objects.lengthi++) {
			if (objects[iinstanceof CtxHelpObject) {
				CtxHelpObject object = (CtxHelpObjectobjects[i];
				if (object.getType() != .) {
					// Select the new object in the tree, unless it is a
					// description node
					if (!(object instanceof CtxHelpDescription)) {
								true);
	}

Handle removals in the model

Parameters:
event the removal event
		Object[] objects = event.getChangedObjects();
		for (int i = 0; i < objects.lengthi++) {
			if (objects[iinstanceof CtxHelpObject) {
				CtxHelpObject object = (CtxHelpObjectobjects[i];
				.remove(object);
				if (nextSelection != null) {
								nextSelection), true);
	}

Handle an update to an object's properties

Parameters:
event the update event
		Object[] objects = event.getChangedObjects();
		if (objects[0] != null) {
			.update(objects[0], null);