Package org.springframework.ide.eclipse.beans.ui.livegraph.views

Source Code of org.springframework.ide.eclipse.beans.ui.livegraph.views.InnerBeansViewerFilter

/*******************************************************************************
*  Copyright (c) 2012 VMware, Inc.
*  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:
*      VMware, Inc. - initial API and implementation
*******************************************************************************/
package org.springframework.ide.eclipse.beans.ui.livegraph.views;

import org.eclipse.jface.viewers.Viewer;
import org.eclipse.jface.viewers.ViewerFilter;
import org.springframework.ide.eclipse.beans.ui.livegraph.model.LiveBean;
import org.springframework.ide.eclipse.beans.ui.livegraph.model.LiveBeanRelation;

/**
* @author Leo Dos Santos
*/
public class InnerBeansViewerFilter extends ViewerFilter {

  @Override
  public boolean select(Viewer viewer, Object parentElement, Object element) {
    if (element instanceof LiveBean) {
      LiveBean bean = (LiveBean) element;
      return !bean.isInnerBean();
    }
    else if (element instanceof LiveBeanRelation) {
      LiveBeanRelation bean = (LiveBeanRelation) element;
      return !bean.isInnerBean();
    }
    return true;
  }

}
TOP

Related Classes of org.springframework.ide.eclipse.beans.ui.livegraph.views.InnerBeansViewerFilter

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.