當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。