本文整理汇总了Java中org.eclipse.e4.core.contexts.IEclipseContext.createChild方法的典型用法代码示例。如果您正苦于以下问题:Java IEclipseContext.createChild方法的具体用法?Java IEclipseContext.createChild怎么用?Java IEclipseContext.createChild使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.e4.core.contexts.IEclipseContext
的用法示例。
在下文中一共展示了IEclipseContext.createChild方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: runContainerResolverJob
import org.eclipse.e4.core.contexts.IEclipseContext; //导入方法依赖的package包/类
public static void runContainerResolverJob(IJavaProject javaProject) {
IEclipseContext context = EclipseContextFactory.getServiceContext(
FrameworkUtil.getBundle(BuildPath.class).getBundleContext());
final IEclipseContext childContext =
context.createChild(LibraryClasspathContainerResolverJob.class.getName());
childContext.set(IJavaProject.class, javaProject);
Job job =
ContextInjectionFactory.make(LibraryClasspathContainerResolverJob.class, childContext);
job.addJobChangeListener(new JobChangeAdapter() {
@Override
public void done(IJobChangeEvent event) {
childContext.dispose();
}
});
job.schedule();
}
示例2: execute
import org.eclipse.e4.core.contexts.IEclipseContext; //导入方法依赖的package包/类
@Optional
@Execute
public void execute(
@Optional @Named(IServiceConstants.ACTIVE_SHELL) final Shell shell,
IEclipseContext context,
@Optional @Named("org.bbaw.bts.ui.main.commandparameter.dbManagerMessage") String message) {
IEclipseContext child = context.createChild("DBManager");
child.set("dbManagerMessage", message);
if (shell == null)
{
child.set(Shell.class, new Shell());
}
else
{
child.set(Shell.class, shell);
}
DBManagerDialog dialog = ContextInjectionFactory.make(
DBManagerDialog.class, child);
// context.set(UserManagementDialog.class, dialog);
if (dialog.open() == dialog.OK) {
}
}
示例3: execute
import org.eclipse.e4.core.contexts.IEclipseContext; //导入方法依赖的package包/类
@Execute
public void execute(IEclipseContext context,
@Optional @Named("userId") String userId, BTSUserController userController) {
IEclipseContext child = context.createChild("changePassword");
if (userId != null)
{
BTSUser user = userController.findUser(userId, null);
child.set(BTSUser.class, user);
}
PasswordChangeDialog dialog = ContextInjectionFactory.make(PasswordChangeDialog.class, child);
// context.set(UserManagementDialog.class, dialog);
if (dialog.open() == SWT.OK)
{
}
}
示例4: execute
import org.eclipse.e4.core.contexts.IEclipseContext; //导入方法依赖的package包/类
@Execute
public void execute(@Named(IServiceConstants.ACTIVE_SELECTION) @Optional Object object,
@Named(IServiceConstants.ACTIVE_SHELL) final Shell shell,
IEclipseContext context) {
BTSCorpusObject corpusObject = null;
if (object instanceof BTSCorpusObject)
{
corpusObject = (BTSCorpusObject) object;
}
else if (object instanceof BTSTextSelectionEvent && ((BTSTextSelectionEvent) object).data instanceof BTSCorpusObject)
{
corpusObject = (BTSCorpusObject) ((BTSTextSelectionEvent) object).data;
}
if (corpusObject == null) return;
IEclipseContext child = context.createChild();
child.set(BTSCorpusObject.class, corpusObject);
child.set(Shell.class, shell);
CheckPassportDialog dialog = ContextInjectionFactory.make(
CheckPassportDialog.class, child);
if (dialog.open() == CheckPassportDialog.OK) {
}
}
示例5: execute
import org.eclipse.e4.core.contexts.IEclipseContext; //导入方法依赖的package包/类
@Execute
public void execute(IEclipseContext context, @Named("objectId") String objectId,
CorpusNavigatorController corpusNavigatorController) {
if (objectId != null)
{
BTSObject object = corpusNavigatorController.find(objectId, null);
if (object == null) return;
IEclipseContext child = context.createChild();
child.set(BTSObject.class, object);
child.set(Shell.class, new Shell());
child.set(BTSCoreConstants.CORE_EXPRESSION_MAY_EDIT, false);
PassportEditorDialog dialog = ContextInjectionFactory.make(
PassportEditorDialog.class, child);
if (dialog.open() == dialog.OK) {
}
}
}
示例6: execute
import org.eclipse.e4.core.contexts.IEclipseContext; //导入方法依赖的package包/类
@Execute
public void execute(@Named(IServiceConstants.ACTIVE_SELECTION) @Optional Object object,
@Named(IServiceConstants.ACTIVE_SHELL) final Shell shell,
IEclipseContext context) {
BTSText text = null;
if (object instanceof BTSText)
{
text = (BTSText) object;
}
else if (object instanceof BTSTextSelectionEvent && ((BTSTextSelectionEvent) object).data instanceof BTSText)
{
text = (BTSText) ((BTSTextSelectionEvent) object).data;
}
if (text == null) return;
IEclipseContext child = context.createChild();
child.set(BTSText.class, text);
child.set(Shell.class, shell);
CheckTextDialog dialog = ContextInjectionFactory.make(
CheckTextDialog.class, child);
if (dialog.open() == CheckTextDialog.OK) {
}
}
示例7: execute
import org.eclipse.e4.core.contexts.IEclipseContext; //导入方法依赖的package包/类
@Execute
public void execute(@Optional @Named(IServiceConstants.ACTIVE_SELECTION) Object selection,
@Named(IServiceConstants.ACTIVE_SHELL) final Shell shell,
IEclipseContext context) {
IEclipseContext child = context.createChild();
Object o = context.get(CompareObjectsController.class);
child.set("compareObject", selection);
CompareDialog dialog = ContextInjectionFactory.make(
CompareDialog.class, child);
// context.set(UserManagementDialog.class, dialog);
if (dialog.open() == dialog.OK) {
}
}
示例8: execute
import org.eclipse.e4.core.contexts.IEclipseContext; //导入方法依赖的package包/类
@Execute
public void execute(IEclipseContext context) {
IEclipseContext child = context.createChild();
StatusMessageDialog dialog = new StatusMessageDialog();
ContextInjectionFactory.inject(
dialog, child);
dialog.create();
if (dialog.open() == dialog.OK) {
}
}
示例9: execute
import org.eclipse.e4.core.contexts.IEclipseContext; //导入方法依赖的package包/类
@Optional
@Execute
public void execute(
@Named(IServiceConstants.ACTIVE_SHELL) final Shell shell,
@Named(IServiceConstants.ACTIVE_SELECTION) final BTSDBBaseObject selection,
IEclipseContext context) {
IEclipseContext childContext = context.createChild("Edit Updaters/Readers Context");
childContext.set(BTSCoreConstants.CORE_EXPRESSION_MAY_EDIT,
new Boolean(permissionsController.userMayEditObject(
permissionsController.getAuthenticatedUser(), selection)));
ObjectUpdaterReaderEditorDialog dialog = ContextInjectionFactory.make(
ObjectUpdaterReaderEditorDialog.class, childContext);
childContext.set(ObjectUpdaterReaderEditorDialog.class, dialog);
dialog.open();
}
示例10: execute
import org.eclipse.e4.core.contexts.IEclipseContext; //导入方法依赖的package包/类
@Execute
public void execute(@Optional @Named(IServiceConstants.ACTIVE_SELECTION) Object selection,
@Named(IServiceConstants.ACTIVE_SHELL) final Shell shell,
IEclipseContext context) {
IEclipseContext child = context.createChild();
Object o = context.get(CompareObjectsController.class);
child.set("compareObject", selection);
ConflictsDialog dialog = ContextInjectionFactory.make(
ConflictsDialog.class, child);
// context.set(UserManagementDialog.class, dialog);
if (dialog.open() == dialog.OK) {
}
}
示例11: createSearchViewer
import org.eclipse.e4.core.contexts.IEclipseContext; //导入方法依赖的package包/类
@Override
public SearchViewer createSearchViewer(Composite parent, int style, BTSConfigItem relationConfig, IEclipseContext context) {
if (context == null)
{
context = StaticAccessController.getContext();
}
IEclipseContext child = context.createChild();
child.set(Composite.class, parent);
child.set(BTSConfigItem.class, relationConfig);
child.set(BTSUIConstants.SELECTION_TYPE,
BTSUIConstants.SELECTION_TYPE_SECONDARY);
searchViewer = ContextInjectionFactory.make(
CorpusNavigatorPart.class, child);
return searchViewer;
}
示例12: createSearchViewer
import org.eclipse.e4.core.contexts.IEclipseContext; //导入方法依赖的package包/类
@Override
public SearchViewer createSearchViewer(Composite parent, int style, BTSConfigItem relationConfig, IEclipseContext context) {
if (context == null)
{
context = StaticAccessController.getContext();
}
IEclipseContext child = context.createChild();
child.set(Composite.class, parent);
child.set(BTSConfigItem.class, relationConfig);
child.set(BTSUIConstants.SELECTION_TYPE,
BTSUIConstants.SELECTION_TYPE_SECONDARY);
searchViewer = ContextInjectionFactory.make(
ThsNavigator.class, child);
return searchViewer;
}
示例13: createSearchViewer
import org.eclipse.e4.core.contexts.IEclipseContext; //导入方法依赖的package包/类
@Override
public SearchViewer createSearchViewer(Composite parent, int style, BTSConfigItem relationConfig, IEclipseContext context) {
if (context == null)
{
context = StaticAccessController.getContext();
}
IEclipseContext child = context.createChild();
child.set(Composite.class, parent);
child.set(BTSConfigItem.class, relationConfig);
child.set(BTSUIConstants.SELECTION_TYPE,
BTSUIConstants.SELECTION_TYPE_SECONDARY);
searchViewer = ContextInjectionFactory.make(
LemmaNavigator.class, child);
return searchViewer;
}
示例14: createSearchViewer
import org.eclipse.e4.core.contexts.IEclipseContext; //导入方法依赖的package包/类
@Override
public SearchViewer createSearchViewer(Composite parent, int style, BTSConfigItem relationConfig, IEclipseContext context) {
if (context == null)
{
context = StaticAccessController.getContext();
}
IEclipseContext child = context.createChild();
child.set(Composite.class, parent);
child.set(BTSConfigItem.class, relationConfig);
child.set(BTSUIConstants.SELECTION_TYPE,
BTSUIConstants.SELECTION_TYPE_SECONDARY);
searchViewer = ContextInjectionFactory.make(
ATextNavigatorPart.class, child);
return searchViewer;
}
示例15: execute
import org.eclipse.e4.core.contexts.IEclipseContext; //导入方法依赖的package包/类
@Execute
public void execute(
@Named(IServiceConstants.ACTIVE_SELECTION) BTSCorpusObject corpusObject,
@Named(IServiceConstants.ACTIVE_SHELL) final Shell shell,
EventBroker eventBroker,
CommentController commentController, IEclipseContext context) {
if (corpusObject != null)
{
final BTSComment object = commentController
.createComment((BTSCorpusObject) corpusObject);
BTSRelation rel = null;
if (object.getRelations().isEmpty())
{
rel = BtsmodelFactory.eINSTANCE.createBTSRelation();
rel.setType(BTSCoreConstants.BASIC_RELATIONS_PARTOF);
}
else
{
rel = object.getRelations().get(0);
}
rel.setObjectId(corpusObject.get_id());
object.getRelations().add(rel);
IEclipseContext child = context.createChild();
child.set(BTSComment.class, object);
child.set(Shell.class, shell);
CommentEditorDialog dialog = ContextInjectionFactory.make(
CommentEditorDialog.class, child);
if (dialog.open() == CommentEditorDialog.OK) {
}
}
}