// If it's not persistent, then we'll remove it from the persistent
// warnings list (in case it used to be a persistent warning and has
// been "upgraded" in the meantime).
if (!persistent_notify && persistent_warnings.remove(persistent_id)) {
COConfigurationManager.setParameter(CONFIG_KEY, new StringListImpl(persistent_warnings));
}
synchronized (PluginDeprecation.class) {
if (model == null) {
final PluginInterface pi = PluginInitializer.getDefaultInterface();
model = pi.getUIManager().createBasicPluginViewModel(MessageText.getString("PluginDeprecation.view"));
model.getStatus().setVisible(false);
model.getProgress().setVisible(false);
model.getActivity().setVisible(false);
model.getLogArea().appendText(
MessageText.getString("PluginDeprecation.log.start", new String[] {
Constants.isCVSVersion() ? FORUM_BETA_LINK : FORUM_STABLE_LINK
})
);
// Force it to be auto-opened.
UIManagerListener uiml = new UIManagerListener() {
public void UIAttached(UIInstance inst) {
if (inst instanceof UISWTInstance) {
((UISWTInstance)inst).openView(model);
pi.getUIManager().removeUIListener(this);
}
}
public void UIDetached(UIInstance inst) {}
};
pi.getUIManager().addUIListener(uiml);
}
String log_details = MessageText.getString(
"PluginDeprecation.log.details",
new String[] {identifier, context, Debug.getStackTrace(false, false)}
);
model.getLogArea().appendText(log_details);
if (channel == null) {
channel = PluginInitializer.getDefaultInterface().getLogger().getChannel("PluginDeprecation");
}
// Maybe it should be repeatable, we'll see..
channel.logAlert(
LoggerChannel.LT_WARNING,
MessageText.getString("PluginDeprecation.alert")
);
Debug.out(new PluginDeprecationException("Deprecated plugin call - " + persistent_id).fillInStackTrace());
}
if (persistent_notify) {
persistent_warnings.add(persistent_id);
COConfigurationManager.setParameter(CONFIG_KEY, new StringListImpl(persistent_warnings));
}
}
if (raise_error) {
throw new PluginDeprecationException(persistent_id);