/*
* Carrot2 project.
*
* Copyright (C) 2002-2016, Dawid Weiss, Stanisław Osiński.
* All rights reserved.
*
* Refer to the full license file "carrot2.LICENSE"
* in the root folder of the repository checkout or at:
* http://www.carrot2.org/carrot2.LICENSE
*/
package org.carrot2.workbench.core.ui;
import org.carrot2.core.Cluster;
import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.ui.part.ViewPart;
/**
* A {@link ViewPart} displaying document list from the currently active
* {@link SearchEditor} or a cluster list from the current selection of {@link Cluster}s.
*/
public final class DocumentListView extends PageBookViewBase
{
/**
* Public identifier of this view.
*/
public static final String ID = "org.carrot2.workbench.core.views.documents";
/**
* Create a document list for the given part.
*/
@Override
protected PageRec doCreatePage(IWorkbenchPart part)
{
final SearchEditor editor = (SearchEditor) part;
final DocumentListPage page = new DocumentListPage(editor);
initPage(page);
page.createControl(getPageBook());
return new PageRec(part, page);
}
/**
* Only react to {@link SearchEditor} instances.
*/
@Override
protected boolean isImportant(IWorkbenchPart part)
{
return part instanceof SearchEditor;
}
}