本文整理匯總了Java中org.eclipse.jface.viewers.TreeViewer.getControl方法的典型用法代碼示例。如果您正苦於以下問題:Java TreeViewer.getControl方法的具體用法?Java TreeViewer.getControl怎麽用?Java TreeViewer.getControl使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.eclipse.jface.viewers.TreeViewer
的用法示例。
在下文中一共展示了TreeViewer.getControl方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: configureDragAndDrop
import org.eclipse.jface.viewers.TreeViewer; //導入方法依賴的package包/類
protected void configureDragAndDrop(DragAndDropConfiguration dragAndDropConfiguration, TreeViewer treeViewer) {
// drop
Transfer[] transferTypes = new Transfer[] { LocalSelectionTransfer.getTransfer() };
int operations = dragAndDropConfiguration.getSupportedDropOperations(this);
DropTarget target = new DropTarget(treeViewer.getControl(), operations);
target.setTransfer(transferTypes);
// Drop listeners pour le drop des elements sur l'arbre
SchemaViewerDropPolicy dropPolicy = dragAndDropConfiguration.getDropPolicy(this);
DnDTargetListener targetListener = new DnDTargetListener(this, nodeConverter, dropPolicy);
target.addDropListener(targetListener);
// Drag listener pour le drag des elements de l'arbre
DragSourceListener sourceListener = new DnDSourceListener(this);
operations = DND.DROP_MOVE | DND.DROP_COPY | DND.DROP_DEFAULT;
transferTypes = new Transfer[] { LocalSelectionTransfer.getTransfer() };
treeViewer.addDragSupport(operations, transferTypes, sourceListener);
}
示例2: rebuild
import org.eclipse.jface.viewers.TreeViewer; //導入方法依賴的package包/類
public void rebuild(BatchScriptModel model) {
if (model == null) {
return;
}
contentProvider.rebuildTree(model);
TreeViewer treeViewer = getTreeViewer();
if (treeViewer != null) {
Control control = treeViewer.getControl();
if (control == null || control.isDisposed()){
return;
}
treeViewer.setInput(model);
}
}
示例3: rebuild
import org.eclipse.jface.viewers.TreeViewer; //導入方法依賴的package包/類
public void rebuild(BashScriptModel model) {
if (model == null) {
return;
}
contentProvider.rebuildTree(model);
TreeViewer treeViewer = getTreeViewer();
if (treeViewer != null) {
Control control = treeViewer.getControl();
if (control == null || control.isDisposed()){
return;
}
treeViewer.setInput(model);
}
}
示例4: redraw
import org.eclipse.jface.viewers.TreeViewer; //導入方法依賴的package包/類
public void redraw() {
TreeViewer viewer = getTreeViewer();
if (viewer != null) {
Control control = viewer.getControl();
if ((control != null) && (!control.isDisposed())) {
control.setRedraw(false);
viewer.expandAll();
control.setRedraw(true);
}
}
}
示例5: createPartControl
import org.eclipse.jface.viewers.TreeViewer; //導入方法依賴的package包/類
@Override
public void createPartControl(Composite parent) {
FillLayout fillLayout = new FillLayout(SWT.VERTICAL);
fillLayout.marginHeight = 5;
fillLayout.marginWidth = 5;
parent.setLayout(fillLayout);
// main container
container = new Composite(parent, SWT.BORDER);
container.setLayout(new FillLayout());
// create container for stack trace data
Composite stacktraceDataContainer = new Composite(parent, SWT.BORDER);
FormLayout formLayout = new FormLayout();
formLayout.marginHeight = 5;
formLayout.marginWidth = 5;
formLayout.spacing = 5;
stacktraceDataContainer.setLayout(formLayout);
Composite stackLabelContainer = new Composite(stacktraceDataContainer, SWT.NO_SCROLL | SWT.SHADOW_NONE);
stackLabelContainer.setLayout(new GridLayout());
FormData stackLabelFormData = new FormData();
stackLabelFormData.top = new FormAttachment(0);
stackLabelFormData.left = new FormAttachment(0);
stackLabelFormData.right = new FormAttachment(100);
stackLabelFormData.bottom = new FormAttachment(20);
stackLabelContainer.setLayoutData(stackLabelFormData);
Composite stackTraceContainer = new Composite(stacktraceDataContainer, SWT.NO_SCROLL | SWT.SHADOW_NONE);
stackTraceContainer.setLayout(new FillLayout());
FormData stackTraceFormData = new FormData();
stackTraceFormData.top = new FormAttachment(stackLabelContainer);
stackTraceFormData.left = new FormAttachment(0);
stackTraceFormData.right = new FormAttachment(100);
stackTraceFormData.bottom = new FormAttachment(100);
stackTraceContainer.setLayoutData(stackTraceFormData);
// Create viewer for test tree in main container
testTreeViewer = new TreeViewer(container);
testTreeViewer.setContentProvider(new XpectContentProvider());
testTreeViewer.setLabelProvider(new XpectLabelProvider(this.testsExecutionStatus));
testTreeViewer.setInput(null);
// create stack trace label
stacktraceLabel = new Label(stackLabelContainer, SWT.SHADOW_OUT);
FontData fontData = stacktraceLabel.getFont().getFontData()[0];
Display display = Display.getCurrent();
// may be null if outside the UI thread
if (display == null)
display = Display.getDefault();
Font font = new Font(display, new FontData(fontData.getName(), fontData
.getHeight(), SWT.BOLD));
// Make stack trace label bold
stacktraceLabel.setFont(font);
stacktraceLabel.setText(NO_TRACE_MSG);
// create stack trace console
MessageConsole messageConsole = new MessageConsole("trace", null);
stacktraceConsole = new TraceConsole(messageConsole);
stacktraceConsoleViewer = new TextConsoleViewer(stackTraceContainer, messageConsole);
// context menu
getSite().setSelectionProvider(testTreeViewer);
MenuManager contextMenu = new MenuManager();
contextMenu.setRemoveAllWhenShown(true);
getSite().registerContextMenu(contextMenu, testTreeViewer);
Control control = testTreeViewer.getControl();
Menu menu = contextMenu.createContextMenu(control);
control.setMenu(menu);
activateContext();
createSelectionActions();
}