Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright (c) 2006, 2008 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 /
 
 
 package org.eclipse.pde.internal.ua.ui.editor.cheatsheet.comp;
 
 import java.util.List;
 
 
 public class CompCSFormOutlinePage extends FormOutlinePage {

Parameters:
editor
 
 	public CompCSFormOutlinePage(PDEFormEditor editor) {
 		super(editor);
 	}

CompCSLabelProvider
 
 	private class CompCSLabelProvider extends BasicLabelProvider {
 			super(ilp);
 		}
 
 		public String getText(Object obj) {
 			if (obj instanceof ICompCSObject) {
 				return getObjectText((ICompCSObjectobj);
 			}
 			return super.getText(obj);
 		}
 	}

Parameters:
obj
Returns:
 
 	protected String getObjectText(ICompCSObject obj) {
 		int limit = 50;
 
 			limit = 30;
 		} else if (obj.getType() == .) {
 			limit = 26;
 		} else if (obj.getType() == .) {
 			limit = 22;
 		}
 
 		return PDETextHelper.truncateAndTrailOffText(PDETextHelper.translateReadText(obj.getName()), limit);
 	}
 
 	/* (non-Javadoc)
 	 * @see org.eclipse.pde.internal.ui.editor.FormOutlinePage#getChildren(java.lang.Object)
 	 */
 	protected Object[] getChildren(Object parent) {
 		if (parent instanceof CompCSPage) {
 			if ((cheatsheet != null) && cheatsheet.isLoaded()) {
 				Object[] list = new Object[1];
 				list[0] = cheatsheet.getCompCS();
 				return list;
 			}
 		} else if (parent instanceof ICompCSObject) {
 			List list = ((ICompCSObjectparent).getChildren();
 			// List is never null
 			if (list.size() > 0) {
 				return list.toArray();
 			}
 		}
 		return super.getChildren(parent);
 	}
 
 	/* (non-Javadoc)
 	 * @see org.eclipse.pde.internal.ui.editor.FormOutlinePage#createLabelProvider()
 	 */
 		return new CompCSLabelProvider(PDEUserAssistanceUIPlugin.getDefault().getLabelProvider());
 	}
 
 	/* (non-Javadoc)
 	 * @see org.eclipse.pde.internal.ui.editor.FormOutlinePage#getParentPageId(java.lang.Object)
 	 */
	protected String getParentPageId(Object item) {
	}
New to GrepCode? Check out our FAQ X