blob: abb6a6c635cbc5ed5997931436bb07a7889d35f0 [file] [log] [blame]
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
*
* Copyright 2003, 2007 Fraunhofer Gesellschaft, Munich, Germany,
* for its Fraunhofer Institute and Computer Architecture and Software
* Technology (FIRST), Berlin, Germany and Technical University Berlin,
* Germany.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
* Please visit http://www.objectteams.org for updates and contact.
*
* Contributors:
* Fraunhofer FIRST - Initial API and implementation
* Technical University Berlin - Initial API and implementation
**********************************************************************/
package org.eclipse.objectteams.otdt.debug.ui.internal.model;
import org.eclipse.debug.internal.ui.elements.adapters.VariableColumnPresentation;
import org.eclipse.debug.internal.ui.viewers.model.provisional.IColumnPresentation;
import org.eclipse.debug.internal.ui.viewers.model.provisional.IColumnPresentationFactory;
import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext;
import org.eclipse.debug.ui.IDebugUIConstants;
import org.eclipse.objectteams.otdt.debug.OTDebugElementsContainer;
import org.eclipse.objectteams.otdt.debug.ui.OTDebugUIPlugin;
/**
* Factory for default variable column presentation.
* (from VariableColumnFactoryAdaptor (since 3.2))
*
* @since 1.1.2
*/
@SuppressWarnings("restriction") // team view as variant of variables view needs access to internals
public class OTVariableColumnFactoryAdapter implements IColumnPresentationFactory {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.provisional.IColumnPresenetationFactoryAdapter#createColumnPresentation(org.eclipse.debug.internal.ui.viewers.provisional.IPresentationContext, java.lang.Object)
*/
public IColumnPresentation createColumnPresentation(IPresentationContext context, Object element) {
String id = context.getId();
if (OTDebugUIPlugin.TEAM_VIEW_ID.equals(id)) {
if (element instanceof OTDebugElementsContainer) {
return new VariableColumnPresentation();
}
}
return null;
}
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.provisional.IColumnPresenetationFactoryAdapter#getColumnPresentationId(org.eclipse.debug.internal.ui.viewers.provisional.IPresentationContext, java.lang.Object)
*/
public String getColumnPresentationId(IPresentationContext context, Object element) {
String id = context.getId();
if (OTDebugUIPlugin.TEAM_VIEW_ID.equals(id)) {
if (element instanceof OTDebugElementsContainer) {
return IDebugUIConstants.COLUMN_PRESENTATION_ID_VARIABLE;
}
}
return null;
}
}