| /****************************************************************************** |
| * Copyright (c) 2005 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.gmf.runtime.diagram.ui.view.factories; |
| |
| import java.util.List; |
| |
| import org.eclipse.gmf.runtime.notation.NotationFactory; |
| import org.eclipse.gmf.runtime.notation.View; |
| |
| /** |
| * This is the bas factory class for all List compartment views, it will |
| * create the view and decorate it using the default decorations |
| * you can subclass it to add more decorations, or customize the |
| * way it looks, like adding new style |
| * @see #createView(IAdaptable, View, String, int, boolean, String) |
| * @see #decorateView(View, View, IAdaptable, String, int, boolean) |
| * @see #createStyles(View) |
| * @author mmostafa |
| * |
| */ |
| public class ListCompartmentViewFactory extends ResizableCompartmentViewFactory { |
| |
| |
| /** |
| * this method is called by @link #createView(IAdaptable, View, String, int, boolean) to |
| * create the styles for the view that will be created, you can override this |
| * method in you factory sub class to provide additional styles |
| * @return a list of style for the newly created view or an empty list if none (do not return null) |
| */ |
| protected List createStyles(View view) { |
| List styles = super.createStyles(view); |
| styles.add(NotationFactory.eINSTANCE.createSortingStyle()); |
| styles.add(NotationFactory.eINSTANCE.createFilteringStyle()); |
| return styles; |
| } |
| } |