Ejemplo n.º 1
0
        public override void OnGUI()
        {
            bool changed = false;

            display = EditorGUILayout.Foldout(display, "Receiver: " + (!display ? name : ""));
            if (display)
            {
                EditorGUI.BeginChangeCheck();
                name     = EditorGUILayout.TextField("Name: ", name);
                changed |= EditorGUI.EndChangeCheck();
                BBGuiHelper.BeginIndent();
                {
                    #region attributes
                    displayAttributes = EditorGUILayout.Foldout(displayAttributes, "Attributes: ");
                    if (displayAttributes)
                    {
                        EditorGUI.BeginChangeCheck();
                        BBGuiHelper.BeginIndent();
                        {
                            enabled    = EditorGUILayout.Toggle("Enabled: ", enabled);
                            exported   = EditorGUILayout.Toggle("Exported: ", exported);
                            icon       = EditorGUILayout.TextField("Icon: ", icon);
                            label      = EditorGUILayout.TextField("Label: ", label);
                            permission = EditorGUILayout.TextField("Permission: ", permission);
                            process    = EditorGUILayout.TextField("Process: ", process);
                        }
                        BBGuiHelper.EndIndent();
                        changed |= EditorGUI.EndChangeCheck();
                    }
                    #endregion
                    #region intentfilter
                    displayIntentFilter = EditorGUILayout.Foldout(displayIntentFilter, "Intent-Filters: (" + intentFilterList.Count + ")");
                    if (displayIntentFilter)
                    {
                        for (int i = 0; i < intentFilterList.Count; i++)
                        {
                            Undo.RecordObject(intentFilterList[i], "Intent-Filter");
                            if (intentFilterList[i].ElementEditStatus != EditStatus.REMOVED)
                            {
                                intentFilterList[i].OnGUI();
                            }
                            if (intentFilterList[i].ElementEditStatus != EditStatus.NONE)
                            {
                                changed = true;
                            }
                        }
                        BBGuiHelper.EndIndent();
                        GUILayout.BeginHorizontal();
                        {
                            EditorGUILayout.Space();
                            if (GUILayout.Button("New Intent-Filter", BBGuiHelper.ButtonWidth()))
                            {
                                intentFilterList.Add(ManifestIntentFilter.CreateInstance(node));
                                changed = true;
                            }
                        }
                        GUILayout.EndHorizontal();
                        BBGuiHelper.BeginIndent();
                    }
                    #endregion
                    #region metadata
                    displayMetaData = EditorGUILayout.Foldout(displayMetaData, "Meta-Data: (" + intentFilterList.Count + ")");
                    if (displayMetaData)
                    {
                        for (int i = 0; i < metaDataList.Count; i++)
                        {
                            Undo.RecordObject(metaDataList[i], "Meta-Data");
                            if (metaDataList[i].ElementEditStatus != EditStatus.REMOVED)
                            {
                                metaDataList[i].OnGUI();
                            }
                            if (metaDataList[i].ElementEditStatus != EditStatus.NONE)
                            {
                                changed = true;
                            }
                        }
                        BBGuiHelper.EndIndent();
                        GUILayout.BeginHorizontal();
                        {
                            EditorGUILayout.Space();
                            if (GUILayout.Button("New Meta-Data", BBGuiHelper.ButtonWidth()))
                            {
                                metaDataList.Add(ManifestMetaData.CreateInstance(node));
                                changed = true;
                            }
                        }
                        GUILayout.EndHorizontal();
                        BBGuiHelper.BeginIndent();
                    }
                    #endregion
                }
                BBGuiHelper.EndIndent();
                GUILayout.BeginHorizontal();
                {
                    EditorGUILayout.Space();
                    if (changed)
                    {
                        elementEditStatus = EditStatus.EDITED;
                    }
                    if (GUILayout.Button("Remove Receiver", BBGuiHelper.ButtonWidth()))
                    {
                        elementEditStatus = EditStatus.REMOVED;
                    }
                }
                GUILayout.EndHorizontal();
            }
        }
Ejemplo n.º 2
0
        public override void OnGUI()
        {
            bool changed = false;

            display = EditorGUILayout.Foldout(display, "Provider: " + (!display ? name : ""));
            EditorGUI.BeginChangeCheck();
            if (display)
            {
                name     = EditorGUILayout.TextField("Name: ", name);
                changed |= EditorGUI.EndChangeCheck();
                BBGuiHelper.BeginIndent();
                {
                    #region attributes
                    displayAttributes = EditorGUILayout.Foldout(displayAttributes, "Attributes: ");
                    if (displayAttributes)
                    {
                        EditorGUI.BeginChangeCheck();
                        BBGuiHelper.BeginIndent();
                        {
                            for (int i = 0; i < authorities.Count; i++)
                            {
                                EditorGUILayout.BeginHorizontal();
                                {
                                    authorities[i] = EditorGUILayout.TextField(authorities[i]);
                                    if (GUILayout.Button("Remove"))
                                    {
                                        authorities.RemoveAt(i--);
                                    }
                                }
                                EditorGUILayout.EndHorizontal();
                            }
                            enabled             = EditorGUILayout.Toggle("Enabled: ", enabled);
                            exported            = EditorGUILayout.Toggle("Exported: ", exported);
                            grantUriPermissions = EditorGUILayout.Toggle("Grant URI Permissions: ", grantUriPermissions);
                            icon            = EditorGUILayout.TextField("Icon: ", icon);
                            initOrder       = EditorGUILayout.IntField("Init Order: ", initOrder);
                            label           = EditorGUILayout.TextField("Label: ", label);
                            multiProcess    = EditorGUILayout.Toggle("Multiprocess: ", multiProcess);
                            permission      = EditorGUILayout.TextField("Permission: ", permission);
                            process         = EditorGUILayout.TextField("Process: ", process);
                            readPermission  = EditorGUILayout.TextField("Read Permission: ", readPermission);
                            syncable        = EditorGUILayout.Toggle("Syncable: ", syncable);
                            writePermission = EditorGUILayout.TextField("Write Permission: ", writePermission);
                        }
                        BBGuiHelper.EndIndent();
                        changed |= EditorGUI.EndChangeCheck();
                    }
                    #endregion
                    #region metadata
                    displayMetaData = EditorGUILayout.Foldout(displayMetaData, "Meta-Data: (" + metaDataList.Count + ")");
                    if (displayMetaData)
                    {
                        for (int i = 0; i < metaDataList.Count; i++)
                        {
                            Undo.RecordObject(metaDataList[i], "Meta-Data");
                            if (metaDataList[i].ElementEditStatus != EditStatus.REMOVED)
                            {
                                metaDataList[i].OnGUI();
                            }
                            if (metaDataList[i].ElementEditStatus != EditStatus.NONE)
                            {
                                changed = true;
                            }
                        }
                        BBGuiHelper.EndIndent();
                        GUILayout.BeginHorizontal();
                        {
                            EditorGUILayout.Space();
                            if (GUILayout.Button("New Meta-Data", BBGuiHelper.ButtonWidth()))
                            {
                                metaDataList.Add(ManifestMetaData.CreateInstance(node));
                                changed = true;
                            }
                        }
                        GUILayout.EndHorizontal();
                        BBGuiHelper.BeginIndent();
                    }
                    #endregion
                    #region granturipermission
                    displayGrantUriPermissions = EditorGUILayout.Foldout(displayGrantUriPermissions, "Grant-Uri-Permissions: (" + grantUriPermissionList.Count + ")");
                    if (displayGrantUriPermissions)
                    {
                        for (int i = 0; i < grantUriPermissionList.Count; i++)
                        {
                            Undo.RecordObject(grantUriPermissionList[i], "Grant-Uri-Permissions");
                            if (grantUriPermissionList[i].ElementEditStatus != EditStatus.REMOVED)
                            {
                                grantUriPermissionList[i].OnGUI();
                            }
                            if (grantUriPermissionList[i].ElementEditStatus != EditStatus.NONE)
                            {
                                changed = true;
                            }
                        }
                        BBGuiHelper.EndIndent();
                        GUILayout.BeginHorizontal();
                        {
                            EditorGUILayout.Space();
                            if (GUILayout.Button("New Grant-Uri-Permission", BBGuiHelper.ButtonWidth()))
                            {
                                grantUriPermissionList.Add(ManifestGrantUriPermission.CreateInstance(node));
                                changed = true;
                            }
                        }
                        GUILayout.EndHorizontal();
                        BBGuiHelper.BeginIndent();
                    }
                    #endregion
                    #region pathpermission
                    displayPathPermissions = EditorGUILayout.Foldout(displayPathPermissions, "Path-Permissions: (" + pathPermissionList.Count + ")");
                    if (displayPathPermissions)
                    {
                        for (int i = 0; i < pathPermissionList.Count; i++)
                        {
                            Undo.RecordObject(pathPermissionList[i], "Path-Permissions");
                            if (pathPermissionList[i].ElementEditStatus != EditStatus.REMOVED)
                            {
                                pathPermissionList[i].OnGUI();
                            }
                            if (pathPermissionList[i].ElementEditStatus != EditStatus.NONE)
                            {
                                changed = true;
                            }
                        }
                        BBGuiHelper.EndIndent();
                        GUILayout.BeginHorizontal();
                        {
                            EditorGUILayout.Space();
                            if (GUILayout.Button("New Path-Permission", BBGuiHelper.ButtonWidth()))
                            {
                                pathPermissionList.Add(ManifestPathPermission.CreateInstance(node));
                                changed = true;
                            }
                        }
                        GUILayout.EndHorizontal();
                        BBGuiHelper.BeginIndent();
                    }
                    #endregion
                }
                BBGuiHelper.EndIndent();
                GUILayout.BeginHorizontal();
                {
                    EditorGUILayout.Space();
                    if (changed)
                    {
                        elementEditStatus = EditStatus.EDITED;
                    }
                    if (GUILayout.Button("Remove Provider", BBGuiHelper.ButtonWidth()))
                    {
                        elementEditStatus = EditStatus.REMOVED;
                    }
                }
                GUILayout.EndHorizontal();
            }
        }
Ejemplo n.º 3
0
        public override void OnGUI()
        {
            bool changed = false;

            display = EditorGUILayout.Foldout(display, "Activity: " + (!display ? name : ""));
            if (display)
            {
                EditorGUI.BeginChangeCheck();
                name     = EditorGUILayout.TextField("Name: ", name);
                changed |= EditorGUI.EndChangeCheck();
                #region attributes
                displayAttributes = EditorGUILayout.Foldout(displayAttributes, "Attributes: ");
                if (displayAttributes)
                {
                    EditorGUI.BeginChangeCheck();
                    BBGuiHelper.BeginIndent();
                    {
                        allowTaskReparenting  = EditorGUILayout.Toggle("Allow Task Reparenting: ", allowTaskReparenting);
                        alwaysRetainTaskState = EditorGUILayout.Toggle("Always Retain Task State: ", alwaysRetainTaskState);
                        clearTaskOnLaunch     = EditorGUILayout.Toggle("Clear Task On Launch: ", clearTaskOnLaunch);
                        configChanges         = EditorGUILayout.MaskField("Config Changes: ", configChanges, configChangesArray);
                        enabled             = EditorGUILayout.Toggle("Enabled: ", enabled);
                        excludeFromRecents  = EditorGUILayout.Toggle("Exclude From Recents: ", excludeFromRecents);
                        exported            = EditorGUILayout.Toggle("Exported: ", exported);
                        hardwareAccelerated = EditorGUILayout.Toggle("Hardware Accelerated: ", hardwareAccelerated);
                        icon                = EditorGUILayout.TextField("Icon: ", icon);
                        label               = EditorGUILayout.TextField("Label: ", label);
                        launchMode          = launchModeArray[EditorGUILayout.Popup("Launch Mode: ", Array.IndexOf(launchModeArray, launchMode), launchModeArray)];
                        multiprocess        = EditorGUILayout.Toggle("Multiprocess: ", multiprocess);
                        noHistory           = EditorGUILayout.Toggle("No History: ", noHistory);
                        permission          = EditorGUILayout.TextField("Permission: ", permission);
                        process             = EditorGUILayout.TextField("Process: ", process);
                        screenOrientation   = screenOrientationArray[EditorGUILayout.Popup("Screen Orientation: ", Array.IndexOf(screenOrientationArray, screenOrientation), screenOrientationArray)];
                        stateNotNeeded      = EditorGUILayout.Toggle("State Not Needed", stateNotNeeded);
                        taskAffinity        = EditorGUILayout.TextField("Task Affinity: ", taskAffinity);
                        theme               = EditorGUILayout.TextField("Theme: ", theme);
                        uiOptions           = uiOptionsArray[EditorGUILayout.Popup("UI Options: ", Array.IndexOf(uiOptionsArray, uiOptions), uiOptionsArray)];
                        windowSoftInputMode = EditorGUILayout.MaskField("Window Soft Input Mode: ", windowSoftInputMode, windowSoftInputModeArray);
                    }
                    BBGuiHelper.EndIndent();
                    changed |= EditorGUI.EndChangeCheck();
                }
                #endregion
                #region intentfilter
                displayIntentFilter = EditorGUILayout.Foldout(displayIntentFilter, "Intent-Filters: (" + intentFilterList.Count + ")");
                if (displayIntentFilter)
                {
                    BBGuiHelper.BeginIndent();
                    {
                        for (int i = 0; i < intentFilterList.Count; i++)
                        {
                            Undo.RecordObject(intentFilterList[i], "Intent-Filter");
                            if (intentFilterList[i].ElementEditStatus != EditStatus.REMOVED)
                            {
                                intentFilterList[i].OnGUI();
                            }
                            if (intentFilterList[i].ElementEditStatus != EditStatus.NONE)
                            {
                                changed = true;
                            }
                        }
                    }
                    BBGuiHelper.EndIndent();
                    GUILayout.BeginHorizontal();
                    {
                        EditorGUILayout.Space();
                        if (GUILayout.Button("New Intent-Filter", BBGuiHelper.ButtonWidth()))
                        {
                            intentFilterList.Add(ManifestIntentFilter.CreateInstance(node));
                            changed = true;
                        }
                    }
                    GUILayout.EndHorizontal();
                }
                #endregion
                #region metadata
                displayMetaData = EditorGUILayout.Foldout(displayMetaData, "Meta-Data: (" + metaDataList.Count + ")");
                if (displayMetaData)
                {
                    BBGuiHelper.BeginIndent();
                    {
                        for (int i = 0; i < metaDataList.Count; i++)
                        {
                            Undo.RecordObject(metaDataList[i], "Meta-Data");
                            if (metaDataList[i].ElementEditStatus != EditStatus.REMOVED)
                            {
                                metaDataList[i].OnGUI();
                            }
                            if (metaDataList[i].ElementEditStatus != EditStatus.NONE)
                            {
                                changed = true;
                            }
                        }
                    }
                    BBGuiHelper.EndIndent();
                    GUILayout.BeginHorizontal();
                    {
                        EditorGUILayout.Space();
                        if (GUILayout.Button("New Meta-Data", BBGuiHelper.ButtonWidth()))
                        {
                            metaDataList.Add(ManifestMetaData.CreateInstance(node));
                            changed = true;
                        }
                    }
                    GUILayout.EndHorizontal();
                }
                #endregion
                GUILayout.BeginHorizontal();
                {
                    EditorGUILayout.Space();
                    if (changed)
                    {
                        elementEditStatus = EditStatus.EDITED;
                    }
                    if (GUILayout.Button("Remove Activity", BBGuiHelper.ButtonWidth()))
                    {
                        elementEditStatus = EditStatus.REMOVED;
                    }
                }
                GUILayout.EndHorizontal();
            }
        }