當前位置: 首頁>>代碼示例>>Java>>正文


Java IDoubleClickListener類代碼示例

本文整理匯總了Java中org.eclipse.jface.viewers.IDoubleClickListener的典型用法代碼示例。如果您正苦於以下問題:Java IDoubleClickListener類的具體用法?Java IDoubleClickListener怎麽用?Java IDoubleClickListener使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


IDoubleClickListener類屬於org.eclipse.jface.viewers包,在下文中一共展示了IDoubleClickListener類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: init

import org.eclipse.jface.viewers.IDoubleClickListener; //導入依賴的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.IDoubleClickListener; //導入依賴的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.IDoubleClickListener; //導入依賴的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: contributeActions

import org.eclipse.jface.viewers.IDoubleClickListener; //導入依賴的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

示例5: contributeActions

import org.eclipse.jface.viewers.IDoubleClickListener; //導入依賴的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

示例6: addDoubleClickListener

import org.eclipse.jface.viewers.IDoubleClickListener; //導入依賴的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

示例7: createDialogArea

import org.eclipse.jface.viewers.IDoubleClickListener; //導入依賴的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

示例8: CollectionTreeViewerWidget

import org.eclipse.jface.viewers.IDoubleClickListener; //導入依賴的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

示例9: hookDoubleClickAction

import org.eclipse.jface.viewers.IDoubleClickListener; //導入依賴的package包/類
private void hookDoubleClickAction() {
	viewer.addDoubleClickListener(new IDoubleClickListener() {

		@Override
		public void doubleClick(DoubleClickEvent event) {
			ISelection selection = event.getSelection();
			if (selection instanceof IStructuredSelection) {
				Object firstElement = ((IStructuredSelection) selection)
						.getFirstElement();
				if (firstElement instanceof DisplayElement) {
					AbstractObjectTreeView
							.selectElement((DisplayElement) firstElement);
					LogUtils.info(log,
							"Select Element in Abstract Object Tree",
							Mode.DOUBLE_CLICK, LabelUtil.getDisplayElementLabel(firstElement));
				}
			}
		}
	});

}
 
開發者ID:aroog,項目名稱:code,代碼行數:22,代碼來源:ObjectSearchView.java

示例10: hookDoubleClickAction

import org.eclipse.jface.viewers.IDoubleClickListener; //導入依賴的package包/類
private void hookDoubleClickAction() {
	fTreeViewer.addDoubleClickListener(new IDoubleClickListener() {
		@Override
		public void doubleClick(DoubleClickEvent event) {

			ISelection selection = fTreeViewer.getSelection();
			Object obj = ((IStructuredSelection) selection)
					.getFirstElement();
			LogUtils.info(log, "Trace-to-Code", Mode.DOUBLE_CLICK,
					obj.toString());
			traceAction.run();

		}
	});

}
 
開發者ID:aroog,項目名稱:code,代碼行數:17,代碼來源:RelatedObjectsEdges.java

示例11: createTableViewer

import org.eclipse.jface.viewers.IDoubleClickListener; //導入依賴的package包/類
/**
 * create the viewer
 */
@Override
protected TableViewer createTableViewer(Table table)
{
    // create
    TableViewer tableViewer = new TableViewer(table);
    // represent formulas in the view
    tableViewer.setContentProvider(new AssignmentContentProvider());
    // on changed selection change button enablement
    tableViewer.addSelectionChangedListener(fSelectionChangedListener);
    // edit on double-click
    tableViewer.addDoubleClickListener(new IDoubleClickListener() {
        public void doubleClick(DoubleClickEvent event)
        {
            doEdit();
        }
    });

    return tableViewer;
}
 
開發者ID:tlaplus,項目名稱:tlaplus,代碼行數:23,代碼來源:ValidateableConstantSectionPart.java

示例12: installDoubleClickListener

import org.eclipse.jface.viewers.IDoubleClickListener; //導入依賴的package包/類
/**
 * Installs a double-click listener which allows to expand and collapse tree items.
 *
 * @since 3.4
 */
private void installDoubleClickListener() {
	fTreeViewer.addDoubleClickListener(new IDoubleClickListener() {

		/*
		 * @see
		 * org.eclipse.jface.viewers.IDoubleClickListener#doubleClick(org.eclipse.jface.viewers.
		 * DoubleClickEvent)
		 */
		@Override
		public void doubleClick(DoubleClickEvent event) {
			IStructuredSelection s = (IStructuredSelection) event.getSelection();
			Object element = s.getFirstElement();
			if (fTreeViewer.isExpandable(element))
				fTreeViewer.setExpandedState(element, !fTreeViewer.getExpandedState(element));
		}
	});
}
 
開發者ID:grosenberg,項目名稱:fluentmark,代碼行數:23,代碼來源:AppearanceConfigurationBlock.java

示例13: configureTableViewer

import org.eclipse.jface.viewers.IDoubleClickListener; //導入依賴的package包/類
/**
 * @see org.eclipse.search.ui.text.AbstractTextSearchViewPage#configureTableViewer(org.eclipse.jface.viewers.TableViewer)
 */
@Override
protected void configureTableViewer(TableViewer viewer) {
    viewer.setUseHashlookup(true);
    UMLModelLabelProvider labelProvider = new UMLModelLabelProvider();
    viewer.setLabelProvider(labelProvider);
    viewer.setContentProvider(new UMLModelTableContentProvider());
    this.tableContentProvider = (UMLModelTableContentProvider) viewer.getContentProvider();

    viewer.addDoubleClickListener(new IDoubleClickListener() {

        public void doubleClick(DoubleClickEvent event) {

            // IStructuredSelection selection = (IStructuredSelection)
            // event.getSelection();
            // Object selectedElement = selection.getFirstElement();
            //                
            // IViewPart part =
            // PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().findView("org.eclipse.ui.navigator.ProjectExplorer");
            // DMToolsPlugin.getDefault().openEditor(selectedElement);
        }
    });

}
 
開發者ID:SK-HOLDINGS-CC,項目名稱:NEXCORE-UML-Modeler,代碼行數:27,代碼來源:UMLModelSearchResultPage.java

示例14: configureTreeViewer

import org.eclipse.jface.viewers.IDoubleClickListener; //導入依賴的package包/類
/**
 * @see org.eclipse.search.ui.text.AbstractTextSearchViewPage#configureTreeViewer(org.eclipse.jface.viewers.TreeViewer)
 */
@Override
protected void configureTreeViewer(TreeViewer viewer) {
    viewer.setUseHashlookup(true);
    UMLModelLabelProvider labelProvider = new UMLModelLabelProvider();
    viewer.setLabelProvider(labelProvider);
    viewer.setContentProvider(new UMLModelTreeContentProvider(viewer));
    this.treeContentProvider = (UMLModelTreeContentProvider) viewer.getContentProvider();
    viewer.addDoubleClickListener(new IDoubleClickListener() {

        public void doubleClick(DoubleClickEvent event) {

            IStructuredSelection selection = (IStructuredSelection) event.getSelection();
            Object selectedElement = selection.getFirstElement();

            UMLModelElement element = (UMLModelElement) selectedElement;
            if (!(UICoreConstant.MODELSEARCH__TYPE_PROJECT.equals(element.getType()))) {
                ProjectUtil.findElement((EObject) (element.getOrgObject()));
            }

        }
    });

}
 
開發者ID:SK-HOLDINGS-CC,項目名稱:NEXCORE-UML-Modeler,代碼行數:27,代碼來源:UMLModelSearchResultPage.java

示例15: configureTreeViewer

import org.eclipse.jface.viewers.IDoubleClickListener; //導入依賴的package包/類
/**
 * @see org.eclipse.search.ui.text.AbstractTextSearchViewPage#configureTreeViewer(org.eclipse.jface.viewers.TreeViewer)
 */
@Override
protected void configureTreeViewer(TreeViewer viewer) {
    viewer.setUseHashlookup(true);
    UMLInverseReferenceModelLabelProvider labelProvider = new UMLInverseReferenceModelLabelProvider();
    viewer.setLabelProvider(labelProvider);
    viewer.setContentProvider(new UMLInverseReferenceModelTreeContentProvider(viewer));
    this.treeContentProvider = (UMLInverseReferenceModelTreeContentProvider) viewer.getContentProvider();
    viewer.addDoubleClickListener(new IDoubleClickListener() {

        public void doubleClick(DoubleClickEvent event) {

            IStructuredSelection selection = (IStructuredSelection) event.getSelection();
            Object selectedElement = selection.getFirstElement();

            UMLInverseReferenceModelElement element = (UMLInverseReferenceModelElement) selectedElement;
            if (!(UICoreConstant.MODELSEARCH__TYPE_PROJECT.equals(element.getType()))) {
                ProjectUtil.findElement((EObject) (element.getOrgObject()));
            }

        }
    });
}
 
開發者ID:SK-HOLDINGS-CC,項目名稱:NEXCORE-UML-Modeler,代碼行數:26,代碼來源:UMLInverseReferenceModelSearchResultPage.java


注:本文中的org.eclipse.jface.viewers.IDoubleClickListener類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。