blob: 68320af1fab1b2e2fdc8ed1b9ee1239def2a452f [file] [log] [blame]
/*
* Copyright (c) 2002 IBM Corp. All rights reserved.
* This file is made available under the terms of the Common Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/cpl-v10.html
*/
package org.eclipse.pde.internal.ui.editor;
import org.eclipse.swt.widgets.*;
import org.eclipse.update.ui.forms.internal.FormWidgetFactory;
import org.eclipse.pde.internal.ui.parts.*;
import org.eclipse.pde.core.*;
import org.eclipse.pde.core.IModel;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.swt.layout.GridLayout;
/**
* @version 1.0
* @author
*/
public abstract class TreeSection extends StructuredViewerSection {
protected boolean handleDefaultButton=true;
class PartAdapter extends TreePart {
public PartAdapter(String[] buttonLabels) {
super(buttonLabels);
}
public void selectionChanged(IStructuredSelection selection) {
TreeSection.this.selectionChanged(selection);
}
public void handleDoubleClick(IStructuredSelection selection) {
TreeSection.this.handleDoubleClick(selection);
}
public void buttonSelected(Button button, int index) {
TreeSection.this.buttonSelected(index);
if (handleDefaultButton)
button.getShell().setDefaultButton(null);
}
}
/**
* Constructor for TableSection.
* @param formPage
*/
public TreeSection(PDEFormPage formPage, String[] buttonLabels) {
super(formPage, buttonLabels);
}
protected StructuredViewerPart createViewerPart(String[] buttonLabels) {
return new PartAdapter(buttonLabels);
}
protected TreePart getTreePart() {
return (TreePart) viewerPart;
}
protected void selectionChanged(IStructuredSelection selection) {
}
protected void handleDoubleClick(IStructuredSelection selection) {
}
}