import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.argeo.cms.CmsException;
-import org.argeo.cms.CmsStyles;
-import org.argeo.cms.CmsUiProvider;
+import org.argeo.cms.ui.CmsStyles;
+import org.argeo.cms.ui.CmsUiProvider;
import org.eclipse.rap.rwt.RWT;
import org.eclipse.rap.rwt.service.ResourceManager;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Label;
import org.osgi.framework.BundleContext;
-import org.osgi.framework.FrameworkUtil;
/** A link to an internal or external location. */
public class CmsLink implements CmsUiProvider {
private final static Log log = LogFactory.getLog(CmsLink.class);
- private BundleContext bc = FrameworkUtil.getBundle(getClass())
- .getBundleContext();
+ private BundleContext bundleContext ;
private String label;
private String custom;
// pure URL
url = new URL(image);
} catch (MalformedURLException e1) {
- url = bc.getBundle().getResource(image);
+ url = bundleContext.getBundle().getResource(image);
}
if (url == null)
return url;
}
+ public void setBundleContext(BundleContext bundleContext) {
+ this.bundleContext = bundleContext;
+ }
+
public void setLabel(String label) {
this.label = label;
}