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.simple;
 
 import java.util.List;
 
 
 public class SimpleCSFormOutlinePage extends FormOutlinePage {

Parameters:
editor
 
 		super(editor);
 	}

SimpleCSLabelProvider
 
 	public class SimpleCSLabelProvider extends BasicLabelProvider {
 			super(ilp);
 		}
 
 		public String getText(Object obj) {
 			if (obj instanceof ISimpleCSObject) {
 				return getObjectText((ISimpleCSObjectobj);
 			}
 			return super.getText(obj);
 		}
 	}

Parameters:
obj
Returns:
 
 	protected String getObjectText(ISimpleCSObject obj) {
 		int limit = 50;
 
 			limit = 30;
 		} else if (obj.getType() == .) {
 			limit = 26;
 		} 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 SimpleCSDefinitionPage) {
 			if ((cheatsheet != null) && cheatsheet.isLoaded()) {
 				Object[] list = new Object[1];
 				list[0] = cheatsheet.getSimpleCS();
 				return list;
 			}
 		} else if (parent instanceof ISimpleCSObject) {
 			List list = ((ISimpleCSObjectparent).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 SimpleCSLabelProvider(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