FileDocCategorySizeDatePackage
PermissionPage.javaAPI DocAndroid 1.5 API4016Wed May 06 22:41:10 BST 2009com.android.ide.eclipse.editors.manifest.pages

PermissionPage

public final class PermissionPage extends org.eclipse.ui.forms.editor.FormPage
Page for permissions settings, part of the AndroidManifest form editor.

Useful reference: http://www.eclipse.org/articles/Article-Forms/article.html

Fields Summary
public static final String
PAGE_ID
Page id used for switching tabs programmatically
com.android.ide.eclipse.editors.manifest.ManifestEditor
mEditor
Container editor
private com.android.ide.eclipse.editors.ui.tree.UiTreeBlock
mTreeBlock
Constructors Summary
public PermissionPage(com.android.ide.eclipse.editors.manifest.ManifestEditor editor)


       
        super(editor, PAGE_ID, "Permissions");  // tab label, keep it short
        mEditor = editor;
    
Methods Summary
protected voidcreateFormContent(org.eclipse.ui.forms.IManagedForm managedForm)
Creates the content in the form hosted in this page.

param
managedForm the form hosted in this page.

        super.createFormContent(managedForm);
        ScrolledForm form = managedForm.getForm();
        form.setText("Android Manifest Permissions");
        form.setImage(AdtPlugin.getAndroidLogo());

        UiElementNode manifest = mEditor.getUiRootNode();
        AndroidManifestDescriptors manifestDescriptor = mEditor.getManifestDescriptors();
        
        ElementDescriptor[] descriptorFilters = null;
        if (manifestDescriptor != null) {
            descriptorFilters = new ElementDescriptor[] {
                    manifestDescriptor.getPermissionElement(),
                    manifestDescriptor.getUsesPermissionElement(),
                    manifestDescriptor.getPermissionGroupElement(),
                    manifestDescriptor.getPermissionTreeElement()
            };
        }
        mTreeBlock = new UiTreeBlock(mEditor, manifest,
                true /* autoCreateRoot */,
                descriptorFilters,
                "Permissions",
                "List of permissions defined and used by the manifest");
        mTreeBlock.createContent(managedForm);
    
public voidrefreshUiNode()
Changes and refreshes the Application UI node handled by the sub parts.

        if (mTreeBlock != null) {
            UiElementNode manifest = mEditor.getUiRootNode();
            AndroidManifestDescriptors manifestDescriptor = mEditor.getManifestDescriptors();

            mTreeBlock.changeRootAndDescriptors(manifest,
                    new ElementDescriptor[] {
                        manifestDescriptor.getPermissionElement(),
                        manifestDescriptor.getUsesPermissionElement(),
                        manifestDescriptor.getPermissionGroupElement(),
                        manifestDescriptor.getPermissionTreeElement()
                    },
                    true /* refresh */);
        }