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


Java DoubleClickEvent类代码示例

本文整理汇总了Java中org.eclipse.jface.viewers.DoubleClickEvent的典型用法代码示例。如果您正苦于以下问题:Java DoubleClickEvent类的具体用法?Java DoubleClickEvent怎么用?Java DoubleClickEvent使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: init

import org.eclipse.jface.viewers.DoubleClickEvent; //导入依赖的package包/类
@Override
public void init ( final VisibilityProviderFactory factory, final Composite parent, final Map<String, String> properties )
{
    this.shell = parent.getShell ();

    this.viewer = new RealTimeListViewer ();
    this.viewer.createControl ( parent );
    this.viewer.addDoubleClickListener ( new IDoubleClickListener () {

        @Override
        public void doubleClick ( final DoubleClickEvent event )
        {
            RealTimeGroupTab.this.handleDoubleClick ( event );
        }
    } );

    if ( this.input != null )
    {
        attachInput ();
    }
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:22,代码来源:RealTimeGroupTab.java

示例2: createControl

import org.eclipse.jface.viewers.DoubleClickEvent; //导入依赖的package包/类
/**
 * @wbp.parser.entryPoint
 */
@Override
public void createControl(Composite parent) {
	fRootControl = new Composite(parent, SWT.NULL);
	fRootControl.setLayout(new FillLayout(SWT.HORIZONTAL));

	 
	viewer = new TreeViewer(fRootControl, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL);
	viewer.setContentProvider(new ViewContentProvider());
	viewer.setLabelProvider(new DelegatingStyledCellLabelProvider(new ViewLabelProvider(createImageDescriptor())));
	viewer.addDoubleClickListener(new IDoubleClickListener () {

		@Override
		public void doubleClick(DoubleClickEvent evt) {
			TreeSelection sel = (TreeSelection) evt.getSelection();
			IFile file = (IFile) sel.getFirstElement();
			if (isModelFile(file)) {
				JDTManager.openEditor(file, "org.gw4e.eclipse.studio.editor.GW4EEditor", null);	
				return;
			}
			JDTManager.openEditor(file, null); 
		}
		
	});
	files = new ArrayList<IFile>();
}
 
开发者ID:gw4e,项目名称:gw4e.project,代码行数:29,代码来源:ModelSearchResultPage.java

示例3: getDoubleClickListener

import org.eclipse.jface.viewers.DoubleClickEvent; //导入依赖的package包/类
private IDoubleClickListener getDoubleClickListener() {
  return new IDoubleClickListener() {
    @Override
    public void doubleClick(final DoubleClickEvent event) {
      final IStructuredSelection selection = (IStructuredSelection) event.getSelection();
      final Object firstElement = selection.getFirstElement();
      if (MarkerPage.markTreeViewer.isExpandable(firstElement)) {
        final boolean expanded = MarkerPage.markTreeViewer.getExpandedState(firstElement);
        MarkerPage.markTreeViewer.setExpandedState(firstElement, !expanded);
      } else {
        MarkerWizard.this.performFinish();
        MarkerWizard.this.getContainer().getShell().close();
      }
    }
  };
}
 
开发者ID:ModelWriter,项目名称:Tarski,代码行数:17,代码来源:MarkerWizard.java

示例4: doubleClick

import org.eclipse.jface.viewers.DoubleClickEvent; //导入依赖的package包/类
@Override
public void doubleClick(DoubleClickEvent event) {
	final IStructuredSelection selection = (IStructuredSelection) event.getSelection();
	if (selection == null || selection.isEmpty())
		return;
	final Object sel = selection.getFirstElement();

	final ITreeContentProvider provider = (ITreeContentProvider) viewer.getContentProvider();

	if (!provider.hasChildren(sel))
		return;

	if (viewer.getExpandedState(sel))
		viewer.collapseToLevel(sel, AbstractTreeViewer.ALL_LEVELS);
	else
		viewer.expandToLevel(sel, 1);

}
 
开发者ID:termsuite,项目名称:termsuite-ui,代码行数:19,代码来源:ExpandCollapseDoubleClickListener.java

示例5: doubleClick

import org.eclipse.jface.viewers.DoubleClickEvent; //导入依赖的package包/类
@Override
public void doubleClick(final DoubleClickEvent event) {
  final ISelection selection = event.getSelection();
  if (selection.isEmpty()
      || !(selection instanceof StructuredSelection || ((StructuredSelection) selection).size() != 1)) {
    return;
  }
  final StructuredSelection structuredSelection = (StructuredSelection) selection;
  final Object firstElement = structuredSelection.getFirstElement();
  if ((firstElement instanceof IDependencyRelation)) {
    select(((IDependencyRelation) firstElement).getItem());
    return;
  }
  if ((firstElement instanceof IType)) {
    select(((IType) firstElement));
    return;
  }
}
 
开发者ID:AndreasWBartels,项目名称:libraries,代码行数:19,代码来源:ElementSelectingDoubleClickListener.java

示例6: contributeActions

import org.eclipse.jface.viewers.DoubleClickEvent; //导入依赖的package包/类
@Override
protected void contributeActions() {
    final SourceFilesCheckinControl sourceFilesSubControl = getCheckinControl().getSourceFilesSubControl();

    sourceFilesSubControl.getContextMenu().addMenuListener(new IMenuListener() {
        @Override
        public void menuAboutToShow(final IMenuManager manager) {
            final String groupId = StandardActionConstants.HOSTING_CONTROL_CONTRIBUTIONS;

            manager.appendToGroup(groupId, viewSubMenu);
            manager.appendToGroup(groupId, new Separator());
            manager.appendToGroup(groupId, compareSubMenu);
        }
    });

    (sourceFilesSubControl).getChangesTable().addDoubleClickListener(new IDoubleClickListener() {
        @Override
        public void doubleClick(final DoubleClickEvent event) {
            if (viewAction.isEnabled()) {
                viewAction.run();
            }
        }
    });
}
 
开发者ID:Microsoft,项目名称:team-explorer-everywhere,代码行数:25,代码来源:ChangesetDetailsView.java

示例7: contributeActions

import org.eclipse.jface.viewers.DoubleClickEvent; //导入依赖的package包/类
@Override
protected void contributeActions() {
    final SourceFilesCheckinControl sourceFilesSubControl = getCheckinControl().getSourceFilesSubControl();

    sourceFilesSubControl.getContextMenu().addMenuListener(new IMenuListener() {
        @Override
        public void menuAboutToShow(final IMenuManager manager) {
            final String groupId = StandardActionConstants.HOSTING_CONTROL_CONTRIBUTIONS;

            manager.appendToGroup(groupId, viewSubMenu);
            manager.appendToGroup(groupId, new Separator());
            manager.appendToGroup(groupId, compareSubMenu);
        }
    });

    (sourceFilesSubControl).getChangesTable().addDoubleClickListener(new IDoubleClickListener() {
        @Override
        public void doubleClick(final DoubleClickEvent event) {
            if (viewAction.isEnabled()) {
                viewAction.run();
            } else if (viewUnmodifiedAction.isEnabled()) {
                viewUnmodifiedAction.run();
            }
        }
    });
}
 
开发者ID:Microsoft,项目名称:team-explorer-everywhere,代码行数:27,代码来源:ShelvesetDetailsView.java

示例8: doubleClick

import org.eclipse.jface.viewers.DoubleClickEvent; //导入依赖的package包/类
@Override
public void doubleClick(final DoubleClickEvent event) {
    final IStructuredSelection selection = (IStructuredSelection) event.getSelection();
    final Object element = selection.getFirstElement();

    final Shell shell = treeViewer.getControl().getShell();
    final TFSServer server = context.getServer();
    final ProjectInfo projectInfo = context.getCurrentProjectInfo();

    if (element instanceof WSSNode) {
        final WSSNode wssNode = (WSSNode) element;
        WSSHelper.openWSSNode(shell, server, projectInfo, wssNode);
    } else if (element instanceof WSSDocumentLibrary) {
        final WSSDocumentLibrary library = (WSSDocumentLibrary) element;
        WSSHelper.openWSSDocumentLibrary(shell, server, projectInfo, library);
    }
}
 
开发者ID:Microsoft,项目名称:team-explorer-everywhere,代码行数:18,代码来源:TeamExplorerDocumentsSection.java

示例9: doubleClick

import org.eclipse.jface.viewers.DoubleClickEvent; //导入依赖的package包/类
@Override
public void doubleClick(final DoubleClickEvent event) {
    final IStructuredSelection selection = (IStructuredSelection) event.getSelection();
    final Object element = selection.getFirstElement();

    if (element instanceof QueryFolder) {
        final boolean expanded = treeViewer.getExpandedState(element);
        treeViewer.setExpandedState(element, !expanded);
    } else if (element instanceof QueryDefinition) {
        final Shell shell = treeViewer.getControl().getShell();
        final QueryDefinition queryDefinition = (QueryDefinition) element;
        final StoredQuery storedQuery = WorkItemHelpers.createStoredQueryFromDefinition(queryDefinition);

        WorkItemHelpers.runQuery(shell, context.getServer(), context.getCurrentProject(), storedQuery);
    }
}
 
开发者ID:Microsoft,项目名称:team-explorer-everywhere,代码行数:17,代码来源:TeamExplorerWorkItemsQueriesSection.java

示例10: doubleClick

import org.eclipse.jface.viewers.DoubleClickEvent; //导入依赖的package包/类
@Override
public void doubleClick(final DoubleClickEvent event) {
    final IStructuredSelection selection = (IStructuredSelection) event.getSelection();
    final Object element = selection.getFirstElement();

    if (element instanceof PendingChangesTreeNode) {
        final PendingChangesTreeNode node = (PendingChangesTreeNode) element;
        final PendingChange pendingChange = node.getPendingChange();

        if (pendingChange != null && pendingChange.getLocalItem() != null) {
            final String localPath = pendingChange.getLocalItem();
            final File file = new File(localPath);

            if (file.exists()) {
                final IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
                ViewFileHelper.viewLocalFileOrFolder(localPath, page, false);
            }
        }
    }
}
 
开发者ID:Microsoft,项目名称:team-explorer-everywhere,代码行数:21,代码来源:PendingChangesTreeDoubleClickListener.java

示例11: doubleClick

import org.eclipse.jface.viewers.DoubleClickEvent; //导入依赖的package包/类
@Override
public void doubleClick(final DoubleClickEvent event) {
    final IStructuredSelection selection = (IStructuredSelection) event.getSelection();
    final Object element = selection.getFirstElement();

    if (element instanceof BuildFavoriteItem) {
        final BuildFavoriteItem favorite = (BuildFavoriteItem) element;

        if (favorite.getBuildDefinitionType() == DefinitionType.XAML) {
            BuildHelpers.viewTodaysBuildsForDefinition((IBuildDefinition) favorite.getBuildDefinition());
        } else {
            new OpenBuildDefinitionVNextTask(
                context.getWorkbenchPart().getSite().getShell(),
                context.getServer().getConnection(),
                (BuildDefinitionReference) favorite.getBuildDefinition()).run();
        }
    }
}
 
开发者ID:Microsoft,项目名称:team-explorer-everywhere,代码行数:19,代码来源:TeamExplorerBuildsFavoritesSection.java

示例12: handleDoubleClick

import org.eclipse.jface.viewers.DoubleClickEvent; //导入依赖的package包/类
/**
 * The mouse has been double-clicked in the tree, perform appropriate
 * behaviour.
 */
private void handleDoubleClick(DoubleClickEvent e) {
    // Only act on single selection
    ISelection selection = e.getSelection();
    if (selection instanceof IStructuredSelection) {
        IStructuredSelection structured = (IStructuredSelection)selection;
        if (structured.size() == 1) {
            Object first = structured.getFirstElement();
            if (first instanceof ISVNRemoteFile) {
                // It's a file, open it.
                openAction.selectionChanged(null, selection);
                openAction.run(null);
            } else {
                // Try to expand/contract
                treeViewer.setExpandedState(first, !treeViewer.getExpandedState(first));
            }
        }
    } 
}
 
开发者ID:subclipse,项目名称:subclipse,代码行数:23,代码来源:RepositoriesView.java

示例13: addDoubleClickListener

import org.eclipse.jface.viewers.DoubleClickEvent; //导入依赖的package包/类
private void addDoubleClickListener(TableViewer table) {
	table.addDoubleClickListener(new IDoubleClickListener(){
		@Override
		public void doubleClick(DoubleClickEvent event) {
			IStructuredSelection selection = (IStructuredSelection) event.getSelection();
			Object el = selection.getFirstElement();
			logger.debug("double click on element: "+el);
			TrpLocation loc;
			if (el instanceof TrpKwsHit){
				loc = new TrpLocation();
				TrpKwsHit h = ((TrpKwsHit)el);
				loc.collectionId = h.getColId();
				loc.docId = h.getDocId();
				loc.pageNr = h.getPageNr();	
				loc.shapeId = h.getLineId();
			} else {
				loc = null;
			}
			TrpMainWidget.getInstance().showLocation(loc);
		}
	});
}
 
开发者ID:Transkribus,项目名称:TranskribusSwtGui,代码行数:23,代码来源:KwsResultViewer.java

示例14: createDialogArea

import org.eclipse.jface.viewers.DoubleClickEvent; //导入依赖的package包/类
/**
 * Create contents of the dialog.
 * @param parent
 */
@Override protected Control createDialogArea(Composite parent) {
	Composite container = (Composite) super.createDialogArea(parent);
	container.setLayout(new GridLayout(1, true));
	
	trWidget = new TranscriptsTableWidgetPagination(container, 0, 50);
	trWidget.getDeleteBtn().dispose();
	trWidget.setLayoutData(new GridData(GridData.FILL_BOTH));
	trWidget.getTableViewer().addDoubleClickListener(new IDoubleClickListener() {
		@Override public void doubleClick(DoubleClickEvent event) {
			md = trWidget.getFirstSelected();
			okPressed();
		}
	});

	return container;
}
 
开发者ID:Transkribus,项目名称:TranskribusSwtGui,代码行数:21,代码来源:ChooseTranscriptDialog.java

示例15: CollectionTreeViewerWidget

import org.eclipse.jface.viewers.DoubleClickEvent; //导入依赖的package包/类
public CollectionTreeViewerWidget(Composite parent, int style) {
	tv = new TreeViewer(parent, style);
	contentProv = new CollectionContentProvider();
	labelProv = new CollectionLabelProvider();
	tv.setContentProvider(contentProv);
	tv.setLabelProvider(labelProv);
	
	tv.addDoubleClickListener(new IDoubleClickListener(){
		@Override
		public void doubleClick(DoubleClickEvent event) {
			Object o = ((IStructuredSelection)event.getSelection()).getFirstElement();
			if(o instanceof TrpDocMetadata) {
				for(TreeItem i : tv.getTree().getItems()) {
					if(i.getData().equals(o)) {
						tv.setExpandedState(o, !i.getExpanded());
						return;
					}
				}
			}
		}
	});
}
 
开发者ID:Transkribus,项目名称:TranskribusSwtGui,代码行数:23,代码来源:CollectionTreeViewerWidget.java


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