本文整理汇总了Java中org.eclipse.equinox.app.IApplicationContext类的典型用法代码示例。如果您正苦于以下问题:Java IApplicationContext类的具体用法?Java IApplicationContext怎么用?Java IApplicationContext使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
IApplicationContext类属于org.eclipse.equinox.app包,在下文中一共展示了IApplicationContext类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: start
import org.eclipse.equinox.app.IApplicationContext; //导入依赖的package包/类
@Override
public Object start ( final IApplicationContext context ) throws Exception
{
Display display = PlatformUI.createDisplay ();
try
{
int returnCode = PlatformUI.createAndRunWorkbench ( display, new ApplicationWorkbenchAdvisor () );
if ( returnCode == PlatformUI.RETURN_RESTART )
{
return IApplication.EXIT_RESTART;
}
else
{
return IApplication.EXIT_OK;
}
}
finally
{
display.dispose ();
}
}
示例2: start
import org.eclipse.equinox.app.IApplicationContext; //导入依赖的package包/类
@Override
public Object start ( final IApplicationContext context ) throws Exception
{
final String[] args = (String[])context.getArguments ().get ( IApplicationContext.APPLICATION_ARGS );
if ( args == null )
{
return null;
}
for ( final String uri : args )
{
new SystemRunner ().process ( URI.createURI ( uri ), URI.createURI ( uri + ".eswm" ), new NullProgressMonitor () );
}
return null;
}
示例3: start
import org.eclipse.equinox.app.IApplicationContext; //导入依赖的package包/类
public Object start ( final IApplicationContext context ) throws Exception
{
final Collection<Future<?>> tasks = new LinkedList<Future<?>> ();
tasks.add ( this.executor.submit ( new ConnectionRunner ( "hd:net://localhost:1402", "h.1" ) ) );
tasks.add ( this.executor.submit ( new ConnectionRunner ( "da:net://localhost:1402", "h.1" ) ) );
tasks.add ( this.executor.submit ( new ConnectionRunner ( "hd:net://localhost:1402", "h.1" ) ) );
tasks.add ( this.executor.submit ( new ConnectionRunner ( "hd:net://localhost:1402", "h.1" ) ) );
for ( final Future<?> task : tasks )
{
task.get ();
}
this.executor.shutdown ();
dumpPerformanData ();
return null;
}
示例4: start
import org.eclipse.equinox.app.IApplicationContext; //导入依赖的package包/类
@Override
public Object start(IApplicationContext context) {
try {
return Main.main(Platform.getApplicationArgs()) ? EXIT_OK : EXIT_ERROR;
} catch (Exception e) {
e.printStackTrace(System.err);
Status error = new Status(IStatus.ERROR, ApgdiffConsts.APGDIFF_PLUGIN_ID,
"pgCodeKeeper error", e);
Platform.getLog(Activator.getContext().getBundle()).log(error);
return EXIT_ERROR;
} finally {
// only needed when org.apache.felix.gogo.shell bundle is present
/*try {
// see bug #514338
Thread.sleep(110);
} catch (InterruptedException ex) {
// no action
}*/
}
}
示例5: start
import org.eclipse.equinox.app.IApplicationContext; //导入依赖的package包/类
@Override
public Object start(IApplicationContext ctxt) throws Exception {
Activator.log(IStatus.INFO, "Starting VerveineC");
String[] appArgs = (String[])ctxt.getArguments().get(IApplicationContext.APPLICATION_ARGS);
VerveineCParser verveine = new VerveineCParser();
verveine.setOptions(appArgs);
if (verveine.parse()) {
verveine.emitMSE();
}
else {
Activator.log(IStatus.ERROR, "Error in model creation, aborting");
}
return null;
}
示例6: start
import org.eclipse.equinox.app.IApplicationContext; //导入依赖的package包/类
@Override
public Object start(final IApplicationContext context) throws Exception {
Object o = context.getArguments().get(IApplicationContext.APPLICATION_ARGS);
Display.getDefault();
if (o != null && o instanceof String[]) {
String[] args = (String[]) o;
for (int i = 0; i < args.length; i++) {
if (args[i].equals(DESTINATION_ARG)) {
m_directory = new File(args[i + 1]);
} else if (args[i].equals(CATEGORY_ARG)) {
m_catPath = args[i + 1];
} else if (args[i].equals(PLUGIN_ARG)) {
m_pluginIds.add(args[i + 1]);
} else if (args[i].equals(INCLUDE_DEPRECATED_ARG)) {
m_includeDeprecated = true;
} else if (args[i].equals("-help")) {
printUsage();
return EXIT_OK;
}
}
}
if (m_directory == null) {
System.err.println("No output directory specified");
printUsage();
return 1;
} else if (!m_directory.exists() && !m_directory.mkdirs()) {
System.err.println("Could not create output directory '" + m_directory.getAbsolutePath() + "'.");
return 1;
}
generate();
return EXIT_OK;
}
示例7: start
import org.eclipse.equinox.app.IApplicationContext; //导入依赖的package包/类
@Override
public Object start(IApplicationContext context) throws Exception {
JavaLanguageServerPlugin.startLanguageServer(this);
synchronized(waitLock){
while (!shutdown) {
try {
context.applicationRunning();
JavaLanguageServerPlugin.logInfo("Main thread is waiting");
waitLock.wait();
} catch (InterruptedException e) {
JavaLanguageServerPlugin.logException(e.getMessage(), e);
}
}
}
return IApplication.EXIT_OK;
}
示例8: openProjects
import org.eclipse.equinox.app.IApplicationContext; //导入依赖的package包/类
@Override
public Object openProjects(Display display, IApplicationContext context, Map<String, Object> parameters) {
IProject[] allProjects = ResourcesPlugin.getWorkspace().getRoot().getProjects(IContainer.INCLUDE_HIDDEN);
if (allProjects != null && allProjects.length > 0)
return null;
try {
IProject[] initialProjects = createProjects();
// put project into parameters map as requested by API to make it available to other extension points
parameters.put(PROJECTS, initialProjects);
return null;
} catch (IOException | CoreException e) {
log.log(Level.SEVERE, "Could not create default projects", e);
}
return null;
}
示例9: start
import org.eclipse.equinox.app.IApplicationContext; //导入依赖的package包/类
/**
* @see org.eclipse.equinox.app.IApplication#start(org.eclipse.equinox.app.IApplicationContext) <!-- begin-user-doc --> <!-- end-user-doc -->
* @generated
*/
@Override
public Object start(IApplicationContext context) throws Exception {
WorkbenchAdvisor workbenchAdvisor = new TriquetrumEditorAdvisor();
Display display = PlatformUI.createDisplay();
try {
int returnCode = PlatformUI.createAndRunWorkbench(display, workbenchAdvisor);
if (returnCode == PlatformUI.RETURN_RESTART) {
return IApplication.EXIT_RESTART;
} else {
return IApplication.EXIT_OK;
}
} finally {
display.dispose();
}
}
示例10: start
import org.eclipse.equinox.app.IApplicationContext; //导入依赖的package包/类
/**
* @see org.eclipse.equinox.app.IApplication#start(org.eclipse.equinox.app.IApplicationContext)
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Object start(IApplicationContext context) throws Exception {
WorkbenchAdvisor workbenchAdvisor = new WTSpec4MEditorAdvisor();
Display display = PlatformUI.createDisplay();
try {
int returnCode = PlatformUI.createAndRunWorkbench(display, workbenchAdvisor);
if (returnCode == PlatformUI.RETURN_RESTART) {
return IApplication.EXIT_RESTART;
}
else {
return IApplication.EXIT_OK;
}
}
finally {
display.dispose();
}
}
示例11: start
import org.eclipse.equinox.app.IApplicationContext; //导入依赖的package包/类
@Override
public Object start(IApplicationContext context) throws Exception {
// We need to test the secure store, so the user will get a warning
// if they haven't set up a proper password.
ISecurePreferences factory = SecurePreferencesFactory.getDefault();
final ISecurePreferences node = factory.node(TEST_NODE);
node.put(TEST_KEY, "1", true);
if (!node.isEncrypted(TEST_KEY)) {
LOGGER.error("Secure store not encrypted: please revise your setup!");
} else {
LOGGER.info("Secure store encrypted: setup is OK");
}
factory.flush();
System.out.println("\n"
+ "Welcome to the MONDO Server!\n"
+ "List available commands with '" + ServerCommandProvider.MSERVER_HELP_CMD + "'.\n"
+ "Stop the server with 'shutdown' and then 'close'.\n");
// We don't really do anything at the moment for the application:
// we just want a working Equinox instance for now
return IApplication.EXIT_OK;
}
示例12: start
import org.eclipse.equinox.app.IApplicationContext; //导入依赖的package包/类
@Override
public Object start(IApplicationContext context) throws Exception
{
String[] args = (String[])context.getArguments().get("application.args");
System.out.println("Arguments:");
for(String arg: args)
System.out.println("\t" + arg);
ClientProxy proxy;
if (args.length == 1)
proxy = new ClientProxy(args[0]);
else
proxy = new ClientProxy();
try
{
proxy.Run();
}
catch(IOException e)
{
e.printStackTrace();
}
return null;
}
示例13: start
import org.eclipse.equinox.app.IApplicationContext; //导入依赖的package包/类
@Override
public Object start(IApplicationContext context) throws Exception {
String[] args = (String[]) context.getArguments().get(
IApplicationContext.APPLICATION_ARGS);
if (args.length < 3) {
System.err.println("Usage: eclipse -application com.google.gwt.eclipse.core.formatter.GWTCodeFormatterApplication "
+ "<javaFormatterConfigFile> <jsFormatterConfigFile> <sourceFile1> [<sourceFile2>] ...");
return IApplication.EXIT_OK;
}
javaConfig = getConfig(args[0]);
jsConfig = getConfig(args[1]);
// The JavaScriptCore plugin, which the JS formatter depends on, requires
// the workbench, so start one manually
startWorkbench();
for (int i = 2; i < args.length; i++) {
File f = new File(args[i]);
format(f);
}
return IApplication.EXIT_OK;
}
示例14: start
import org.eclipse.equinox.app.IApplicationContext; //导入依赖的package包/类
public Object start(IApplicationContext context) throws Exception
{
Display display = PlatformUI.createDisplay();
try
{
Logger.info("Application starting", Level.MAIN, this);
int returnCode = PlatformUI.createAndRunWorkbench(display,
new ApplicationWorkbenchAdvisor());
Logger.info("Workbench exited with code " + returnCode, Level.MAIN,
this);
if (returnCode == PlatformUI.RETURN_RESTART) return IApplication.EXIT_RESTART;
else return IApplication.EXIT_OK;
}
finally
{
display.dispose();
}
}
示例15: start
import org.eclipse.equinox.app.IApplicationContext; //导入依赖的package包/类
public Object start(IApplicationContext context) throws Exception {
Display display = PlatformUI.createDisplay();
// OntologyEditorView.setMyOntologyTree(new MyOntologyTrees());
Activator.getDefault().createResource();
Regex.loadRegex();
// Activator.getDefault().getResource().setDisplay(this._display);
// _global = new Global(_i2b2ImportTool, _display);
try {
int returnCode = PlatformUI.createAndRunWorkbench(display,
new ApplicationWorkbenchAdvisor());
if (returnCode == PlatformUI.RETURN_RESTART)
return IApplication.EXIT_RESTART;
else
return IApplication.EXIT_OK;
} finally {
display.dispose();
}
}