org.eclipse.swt.widgets.Tree.getParent()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(5.1k)|赞(0)|评价(0)|浏览(156)

本文整理了Java中org.eclipse.swt.widgets.Tree.getParent()方法的一些代码示例,展示了Tree.getParent()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Tree.getParent()方法的具体详情如下:
包路径:org.eclipse.swt.widgets.Tree
类名称:Tree
方法名:getParent

Tree.getParent介绍

[英]Returns the receiver's parent item, which must be a TreeItem or null when the receiver is a root.
[中]返回接收者的父项,当接收者是根时,父项必须是TreeItem或null。

代码示例

代码示例来源:origin: org.eclipse.platform/org.eclipse.compare

/**
 * Creates a new viewer for the given SWT tree control with the specified configuration.
 *
 * @param tree the tree control
 * @param configuration the configuration for this viewer
 */
public StructureDiffViewer(Tree tree, CompareConfiguration configuration) {
  super(tree, configuration);
  Composite c= tree.getParent();
  if (c instanceof CompareViewerSwitchingPane)
    fParent= (CompareViewerSwitchingPane) c;
  initialize();
}

代码示例来源:origin: org.eclipse/org.eclipse.compare

/**
 * Creates a new viewer for the given SWT tree control with the specified configuration.
 *
 * @param tree the tree control
 * @param configuration the configuration for this viewer
 */
public StructureDiffViewer(Tree tree, CompareConfiguration configuration) {
  super(tree, configuration);
  Composite c= tree.getParent();
  if (c instanceof CompareViewerSwitchingPane)
    fParent= (CompareViewerSwitchingPane) c;
  initialize();
}

代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.jface

public void run() {
  tree.update();
  tree.getParent().layout();
}

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jface

private void update(final Tree tree) {
  tree.getDisplay().asyncExec(() -> {
    if (!tree.isDisposed()) {
      tree.update();
      tree.getParent().layout();
    }
  });
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.jface

private void update(final Tree tree) {
  tree.getDisplay().asyncExec(() -> {
    if (!tree.isDisposed()) {
      tree.update();
      tree.getParent().layout();
    }
  });
}

代码示例来源:origin: org.eclipse.pde/org.eclipse.pde.ui

@Override
protected TreeViewer doCreateTreeViewer(Composite parent, int style) {
  TreeViewer viewer = super.doCreateTreeViewer(parent, toolkit.getBorderStyle() | style);
  toolkit.paintBordersFor(viewer.getTree().getParent());
  return viewer;
}

代码示例来源:origin: org.eclipse.mylyn.builds/ui

/**
 * Initializes automatic resize of the tree control columns. The size of these will be adjusted when a node is
 * expanded or collapsed and when the tree changes size.
 * 
 * @param tree
 *            the tree to resize
 */
private void installAutomaticResize(final Tree tree) {
  Listener listener = new Listener() {
    public void handleEvent(Event e) {
      packColumnsAsync(tree);
    }
  };
  // Automatically resize columns when we expand tree nodes.
  tree.addListener(SWT.Collapse, listener);
  tree.addListener(SWT.Expand, listener);
  tree.getParent().addListener(SWT.Resize, listener);
}

代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.jface

/**
   * {@inheritDoc}
   * 
   * @since 1.3
   */
  protected void updateColumnData(Widget column) {
    TreeColumn tColumn = (TreeColumn) column;
    Tree t = tColumn.getParent();
    
    if( ! IS_GTK || t.getColumn(t.getColumnCount()-1) != tColumn ){
      tColumn.setData(LAYOUT_DATA,new ColumnPixelData(tColumn.getWidth()));
      layout(t.getParent(), true);
    }
  }
}

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jface

/**
   * {@inheritDoc}
   *
   * @since 3.5
   */
  @Override
  protected void updateColumnData(Widget column) {
    TreeColumn tColumn = (TreeColumn) column;
    Tree t = tColumn.getParent();

    if( ! IS_GTK || t.getColumn(t.getColumnCount()-1) != tColumn ){
      tColumn.setData(LAYOUT_DATA,new ColumnPixelData(tColumn.getWidth()));
      layout(t.getParent(), true);
    }
  }
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.jface

/**
   * {@inheritDoc}
   *
   * @since 3.5
   */
  @Override
  protected void updateColumnData(Widget column) {
    TreeColumn tColumn = (TreeColumn) column;
    Tree t = tColumn.getParent();

    if( ! IS_GTK || t.getColumn(t.getColumnCount()-1) != tColumn ){
      tColumn.setData(LAYOUT_DATA,new ColumnPixelData(tColumn.getWidth()));
      layout(t.getParent(), true);
    }
  }
}

代码示例来源:origin: org.eclipse.mylyn.commons/workbench

if (!customized) {
  Color parentBackground = getViewer().getTree().getParent().getBackground();
  double GRADIENT_TOP;// = 1.05;// 1.02;
  double GRADIENT_BOTTOM;// = .995;// 1.035;
    categoryGradientStart = new Color(Display.getDefault(), red, green, blue);
  } catch (Exception e) {
    categoryGradientStart = getViewer().getTree().getParent().getBackground();
    categoryGradientEnd = new Color(Display.getDefault(), red, green, blue);
  } catch (Exception e) {
    categoryGradientStart = getViewer().getTree().getParent().getBackground();

代码示例来源:origin: org.eclipse.platform/org.eclipse.ui.trace

getViewer().addDoubleClickListener(new TracingDoubleClickListener());
Composite treeViewerComposite = getViewerTree().getParent();
TreeColumnLayout treeViewerCompositeLayout = new TreeColumnLayout();
treeViewerComposite.setLayout(treeViewerCompositeLayout);

代码示例来源:origin: org.eclipse.ui/trace

getViewer().addDoubleClickListener(new TracingDoubleClickListener());
Composite treeViewerComposite = getViewerTree().getParent();
TreeColumnLayout treeViewerCompositeLayout = new TreeColumnLayout();
treeViewerComposite.setLayout(treeViewerCompositeLayout);

代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.rwt

RemoteObject remoteObject = createRemoteObject( tree, TYPE );
remoteObject.setHandler( new TreeOperationHandler( tree ) );
remoteObject.set( "parent", getId( tree.getParent() ) );
remoteObject.set( "style", createJsonArray( getStyles( tree, ALLOWED_STYLES ) ) );
remoteObject.set( "appearance", "tree" );

代码示例来源:origin: org.eclipse.egit/ui

this.filePaths = pathList;
Composite main = getTree().getParent();

相关文章

Tree类方法