Search in sources :

Example 1 with ILogViewerView

use of org.eclipse.titan.log.viewer.views.ILogViewerView in project titan.EclipsePlug-ins by eclipse.

the class ActionUtils method closeView.

private static void closeView(IFile file, IWorkbenchPage activePage, IViewReference reference) {
    IViewPart view = reference.getView(false);
    // a restored view with faulty content
    if (view == null) {
        activePage.hideView(reference);
        return;
    }
    if (!(view instanceof ILogViewerView)) {
        return;
    }
    final ILogViewerView logViewerView = (ILogViewerView) view;
    final LogFileMetaData metadata = logViewerView.getLogFileMetaData();
    if (metadata == null) {
        activePage.hideView(reference);
        return;
    }
    if (file.getLocationURI().equals(metadata.getFilePath())) {
        if (logViewerView instanceof DetailsView) {
            ((DetailsView) logViewerView).setData(null, false);
        }
        activePage.hideView(reference);
    }
}
Also used : IViewPart(org.eclipse.ui.IViewPart) ILogViewerView(org.eclipse.titan.log.viewer.views.ILogViewerView) DetailsView(org.eclipse.titan.log.viewer.views.DetailsView) LogFileMetaData(org.eclipse.titan.log.viewer.models.LogFileMetaData)

Example 2 with ILogViewerView

use of org.eclipse.titan.log.viewer.views.ILogViewerView in project titan.EclipsePlug-ins by eclipse.

the class ActionUtils method closeView.

private static void closeView(IProject project, IWorkbenchPage activePage, IViewReference reference, IViewPart view) {
    // a restored view with faulty content
    if (view == null) {
        activePage.hideView(reference);
        return;
    }
    if (!(view instanceof ILogViewerView)) {
        return;
    }
    final ILogViewerView logViewerView = (ILogViewerView) view;
    final LogFileMetaData metaData = logViewerView.getLogFileMetaData();
    if (metaData == null) {
        activePage.hideView(reference);
        return;
    }
    if (project.getName().equals(metaData.getProjectName())) {
        activePage.hideView(reference);
    }
}
Also used : ILogViewerView(org.eclipse.titan.log.viewer.views.ILogViewerView) LogFileMetaData(org.eclipse.titan.log.viewer.models.LogFileMetaData)

Aggregations

LogFileMetaData (org.eclipse.titan.log.viewer.models.LogFileMetaData)2 ILogViewerView (org.eclipse.titan.log.viewer.views.ILogViewerView)2 DetailsView (org.eclipse.titan.log.viewer.views.DetailsView)1 IViewPart (org.eclipse.ui.IViewPart)1