blob: 509e20d91129ed65b943ba3a4053a7d3ea3e8192 [file] [log] [blame]
/*
* Copyright (c) 2014 Eike Stepper (Berlin, Germany) 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:
* Eike Stepper - initial API and implementation
*/
package org.eclipse.oomph.p2.internal.ui;
import org.eclipse.oomph.p2.core.Agent;
import org.eclipse.oomph.p2.core.AgentManager;
import org.eclipse.oomph.p2.core.BundlePool;
import org.eclipse.oomph.p2.core.Profile;
import org.eclipse.jface.viewers.ViewerSorter;
/**
* @author Eike Stepper
*/
public class P2ViewerSorter extends ViewerSorter
{
@Override
public int category(Object element)
{
if (element instanceof AgentManager)
{
return 0;
}
if (element instanceof Agent)
{
return 1;
}
if (element instanceof BundlePool)
{
return 2;
}
if (element instanceof Profile)
{
return 3;
}
return 4;
}
}