本文整理汇总了Java中org.eclipse.e4.core.services.log.Logger类的典型用法代码示例。如果您正苦于以下问题:Java Logger类的具体用法?Java Logger怎么用?Java Logger使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Logger类属于org.eclipse.e4.core.services.log包,在下文中一共展示了Logger类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: init
import org.eclipse.e4.core.services.log.Logger; //导入依赖的package包/类
/**
* Initialize the preference page.
*/
public void init(IWorkbench workbench) {
// BundleContext bundleContext = Platform.getBundle("org.bbaw.bts.ui.main").getBundleContext();
context = StaticAccessController.getContext();
corpusController = context.get(CorpusNavigatorController.class);
prefs = ConfigurationScope.INSTANCE.getNode("org.bbaw.bts.app");
IEclipsePreferences defaultpref = DefaultScope.INSTANCE.getNode("org.bbaw.bts.app");
main_corpus_key = prefs.get(BTSPluginIDs.PREF_MAIN_CORPUS_KEY, defaultpref.get(BTSPluginIDs.PREF_MAIN_CORPUS_KEY, null));
active_corpora = prefs.get(BTSPluginIDs.PREF_ACTIVE_CORPORA, defaultpref.get(BTSPluginIDs.PREF_ACTIVE_CORPORA, null));
logger = context.get(Logger.class);
loadListInput();
activate = prefs.getBoolean(BTSPluginIDs.PREF_CORPUS_ACTIVATE_MAIN_CORPUS_SELECTION, false);
initialActivate = new Boolean(activate);
mainCorpusComboViewer.getCombo().setEnabled(activate);
activateButton.setSelection(activate);
}
示例2: execute
import org.eclipse.e4.core.services.log.Logger; //导入依赖的package包/类
@Execute
public void execute(@OSGiBundle BundleContext bundleContext,
@Named(PLUGIN_ID_PARAMETER) String pluginId, @Optional Logger logger) {
Bundle bundle = Platform.getBundle(pluginId);
if (bundle != null) {
try {
bundle.uninstall();
Activator.getDefault().removeDynamicBundle(bundle);
} catch (BundleException e) {
logger.warn(
e,
"Failed to uninstall bundle "
+ bundle.getSymbolicName());
}
}
}
示例3: setUp
import org.eclipse.e4.core.services.log.Logger; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
image = new Image(device, 1, 1);
languages = new LanguageService(Locale.ENGLISH.getLanguage());
context = EclipseContextFactory.create("test context");
context.set(Logger.class, log);
context.set(IEventBroker.class, eventBroker);
context.set(LanguageService.class, languages);
context.set(IDataService.class, dataService);
context.set(IBrowserManager.class, browserManager);
term1 = data.createTerm("term 1");
term2 = data.createTerm("term 2");
person1 = data.createPerson("person1", "1");
person2 = data.createPerson("person2", "2");
person3 = data.createPerson("person3", "3");
}
示例4: handleDrop
import org.eclipse.e4.core.services.log.Logger; //导入依赖的package包/类
@Override
public void handleDrop(final Object inEventData,
final IAssociationsModel inModel,
final IEclipseContext inContext) {
try {
final String lFileName = ((String[]) inEventData)[0];
final IMetadataExtractor lMetadataExtractor = inContext
.get(IMetadataExtractor.class);
final UniqueID lID = lMetadataExtractor
.extract(new File(lFileName));
addAsRelations(new UniqueID[] { lID }, inModel, inContext);
}
catch (final Exception exc) {
final Logger lLog = inContext.get(Logger.class);
if (lLog != null) {
lLog.error(exc, exc.getMessage());
}
}
}
示例5: createMinText
import org.eclipse.e4.core.services.log.Logger; //导入依赖的package包/类
private UniqueID createMinText(IAssociationsModel model,
IEclipseContext context, String url, Logger log) {
try {
final String undefined = RelationsMessages
.getString("TextEditWizardPage.uncomplete.data"); //$NON-NLS-1$
final NewTextAction action = new NewTextAction.Builder(
undefined, undefined).type(AbstractText.TYPE_WEBPAGE)
.publication(url).build(context);
final IItem item = createText(action);
final UniqueID id = new UniqueID(item.getItemType(),
item.getID());
addAsRelations(new UniqueID[] { id }, model, context);
return id;
}
catch (final VException exc) {
log.error(exc);
}
return null;
}
示例6: getItemDeleteAction
import org.eclipse.e4.core.services.log.Logger; //导入依赖的package包/类
@Override
public IAction getItemDeleteAction(final Logger inLog) {
return new IAction() {
@Override
public void run() throws BOMException {
try {
IItemFactory lHome = BOMHelper.getTermHome(); // default
switch (getItemType()) {
case IItem.TERM:
lHome = BOMHelper.getTermHome();
break;
case IItem.TEXT:
lHome = BOMHelper.getTextHome();
break;
case IItem.PERSON:
lHome = BOMHelper.getPersonHome();
break;
}
lHome.deleteItem(getID());
}
catch (final VException exc) {
throw new BOMException(exc);
}
}
};
}
示例7: dropTables
import org.eclipse.e4.core.services.log.Logger; //导入依赖的package包/类
private static void dropTables(final Logger inLog) {
try {
final ICreatableHome[] lHomes = new ICreatableHome[4];
lHomes[0] = BOMHelper.getTermHome();
lHomes[1] = BOMHelper.getTextHome();
lHomes[2] = BOMHelper.getPersonHome();
lHomes[3] = BOMHelper.getRelationHome();
final DefaultStatement lStatement = new DefaultStatement();
for (int i = 0; i < lHomes.length; i++) {
final String[] lSQL = lHomes[i].getSQLDrop();
for (int j = 0; j < lSQL.length; j++) {
lStatement.execute(lSQL[j]);
}
}
}
catch (final SQLException exc) {
inLog.error(exc, exc.getMessage());
MessageDialog
.openError(
new Shell(Display.getCurrent()),
RelationsMessages
.getString("DBDeleteAction.error.title"), ERROR_MSG); //$NON-NLS-1$
}
}
示例8: handleEvent
import org.eclipse.e4.core.services.log.Logger; //导入依赖的package包/类
@Override
public void handleEvent(Event event) {
Object textId = event.getProperty(IEventBroker.DATA);
if (textId instanceof UniqueID) {
IEclipseContext context = (IEclipseContext) event
.getProperty(PARAM_CONTEXT);
try {
IDataService dataService = context.get(IDataService.class);
ItemEditHandler.openEditDialog(new ItemAdapter(
dataService.retrieveItem((UniqueID) textId), context),
context);
}
catch (BOMException exc) {
context.get(Logger.class).error(exc);
}
}
}
示例9: managePostContextCreate
import org.eclipse.e4.core.services.log.Logger; //导入依赖的package包/类
@PostContextCreate
void managePostContextCreate(final IEclipseContext context, BTSProjectService projectService,
IApplicationContext appContext, Logger logger, ApplicationStartupController applicationStartupController)
// @Optional MWindow window,
// IEventBroker eventBroker)
{
// if (window != null)
// {
// try {
// setWindowImage(window);
// } catch (Exception e) {
// // TODO Auto-generated catch block
// e.printStackTrace();
// }
// }
// else
// {
// // The should be a better way to close the Splash
// eventBroker.subscribe(UIEvents.UILifeCycle.ACTIVATE,
// new EventHandler() {
// @Override
// public void handleEvent(Event event) {
// MWindow w = context.get(MWindow.class);
// if (w == null) return;
// try {
// setWindowImage(w);
// } catch (Exception e) {
// // TODO Auto-generated catch block
// e.printStackTrace();
// }
// }
// });
// }
logger.info("ApplicationStartupControllerImpl.applicationStartup");
applicationStartupController.applicationStartup(context, projectService, appContext);
}
示例10: fetchAndIndexChangesSeq
import org.eclipse.e4.core.services.log.Logger; //导入依赖的package包/类
public static int fetchAndIndexChangesSeq(String collection, BulkProcessor bulkProcessor, Client esClient, CouchDbClient dbClient, int seq, IProgressMonitor monitor, Logger logger)
{
List<String> lines = fetchLine(collection, dbClient, seq);
Object returnSeq = processLines(lines, collection, bulkProcessor, monitor, logger);
if (returnSeq instanceof String)
{
seq = new Integer(((String) returnSeq)).intValue();
}
return seq;
}
示例11: processLines
import org.eclipse.e4.core.services.log.Logger; //导入依赖的package包/类
private static Object processLines(List<String> lines, String indexName,
BulkProcessor bulkProcessor, IProgressMonitor monitor, Logger logger) {
for (String line : lines)
{
processLine(line, indexName, bulkProcessor, monitor, logger);
}
return null;
}
示例12: processDocLine
import org.eclipse.e4.core.services.log.Logger; //导入依赖的package包/类
private static void processDocLine(String docString, String indexName,
Client esClient, BulkProcessor bulkProcessor, IProgressMonitor monitor, Logger logger) {
Map<String, Object> doc;
try {
doc = XContentFactory.xContent(XContentType.JSON).createParser(docString).mapAndClose();
} catch (IOException e) {
logger.warn("failed to parse {}", e, docString);
return;
}
if (doc.containsKey("error")) {
logger.warn("received error {}", docString);
return;
}
Object oId = doc.get("_id");
if (oId == null) {
return;
}
String id = oId.toString();
IndexResponse response = esClient.prepareIndex(indexName, indexName, id)
.setSource(docString)
.execute()
.actionGet();
if (monitor != null)
{
monitor.worked(1);
if (monitor.isCanceled()) return;
}
return;
}
示例13: LoginDialog
import org.eclipse.e4.core.services.log.Logger; //导入依赖的package包/类
public LoginDialog(Shell parentShell, IEclipseContext context,
BTSUserController userController)
{
super(parentShell);
this.shell = parentShell;
this.userController = userController;
this.logger = context.get(Logger.class);
}
示例14: init
import org.eclipse.e4.core.services.log.Logger; //导入依赖的package包/类
/**
* Initialize the preference page.
*/
public void init(IWorkbench workbench) {
// BundleContext bundleContext = Platform.getBundle("org.bbaw.bts.ui.main").getBundleContext();
context = StaticAccessController.getContext();
projectController = context.get(BTSProjectController.class);
prefs = ConfigurationScope.INSTANCE.getNode("org.bbaw.bts.app");
main_project = prefs.get(BTSPluginIDs.PREF_MAIN_PROJECT_KEY, null);
active_projects = prefs.get(BTSPluginIDs.PREF_ACTIVE_PROJECTS, null);
logger = context.get(Logger.class);
loadListInput();
}
示例15: init
import org.eclipse.e4.core.services.log.Logger; //导入依赖的package包/类
/**
* Initialize the preference page.
*/
public void init(IWorkbench workbench) {
// BundleContext bundleContext = Platform.getBundle("org.bbaw.bts.ui.main").getBundleContext();
IEclipseContext context = StaticAccessController.getContext();
logger = context.get(Logger.class);
if (isRemembered())
{
btnCheckButton.setSelection(true);
}
else
{
btnCheckButton.setSelection(false);
}
}