Skip to content
This repository has been archived by the owner on Dec 29, 2022. It is now read-only.

Commit

Permalink
Resolve circular dependency between org.eclipse.mylyn.monitor.* and
Browse files Browse the repository at this point in the history
org.eclipse.mylyn.context.*

eclipse-mylyn/org.eclipse.mylyn.commons#16
  • Loading branch information
BeckerFrank committed Nov 29, 2022
1 parent e4b7925 commit 89680bd
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 18 deletions.
6 changes: 6 additions & 0 deletions org.eclipse.mylyn.context.core/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,10 @@
<extension-point id="internalBridges" name="Internal Bridges" schema="schema/internalBridges.exsd"/>
<extension-point id="relationProviders" name="relationProviders" schema="schema/relationProviders.exsd"/>
<extension-point id="strategies" name="strategies" schema="schema/strategies.exsd"/>
<extension
point="org.eclipse.mylyn.commons.context.ContextCallBack">
<ContextCallBack
class="org.eclipse.mylyn.internal.context.core.ContextCallBack">
</ContextCallBack>
</extension>
</plugin>
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/*******************************************************************************
* Copyright (c) 2022 Frank Becker and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Frank Becker - initial API and implementation
*******************************************************************************/

package org.eclipse.mylyn.internal.context.core;

import org.eclipse.mylyn.common.context.IContextCallBack;
import org.eclipse.mylyn.context.core.ContextCore;
import org.eclipse.mylyn.monitor.core.InteractionEvent;

public class ContextCallBack implements IContextCallBack {

@Override
public void processActivityMetaContextEvent(InteractionEvent event) {
ContextCorePlugin.getContextManager().processActivityMetaContextEvent(event);
}

@Override
public String getActiveContextHandleIdentifier() {
if (ContextCore.getContextManager().getActiveContext().getHandleIdentifier() != null) {
return ContextCore.getContextManager().getActiveContext().getHandleIdentifier();
}
return null;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,13 @@
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Plugin;
import org.eclipse.core.runtime.Status;
import org.eclipse.mylyn.common.context.CommonContextPlugin;
import org.eclipse.mylyn.common.context.ContextCallBack;
import org.eclipse.mylyn.commons.core.ExtensionPointReader;
import org.eclipse.mylyn.commons.core.StatusHandler;
import org.eclipse.mylyn.context.core.AbstractContextContributor;
import org.eclipse.mylyn.context.core.AbstractContextStructureBridge;
import org.eclipse.mylyn.context.core.ContextCore;
import org.eclipse.mylyn.context.core.IContextContributor;
import org.eclipse.mylyn.context.core.IInteractionContextScaling;
import org.eclipse.mylyn.monitor.core.InteractionEvent;
import org.osgi.framework.BundleContext;

/**
Expand Down Expand Up @@ -159,21 +156,6 @@ public void start(BundleContext context) throws Exception {
}
contextStore.setContextDirectory(storeFile);
contextManager = new InteractionContextManager(contextStore);
CommonContextPlugin.getDefault().setContextCallBack(new ContextCallBack() {

@Override
public void processActivityMetaContextEvent(InteractionEvent event) {
ContextCorePlugin.getContextManager().processActivityMetaContextEvent(event);
}

@Override
public String getActiveContextHandleIdentifier() {
if (ContextCore.getContextManager().getActiveContext().getHandleIdentifier() != null) {
return ContextCore.getContextManager().getActiveContext().getHandleIdentifier();
}
return null;
}
});
}

@Override
Expand Down

0 comments on commit 89680bd

Please sign in to comment.