本文整理汇总了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);
}
示例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);
}
}
}
});
}
}
}
示例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);
}
}
}
}
}
示例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;
}
}
示例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()));
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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();
}
};
}
示例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());
}
});
}
示例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));
}
}
}
示例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);
}
});
}
}
示例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());
}
示例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
}