KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > equinox > app > IApplicationContext


1 /*******************************************************************************
2  * Copyright (c) 2005, 2006 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11
12 package org.eclipse.equinox.app;
13
14 import java.util.Map JavaDoc;
15 import org.osgi.framework.Bundle;
16 import org.osgi.service.application.ApplicationDescriptor;
17
18 /**
19  * The context used to start an application.
20  * <p>
21  * This interface is not intended to be implemented by clients.
22  * </p>
23  * @since 1.0
24  */

25 public interface IApplicationContext {
26     /**
27      * A key used to store arguments for the application. The content of this argument
28      * is unchecked and should conform to the expectations of the application being invoked.
29      * Typically this is a <code>String</code> array.
30      * <p>
31      *
32      * If the map used to launch an application {@link ApplicationDescriptor#launch(Map)} does
33      * not contain a value for this key then command line arguments used to launch
34      * the platform are set in the arguments of the application context.
35      */

36     public static final String JavaDoc APPLICATION_ARGS = "application.args"; //$NON-NLS-1$
37

38     /**
39      * The arguments used for the application. The arguments from
40      * {@link ApplicationDescriptor#launch(Map)} are used as the arguments
41      * for this context when an application is launched.
42      *
43      * @return a map of application arguments.
44      */

45     public Map JavaDoc getArguments();
46
47     /**
48      * This method should be called once the application is completely initialized and running.
49      * This method will perform certain operations that are needed once an application is running.
50      * One example is bringing down a splash screen if it exists.
51      */

52     public void applicationRunning();
53
54     /**
55      * Returns the application associated with this application context. This information
56      * is used to guide the runtime as to what application extension to create and execute.
57      *
58      * @return this product's application or <code>null</code> if none
59      */

60     public String JavaDoc getBrandingApplication();
61
62     /**
63      * Returns the name of the product associated with this application context.
64      * The name is typically used in the title bar of UI windows.
65      *
66      * @return the name of the product or <code>null</code> if none
67      */

68     public String JavaDoc getBrandingName();
69
70     /**
71      * Returns the text description of the product associated with this application context.
72      *
73      * @return the description of the product or <code>null</code> if none
74      */

75     public String JavaDoc getBrandingDescription();
76
77     /** Returns the unique product id of the product associated with this application context.
78      *
79      * @return the id of the product
80      */

81     public String JavaDoc getBrandingId();
82
83     /**
84      * Returns the property with the given key of the product associated with this application context.
85      * <code>null</code> is returned if there is no such key/value pair.
86      *
87      * @param key the name of the property to return
88      * @return the value associated with the given key or <code>null</code> if none
89      */

90     public String JavaDoc getBrandingProperty(String JavaDoc key);
91     
92     /**
93      * Returns the bundle which is responsible for the definition of the product associated with
94      * this application context.
95      * Typically this is used as a base for searching for images and other files
96      * that are needed in presenting the product.
97      *
98      * @return the bundle which defines the product or <code>null</code> if none
99      */

100     public Bundle getBrandingBundle();
101 }
102
Popular Tags