• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java IShowInSource类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: getAdapter

import org.eclipse.ui.part.IShowInSource; //导入依赖的package包/类
@SuppressWarnings("rawtypes")
@Override
   public Object getAdapter(Class adapter) {
       if (IShowInSource.class == adapter) {
           return new IShowInSource() {
               public ShowInContext getShowInContext() {
                   ResourceBundleKey entry = getSelectedEntry();
                   if (entry == null) {
                       return null;
                   }
                   ResourceBundle bundle = entry.getParent().getBundle(
                           new Locale(""));
                   if (bundle == null) {
                       return null;
                   }
                   Object resource = bundle.getUnderlyingResource();
                   return new ShowInContext(resource, new StructuredSelection(
                           resource));
               }
           };
       }
       return super.getAdapter(adapter);
   }
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:24,代码来源:LocalizationEditor.java


示例2: getAdapter

import org.eclipse.ui.part.IShowInSource; //导入依赖的package包/类
@SuppressWarnings("unchecked")
@Override
public Object getAdapter(Class adapter) {
	if (IShowInSource.class == adapter) {
		return new IShowInSource() {
			public ShowInContext getShowInContext() {
				ResourceBundleKey entry = getSelectedEntry();
				if (entry == null)
					return null;
				ResourceBundle bundle = entry.getParent().getBundle(new Locale(""));
				if (bundle == null)
					return null;
				Object resource = bundle.getUnderlyingResource();
				return new ShowInContext(resource, new StructuredSelection(resource));
			}
		};
	}
	return super.getAdapter(adapter);
}
 
开发者ID:wolfgang-ch,项目名称:mytourbook,代码行数:20,代码来源:LocalizationEditor.java


示例3: getAdapter

import org.eclipse.ui.part.IShowInSource; //导入依赖的package包/类
@Override
public Object getAdapter(Class key) {
	if (key.equals(ISelectionProvider.class))
		return fViewer;
	if (key == IShowInSource.class) {
		return getShowInSource();
	}
	if (key == IShowInTargetList.class) {
		return new IShowInTargetList() {
			public String[] getShowInTargetIds() {
				return new String[] { JavaPlugin.ID_RES_NAV };
			}

		};
	}
	if (key == IContextProvider.class) {
		return JavaUIHelp.getHelpContextProvider(this, IJavaHelpContextIds.PACKAGES_VIEW);
	}
	return super.getAdapter(key);
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:21,代码来源:PackageExplorerPart.java


示例4: getAdapter

import org.eclipse.ui.part.IShowInSource; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
   @Override
public Object getAdapter(Class adapter) {
   	if (adapter == IShowInSource.class) {
   		return getShowInSource();
   	}
   	if (adapter == IContextProvider.class) {
   		return JavaUIHelp.getHelpContextProvider(this, IJavaHelpContextIds.CALL_HIERARCHY_VIEW);
   	}
	if (adapter == IShowInTargetList.class) {
		return new IShowInTargetList() {
			public String[] getShowInTargetIds() {
				return new String[] { JavaUI.ID_PACKAGES, JavaPlugin.ID_RES_NAV };
			}
		};
	}
   	return super.getAdapter(adapter);
   }
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:21,代码来源:CallHierarchyViewPart.java


示例5: getAdapter

import org.eclipse.ui.part.IShowInSource; //导入依赖的package包/类
public Object getAdapter(Class key) {
	if (key == IShowInSource.class) {
		return getShowInSource();
	}
	if (key == IShowInTargetList.class) {
		return new IShowInTargetList() {
			public String[] getShowInTargetIds() {
				return new String[] { JavaUI.ID_PACKAGES };
			}

		};
	}
	if (key == IShowInTarget.class) {
		return getShowInTarget();
	}

	return null;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:19,代码来源:JavaOutlinePage.java


示例6: getAdapter

import org.eclipse.ui.part.IShowInSource; //导入依赖的package包/类
@Override
public Object getAdapter(Class key) {
	if (key == IShowInSource.class) {
		return getShowInSource();
	}
	if (key == IShowInTargetList.class) {
		return new IShowInTargetList() {
			public String[] getShowInTargetIds() {
				return new String[] { JavaUI.ID_PACKAGES, JavaPlugin.ID_RES_NAV  };
			}

		};
	}
	if (key == IContextProvider.class) {
		return JavaUIHelp.getHelpContextProvider(this, IJavaHelpContextIds.TYPE_HIERARCHY_VIEW);
	}
	return super.getAdapter(key);
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:19,代码来源:TypeHierarchyViewPart.java


示例7: getAdapter

import org.eclipse.ui.part.IShowInSource; //导入依赖的package包/类
@Override
public Object getAdapter(Class adapter) {
	if (adapter == IPropertySheetPage.class) {
		propertyPage = new PropertySheetPage();
		return propertyPage;
	}
	if (adapter == IShowInSource.class) {
		return new IShowInSource() {
			public ShowInContext getShowInContext() {
				return new ShowInContext(null, bookmarksTreeViewer.getSelection());
			}
		};
	}
	return super.getAdapter(adapter);
}
 
开发者ID:cchabanois,项目名称:mesfavoris,代码行数:16,代码来源:BookmarksView.java


示例8: getAdapter

import org.eclipse.ui.part.IShowInSource; //导入依赖的package包/类
public Object getAdapter(Class adapter) {
	if (IShowInTargetList.class.equals(adapter)) {
		return SHOW_IN_TARGET_LIST;
	}

	if (adapter == IShowInSource.class) {
		ISelectionProvider selectionProvider= getSite().getSelectionProvider();
		if (selectionProvider == null)
			return null;

		ISelection selection= selectionProvider.getSelection();
		if (selection instanceof IStructuredSelection) {
			IStructuredSelection structuredSelection= ((StructuredSelection)selection);
			final Set newSelection= new HashSet(structuredSelection.size());
			Iterator iter= structuredSelection.iterator();
			while (iter.hasNext()) {
				Object element= iter.next();
				if (element instanceof LineElement)
					element= ((LineElement)element).getParent();
				newSelection.add(element);
			}

			return new IShowInSource() {
				public ShowInContext getShowInContext() {
					return new ShowInContext(null, new StructuredSelection(new ArrayList(newSelection)));
				}
			};
		}
		return null;
	}

	return null;
}
 
开发者ID:angelozerr,项目名称:typescript.java,代码行数:34,代码来源:TypeScriptSearchResultPage.java


示例9: getAdapter

import org.eclipse.ui.part.IShowInSource; //导入依赖的package包/类
@Override
public Object getAdapter(Class adapter) {
    if (adapter.equals(ISelectionProvider.class)) {
        return treeSelectionHandler;
    }
    if (adapter == IShowInSource.class) {
        return this;
    }
    return super.getAdapter(adapter);
}
 
开发者ID:iloveeclipse,项目名称:jdepend4eclipse,代码行数:11,代码来源:PackageTreeView.java


示例10: getShowInSource

import org.eclipse.ui.part.IShowInSource; //导入依赖的package包/类
/**
 * Returns the <code>IShowInSource</code> for this view.
 * @return the <code>IShowInSource</code>
 */
protected IShowInSource getShowInSource() {
	return new IShowInSource() {
		public ShowInContext getShowInContext() {
			return new ShowInContext(
				getTreeViewer().getInput(),
				getTreeViewer().getSelection());
		}
	};
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:14,代码来源:PackageExplorerPart.java


示例11: getShowInSource

import org.eclipse.ui.part.IShowInSource; //导入依赖的package包/类
/**
 * @return the <code>IShowInSource</code> for this view.
 */
private IShowInSource getShowInSource() {
	return new IShowInSource() {
		public ShowInContext getShowInContext() {
			return new ShowInContext(null, fSelectionProviderMediator.getSelection());
		}
	};
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:11,代码来源:CallHierarchyViewPart.java


示例12: getShowInSource

import org.eclipse.ui.part.IShowInSource; //导入依赖的package包/类
/**
 * Returns the <code>IShowInSource</code> for this view.
 *
 * @return the {@link IShowInSource}
 */
protected IShowInSource getShowInSource() {
	return new IShowInSource() {
		public ShowInContext getShowInContext() {
			return new ShowInContext(
				null,
				getSite().getSelectionProvider().getSelection());
		}
	};
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:15,代码来源:JavaOutlinePage.java


示例13: getShowInSource

import org.eclipse.ui.part.IShowInSource; //导入依赖的package包/类
/**
 * @return Returns the <code>IShowInSource</code> for this view.
 */
protected IShowInSource getShowInSource() {
	return new IShowInSource() {
		public ShowInContext getShowInContext() {
			return new ShowInContext(
				null,
			getSite().getSelectionProvider().getSelection());
		}
	};
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:13,代码来源:TypeHierarchyViewPart.java


示例14: getAdapter

import org.eclipse.ui.part.IShowInSource; //导入依赖的package包/类
@Override
public Object getAdapter(Class key) {
	if (key == IShowInSource.class) {
		return getShowInSource();
	}
	if (key == IContextProvider.class)
		return JavaUIHelp.getHelpContextProvider(this, getHelpContextId());

	return super.getAdapter(key);
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:11,代码来源:JavaBrowsingPart.java


示例15: getShowInSource

import org.eclipse.ui.part.IShowInSource; //导入依赖的package包/类
/**
 * Returns the <code>IShowInSource</code> for this view.
 * @return returns the <code>IShowInSource</code>
 */
protected IShowInSource getShowInSource() {
	return new IShowInSource() {
		public ShowInContext getShowInContext() {
			return new ShowInContext(
				null,
			getSite().getSelectionProvider().getSelection());
		}
	};
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:14,代码来源:JavaBrowsingPart.java


示例16: getAdapter

import org.eclipse.ui.part.IShowInSource; //导入依赖的package包/类
public Object getAdapter(Class<?> adapter) {
    if (IShowInTargetList.class.equals(adapter)) {
        return SHOW_IN_TARGET_LIST;
    }

    if (adapter == IShowInSource.class) {
        ISelectionProvider selectionProvider = getSite().getSelectionProvider();
        if (selectionProvider == null) {
            return null;
        }

        ISelection selection = selectionProvider.getSelection();
        if (selection instanceof IStructuredSelection) {
            IStructuredSelection structuredSelection = ((StructuredSelection) selection);
            final Set<Object> newSelection = new HashSet<>(structuredSelection.size());
            Iterator<?> iter = structuredSelection.iterator();
            while (iter.hasNext()) {
                Object element = iter.next();
                if (element instanceof ICustomLineElement) {
                    element = ((ICustomLineElement) element).getParent();
                }
                newSelection.add(element);
            }

            return new IShowInSource() {
                @Override
                public ShowInContext getShowInContext() {
                    return new ShowInContext(null, new StructuredSelection(new ArrayList<>(newSelection)));
                }
            };
        }
        return null;
    }

    return null;
}
 
开发者ID:fabioz,项目名称:Pydev,代码行数:37,代码来源:AbstractSearchIndexResultPage.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java SubscriberExceptionContext类代码示例发布时间:2022-05-21
下一篇:
Java Button类代码示例发布时间:2022-05-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap