当前位置: 首页>>代码示例>>Java>>正文


Java TreeViewer.setUseHashlookup方法代码示例

本文整理汇总了Java中org.eclipse.jface.viewers.TreeViewer.setUseHashlookup方法的典型用法代码示例。如果您正苦于以下问题:Java TreeViewer.setUseHashlookup方法的具体用法?Java TreeViewer.setUseHashlookup怎么用?Java TreeViewer.setUseHashlookup使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.jface.viewers.TreeViewer的用法示例。


在下文中一共展示了TreeViewer.setUseHashlookup方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createControl

import org.eclipse.jface.viewers.TreeViewer; //导入方法依赖的package包/类
@Override
public void createControl(Composite parent) {
  Composite container = new Composite(parent, SWT.NONE);
  setControl(container);
  container.setLayout(new FillLayout(SWT.HORIZONTAL));

  treeViewer = new TreeViewer(container, SWT.BORDER);
  treeViewer.setUseHashlookup(true);
  treeViewer.setLabelProvider(new SigTypeLabelProvider());
  treeViewer.setContentProvider(new SigTypeContentProvider());
  treeViewer.setInput(ResourcesPlugin.getWorkspace().getRoot().getProjects());

  treeViewer.addSelectionChangedListener(new ISelectionChangedListener() {

    @Override
    public void selectionChanged(SelectionChangedEvent event) {
      if (((TreeSelection) event.getSelection()).getFirstElement() instanceof IMarker) {
        selection = event.getSelection();
        ContainerSelectionPage.this.setPageComplete(true);
      } else {
        ContainerSelectionPage.this.setPageComplete(false);
      }
    }
  });
}
 
开发者ID:ModelWriter,项目名称:Tarski,代码行数:26,代码来源:ContainerSelectionPage.java

示例2: createControl

import org.eclipse.jface.viewers.TreeViewer; //导入方法依赖的package包/类
@Override
public void createControl(Composite parent) {
  Composite container = new Composite(parent, SWT.NONE);
  this.setControl(container);
  container.setLayout(new FillLayout(SWT.HORIZONTAL));

  TreeViewer treeViewer = new TreeViewer(container, SWT.BORDER);
  treeViewer.setUseHashlookup(true);
  treeViewer.setLabelProvider(new CreatingAtomWizardLabelProvider());
  treeViewer.setContentProvider(new CreatingAtomWizardContentProvider());
  treeViewer.setInput(ResourcesPlugin.getWorkspace().getRoot().getProjects());
  treeViewer.setFilters(new ViewerFilter[] {new CreatingAtomWizardFilter()});

  treeViewer.addSelectionChangedListener(new ISelectionChangedListener() {

    @Override
    public void selectionChanged(SelectionChangedEvent event) {
      if (((TreeSelection) event.getSelection()).getFirstElement() instanceof IMarker) {
        UntypedMarkerPage.this.selection = event.getSelection();
        UntypedMarkerPage.this.setPageComplete(true);
      } else {
        UntypedMarkerPage.this.setPageComplete(false);
      }
    }
  });
}
 
开发者ID:ModelWriter,项目名称:Tarski,代码行数:27,代码来源:UntypedMarkerPage.java

示例3: createControl

import org.eclipse.jface.viewers.TreeViewer; //导入方法依赖的package包/类
@Override
public void createControl(final Composite parent) {
  final Composite container = new Composite(parent, SWT.NONE);
  setControl(container);
  container.setLayout(new FillLayout(SWT.HORIZONTAL));

  treeViewer = new TreeViewer(container, SWT.BORDER);
  treeViewer.setUseHashlookup(true);
  treeViewer.setLabelProvider(new CreatingAtomWizardLabelProvider());
  treeViewer.setContentProvider(new CreatingAtomWizardContentProvider());
  treeViewer.setInput(ResourcesPlugin.getWorkspace().getRoot().getProjects());
  treeViewer.setFilters(new ViewerFilter[] {new CreatingAtomWizardFilter()});

  treeViewer.addSelectionChangedListener(new ISelectionChangedListener() {

    @Override
    public void selectionChanged(final SelectionChangedEvent event) {
      if (((TreeSelection) event.getSelection()).getFirstElement() instanceof IMarker) {
        SelectionPage.this.setPageComplete(true);
      } else {
        SelectionPage.this.setPageComplete(false);
      }
    }
  });

  setPageComplete(false);
}
 
开发者ID:ModelWriter,项目名称:Tarski,代码行数:28,代码来源:SelectionPage.java

示例4: createControl

import org.eclipse.jface.viewers.TreeViewer; //导入方法依赖的package包/类
@Override
public void createControl(Composite parent) {
  Composite container = new Composite(parent, SWT.NONE);
  this.setControl(container);
  container.setLayout(new FillLayout(SWT.HORIZONTAL));

  TreeViewer treeViewer = new TreeViewer(container, SWT.BORDER);
  treeViewer.setUseHashlookup(true);
  treeViewer.setLabelProvider(new MarkerTreeViewLabelProvider());
  treeViewer.setContentProvider(new MarkerTreeViewContentProvider());

  String savedTree = Activator.getDefault().getDialogSettings().get("universe");
  try {
    Object[] array = new Object[1];
    if (savedTree != null) {
      array[0] = Serialization.getInstance().fromString(savedTree);
      treeViewer.setInput(array);
    }
  } catch (IOException | ClassNotFoundException e) {
    e.printStackTrace();
  }

  treeViewer.addSelectionChangedListener(new ISelectionChangedListener() {

    @Override
    public void selectionChanged(SelectionChangedEvent event) {
      String markerType =
          ((MarkerTypeElement) ((TreeSelection) event.getSelection()).getFirstElement())
              .getType();
      if (markerType.equals("universe") || markerType.endsWith("{abs}")) {
        MarkerTypesPage.this.setPageComplete(false);
      } else {
        MarkerTypesPage.this.selection = event.getSelection();
        MarkerTypesPage.this.setPageComplete(true);
      }
    }
  });
}
 
开发者ID:ModelWriter,项目名称:Tarski,代码行数:39,代码来源:MarkerTypesPage.java

示例5: createControl

import org.eclipse.jface.viewers.TreeViewer; //导入方法依赖的package包/类
@Override
public void createControl(Composite parent) {
  Composite container = new Composite(parent, SWT.NONE);
  setControl(container);
  container.setLayout(new FillLayout(SWT.HORIZONTAL));

  TreeViewer treeViewer = new TreeViewer(container, SWT.BORDER);
  treeViewer.setUseHashlookup(true);
  treeViewer.setLabelProvider(new MarkerTreeViewLabelProvider());
  treeViewer.setContentProvider(new MarkerTreeViewContentProvider());

  String savedTree = Activator.getDefault().getDialogSettings().get("universe");
  try {
    Object[] array = new Object[1];
    if (savedTree != null) {
      array[0] = Serialization.getInstance().fromString(savedTree);
      treeViewer.setInput(array);
    }
  } catch (IOException | ClassNotFoundException e) {
    e.printStackTrace();
  }

  for (LoadItem loadItem : TraceManager.get().getLoads()) {
    allEClasses.addAll(loadItem.getAllEClasses().values());
  }

  treeViewer.addSelectionChangedListener(new ISelectionChangedListener() {

    @Override
    public void selectionChanged(SelectionChangedEvent event) {
      String markerType =
          ((MarkerTypeElement) ((TreeSelection) event.getSelection()).getFirstElement())
              .getType();
      if (markerType.equals("universe") || markerType.endsWith("{abs}")) {
        TypeSelectionPage.this.setPageComplete(false);
        canFlip = false;
      } else {
        selection = event.getSelection();
        containerSigTypes = TraceManager.get().findContainers(allEClasses, getSelectedType());
        canFlip = !containerSigTypes.isEmpty();
        TypeSelectionPage.this.setPageComplete(true);
        getContainer().updateButtons();
      }
    }
  });

}
 
开发者ID:ModelWriter,项目名称:Tarski,代码行数:48,代码来源:TypeSelectionPage.java


注:本文中的org.eclipse.jface.viewers.TreeViewer.setUseHashlookup方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。