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


Java OpenEvent类代码示例

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


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

示例1: handleOpen

import org.eclipse.jface.viewers.OpenEvent; //导入依赖的package包/类
protected void handleOpen(OpenEvent event) {
	if (showLineMatches()) {
		Object firstElement= ((IStructuredSelection)event.getSelection()).getFirstElement();
		if (firstElement instanceof IFile) {
			if (getDisplayedMatchCount(firstElement) == 0) {
				try {
					open(getSite().getPage(), (IFile)firstElement, false);
				} catch (PartInitException e) {
					ErrorDialog.openError(getSite().getShell(), SearchMessages.FileSearchPage_open_file_dialog_title, SearchMessages.FileSearchPage_open_file_failed, e.getStatus());
				}
				return;
			}
		}
	}
	super.handleOpen(event);
}
 
开发者ID:angelozerr,项目名称:typescript.java,代码行数:17,代码来源:TypeScriptSearchResultPage.java

示例2: init

import org.eclipse.jface.viewers.OpenEvent; //导入依赖的package包/类
public void init(ICommonActionExtensionSite actionSite) {
	super.init(actionSite);
	ICommonViewerSite site = actionSite.getViewSite();
	if (site instanceof ICommonViewerWorkbenchSite) {
		StructuredViewer viewer = actionSite.getStructuredViewer();
		if (viewer instanceof CommonViewer) {
			CommonViewer serversViewer = (CommonViewer) viewer;
			serversViewer.addOpenListener(new IOpenListener() {
				public void open(OpenEvent event) {
					ISelection s = event.getSelection();
					if (s instanceof IStructuredSelection) {
						IStructuredSelection selection = (IStructuredSelection) s;
						Object[] selectedObjects = selection.toArray();
						if (selectedObjects.length == 1 && selectedObjects[0] instanceof ModuleServer) {
							ModuleServer moduleServer = (ModuleServer) selectedObjects[0];
							openApplicationPage(moduleServer);
						}
					}
				}
			});
		}
	}
}
 
开发者ID:eclipse,项目名称:cft,代码行数:24,代码来源:CloudFoundryActionProvider.java

示例3: handleOpen

import org.eclipse.jface.viewers.OpenEvent; //导入依赖的package包/类
protected void handleOpen(OpenEvent openEvent) {
	ISelection selection = openEvent.getSelection();
	if (selection instanceof IStructuredSelection) {
		IStructuredSelection structuredSelection = (IStructuredSelection) selection;
		for (Iterator<?> i = structuredSelection.iterator(); i.hasNext();) {
			Object selectedObject = i.next();
			if (selectedObject instanceof ReferenceSearchViewTreeNode) {
				ReferenceSearchViewTreeNode treeNode = (ReferenceSearchViewTreeNode) selectedObject;
				Object description = treeNode.getDescription();
				if (description instanceof IReferenceDescription) {
					IReferenceDescription referenceDescription = (IReferenceDescription) description;
					uriEditorOpener.open(referenceDescription.getSourceEObjectUri(),
							referenceDescription.getEReference(), referenceDescription.getIndexInList(), true);
				} else if (description instanceof IResourceDescription) {
					uriEditorOpener.open(((IResourceDescription) description).getURI(), true);
				}
			}
		}
	}
}
 
开发者ID:cplutte,项目名称:bts,代码行数:21,代码来源:ReferenceSearchViewPage.java

示例4: open

import org.eclipse.jface.viewers.OpenEvent; //导入依赖的package包/类
/***********************************************************************
 * Open event on double click
 **********************************************************************/
@Override
public void open(OpenEvent event)
{
	TreeSelection sel = (TreeSelection) event.getSelection();
	try
	{
		ProcedureNode item = (ProcedureNode) sel.getFirstElement();
		// Open procedures only, ignore categories
		String category = item.getProcID();
		if (category == null || category.equals("") || category.equals("CATEGORY"))
		{
			return;
		}
		CommandHelper.execute(OpenProcedure.ID);
	}
	catch (Exception e)
	{
		return;
	}
}
 
开发者ID:Spacecraft-Code,项目名称:SPELL,代码行数:24,代码来源:NavigationView.java

示例5: handleDoubleClick

import org.eclipse.jface.viewers.OpenEvent; //导入依赖的package包/类
private void handleDoubleClick(MouseEvent e) {
	cancelEditing(); // close the editor which opened on the first click
	TreeItem item = getTree().getItem(new Point(e.x, e.y));
	int columnIndex = getColumnIndex(item, e.x, e.y);
	if ((item != null) && (columnIndex != -1) && (selectedItem == item)) {
		ITreeTableColumn column = configuration.getColumns().get(columnIndex);
		if (column.editOnDoubleClick()) {
			handleEditRequest(item, columnIndex);
		}
	}
	if (item != null) {
		boolean expanded = item.getExpanded();
		item.setExpanded(!expanded);
		Object data = item.getData();
		if (data != null) {
			refresh(data, false);
		}
	}
	fireDoubleClick(new DoubleClickEvent(this, getSelection()));
	fireOpen(new OpenEvent(this, getSelection()));
}
 
开发者ID:nasa,项目名称:OpenSPIFe,代码行数:22,代码来源:TreeTableViewer.java

示例6: handleOpen

import org.eclipse.jface.viewers.OpenEvent; //导入依赖的package包/类
@Override
protected void handleOpen(OpenEvent event) {
	Object firstElement= ((IStructuredSelection)event.getSelection()).getFirstElement();
	if (firstElement instanceof ICompilationUnit ||
			firstElement instanceof IClassFile ||
			firstElement instanceof IMember) {
		if (getDisplayedMatchCount(firstElement) == 0) {
			try {
				fEditorOpener.openElement(firstElement);
			} catch (CoreException e) {
				ExceptionHandler.handle(e, getSite().getShell(), SearchMessages.JavaSearchResultPage_open_editor_error_title, SearchMessages.JavaSearchResultPage_open_editor_error_message);
			}
			return;
		}
	}
	super.handleOpen(event);
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:18,代码来源:JavaSearchResultPage.java

示例7: handleOpen

import org.eclipse.jface.viewers.OpenEvent; //导入依赖的package包/类
@Override
protected void handleOpen(OpenEvent event) {
    Object firstElement = ((IStructuredSelection) event.getSelection()).getFirstElement();
    if (getDisplayedMatchCount(firstElement) == 0) {
        try {
            if (firstElement instanceof IAdaptable) {
                IAdaptable iAdaptable = (IAdaptable) firstElement;
                IFile file = iAdaptable.getAdapter(IFile.class);
                if (file != null) {

                    open(getSite().getPage(), file, false);
                }
            }
        } catch (PartInitException e) {
            ErrorDialog.openError(getSite().getShell(),
                    "Open File",
                    "Opening the file failed.", e.getStatus());
        }
        return;
    }
    super.handleOpen(event);
}
 
开发者ID:fabioz,项目名称:Pydev,代码行数:23,代码来源:AbstractSearchIndexResultPage.java

示例8: handleOpen

import org.eclipse.jface.viewers.OpenEvent; //导入依赖的package包/类
@Override
protected void handleOpen(OpenEvent event) {
    if (showLineMatches()) {
        Object firstElement = ((IStructuredSelection) event.getSelection()).getFirstElement();
        if (firstElement instanceof IFile) {
            if (getDisplayedMatchCount(firstElement) == 0) {
                try {
                    fEditorOpener.open(getSite().getPage(), (IFile) firstElement, false);
                } catch (PartInitException e) {
                    ErrorDialog.openError(getSite().getShell(),
                            SearchMessages.FileSearchPage_open_file_dialog_title,
                            SearchMessages.FileSearchPage_open_file_failed, e.getStatus());
                }
                return;
            }
        }
    }
    super.handleOpen(event);
}
 
开发者ID:fabioz,项目名称:Pydev,代码行数:20,代码来源:FileSearchPage.java

示例9: handleOpen

import org.eclipse.jface.viewers.OpenEvent; //导入依赖的package包/类
protected void handleOpen(OpenEvent event) {
    if (showLineMatches()) {
        Object firstElement = ((IStructuredSelection) event.getSelection()).getFirstElement();

        try {
            if (firstElement instanceof LineElement) {
                LineElement lineElement = (LineElement) firstElement;
                showMatch(getCurrentMatch(lineElement), true);
                return;
            } else if (firstElement instanceof IFile) {
                if (getDisplayedMatchCount(firstElement) == 0) {

                    fEditorOpener.open(getSite().getPage(), (IFile) firstElement, false);

                    return;
                }
            }
        } catch (PartInitException e) {
            ErrorDialog.openError(getSite().getShell(), SearchMessages.FileSearchPage_open_file_dialog_title,
                    SearchMessages.FileSearchPage_open_file_failed, e.getStatus());
        }
    }
    super.handleOpen(event);
}
 
开发者ID:McGill-DP-Group,项目名称:seg.jUCMNav,代码行数:25,代码来源:UrnTextSearchViewPage.java

示例10: BaseOpenAction

import org.eclipse.jface.viewers.OpenEvent; //导入依赖的package包/类
public BaseOpenAction(InputType inputType) {
    super(inputType);
    setText(ACTION_TEXT);
    setToolTipText(ACTION_TOOL_TIP_TEXT);

    _OpenListener = new IOpenListener() {

        @Override
        public void open(OpenEvent event) {
            run();
        }
    };
}
 
开发者ID:baloise,项目名称:eZooKeeper,代码行数:14,代码来源:BaseOpenAction.java

示例11: createModelFormContent

import org.eclipse.jface.viewers.OpenEvent; //导入依赖的package包/类
@Override
protected void createModelFormContent(IManagedForm managedForm, Composite client) {
    super.createModelFormContent(managedForm, client);

    ZooKeeperConnectionServerComposite composite = (ZooKeeperConnectionServerComposite) getTableViewerOrchestrationComposite();
    TableViewer serverDescriptorTableViewer = composite.getTableViewer();
    serverDescriptorTableViewer.addOpenListener(new IOpenListener() {

        @Override
        public void open(OpenEvent event) {
            openSelectedServers(event.getSelection());
        }
    });

}
 
开发者ID:baloise,项目名称:eZooKeeper,代码行数:16,代码来源:ZooKeeperConnectionModelServersFormPage.java

示例12: internalSetSelection

import org.eclipse.jface.viewers.OpenEvent; //导入依赖的package包/类
private void internalSetSelection(TreeItem ti) {
	if (ti != null) {
		Object data = ti.getData();
		if (data != null) {
			ISelection selection = new StructuredSelection(data);
			viewer.setSelection(selection, true);
			page.handleOpen(new OpenEvent(viewer, selection));
		}
	}
}
 
开发者ID:cplutte,项目名称:bts,代码行数:11,代码来源:TreeViewerNavigator.java

示例13: fireOpen

import org.eclipse.jface.viewers.OpenEvent; //导入依赖的package包/类
protected void fireOpen(final OpenEvent event) {
	if (openListeners == null)
		return;
	for (final Object l : openListeners.toArray()) {
		SafeRunner.run(new SafeRunnable() {
			public void run() throws Exception {
				((IOpenListener) l).open(event);
			}
		});
	}
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:12,代码来源:ComboButton.java

示例14: createPartControl

import org.eclipse.jface.viewers.OpenEvent; //导入依赖的package包/类
public void createPartControl(Composite parent) {
	GridLayout layout = new GridLayout();
	layout.marginWidth = 0;
	layout.marginHeight = 0;
	layout.numColumns = 1;
	parent.setLayout(layout);		

	treeViewer = new TreeViewer(parent, SWT.FULL_SELECTION);
	treeViewer.setLabelProvider(new ConflictsLabelProvider());
	treeViewer.setContentProvider(new ConflictsContentProvider());
	treeViewer.setUseHashlookup(true);
	GridData layoutData = new GridData();
	layoutData.grabExcessHorizontalSpace = true;
	layoutData.grabExcessVerticalSpace = true;
	layoutData.horizontalAlignment = GridData.FILL;
	layoutData.verticalAlignment = GridData.FILL;
	treeViewer.getControl().setLayoutData(layoutData);
	TableLayout tableLayout = new TableLayout();
	treeViewer.getTree().setLayout(tableLayout);

	DisposeListener disposeListener = new DisposeListener() {
		public void widgetDisposed(DisposeEvent e) {
			TreeColumn col = (TreeColumn)e.getSource();
			if (col.getWidth() > 0) settings.put("TreeConflictsView.col." + col.getText(), col.getWidth()); //$NON-NLS-1$
		}			
	};
	for (int i = 0; i < columnHeaders.length; i++) {
		TreeColumn tc = new TreeColumn(treeViewer.getTree(), SWT.NONE,i);
		tc.setResizable(columnLayouts[i].resizable);
		tc.setText(columnHeaders[i]);
		setColumnWidth(tableLayout, disposeListener, tc, i);
	}
	
	treeViewer.getTree().setHeaderVisible(true);
	treeViewer.getTree().setLinesVisible(false);
	
	treeViewer.setInput(this);

	treeViewer.addOpenListener(new IOpenListener() {
		public void open(OpenEvent evt) {
			openAction.run();
		}	
	});
	
	createMenus();
	createToolbar();
	
	String path = settings.get("TreeConflictsView.resource"); //$NON-NLS-1$
	if (path != null) {
		boolean container = settings.getBoolean("TreeConflictsView.container"); //$NON-NLS-1$
		if (container) resource = ResourcesPlugin.getWorkspace().getRoot().getContainerForLocation(new Path(path));
		else resource = ResourcesPlugin.getWorkspace().getRoot().getFileForLocation(new Path(path));
	}
	if (resource == null)
		setContentDescription(Policy.bind("TreeConflictsView.noResource")); //$NON-NLS-1$
	else
		setContentDescription(resource.getFullPath().toString());
}
 
开发者ID:subclipse,项目名称:subclipse,代码行数:59,代码来源:TreeConflictsView.java

示例15: open

import org.eclipse.jface.viewers.OpenEvent; //导入依赖的package包/类
@Override
public void open(OpenEvent event) {
	System.out.println("open:"+event);
	// TODO Auto-generated method stub
	
}
 
开发者ID:scauwe,项目名称:IDM-Enh-Trace,代码行数:7,代码来源:LogMessageOutlinePage.java


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