FileDocCategorySizeDatePackage
ResourcesTreePage.javaAPI DocAndroid 1.5 API3200Wed May 06 22:41:10 BST 2009com.android.ide.eclipse.editors.resources

ResourcesTreePage

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

Fields Summary
public static final String
PAGE_ID
Page id used for switching tabs programmatically
ResourcesEditor
mEditor
Container editor
Constructors Summary
public ResourcesTreePage(ResourcesEditor editor)


       
        super(editor, PAGE_ID, "Resources");  // tab's 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();
        
        String configText = null;
        IEditorInput input = mEditor.getEditorInput();
        if (input instanceof FileEditorInput) {
            FileEditorInput fileInput = (FileEditorInput)input;
            IFile iFile = fileInput.getFile();
            
            ResourceFolder resFolder = ResourceManager.getInstance().getResourceFolder(iFile);
            if (resFolder != null) {
                configText = resFolder.getConfiguration().toDisplayString();
            }
        }
        
        if (configText != null) {
            form.setText(String.format("Android Resources (%1$s)", configText));
        } else {
            form.setText("Android Resources");
        }

        form.setImage(AdtPlugin.getAndroidLogo());

        UiElementNode resources = mEditor.getUiRootNode();
        UiTreeBlock block = new UiTreeBlock(mEditor, resources,
                true /* autoCreateRoot */,
                null /* no element filters */,
                "Resources Elements",
                "List of all resources elements in this XML file.");
        block.createContent(managedForm);