예제 #1
0
        public PackageList()
        {
            ResolveDependencies();

            var root = m_ResourceLoader.GetTemplate("PackageList.uxml");

            Add(root);
            root.StretchToParentSize();
            cache = new VisualElementCache(root);

            viewDataKey            = "package-list-key";
            scrollView.viewDataKey = "package-list-scrollview-key";

            HidePackagesShowMessage(false, false);

            loginButton.clickable.clicked += OnLoginClicked;

            RegisterCallback <AttachToPanelEvent>(OnEnterPanel);
            RegisterCallback <DetachFromPanelEvent>(OnLeavePanel);

            RegisterCallback <GeometryChangedEvent>(OnGeometryChange);

            m_PackageItemsLookup = new Dictionary <string, PackageItem>();

            focusable = true;
        }
        public PackageDependencySampleItemLowWidth(IPackageVersion version, Sample sample)
        {
            ResolveDependencies();
            var root = m_ResourceLoader.GetTemplate("PackageDependencySampleItemLowWidth.uxml");

            Add(root);

            cache = new VisualElementCache(root);

            var sampleItem = new PackageSampleItem(version, sample);

            sampleItem.importButton.SetEnabled(version.isInstalled);

            var name = sampleItem.nameLabel.text;
            var size = sampleItem.sizeLabel.text;

            itemName.text    = name;
            itemName.tooltip = name;

            itemStatusNameContainer.Add(sampleItem.importStatus);

            itemSizeOrVersion.value      = size;
            itemSizeOrVersion.tooltip    = size;
            itemSizeOrVersion.isReadOnly = true;

            item.Add(sampleItem.importButton);
        }
        public PackageSampleList()
        {
            var root = Resources.GetTemplate("PackageSampleList.uxml");

            Add(root);
            cache = new VisualElementCache(root);
        }
예제 #4
0
        public PackageStatusBar()
        {
            var root = Resources.GetTemplate("PackageStatusBar.uxml");

            Add(root);
            cache = new VisualElementCache(root);
        }
예제 #5
0
        public PackageDependencies()
        {
            var root = Resources.GetTemplate("PackageDependencies.uxml");

            Add(root);
            cache = new VisualElementCache(root);
        }
예제 #6
0
        public PackageReleaseDetailsItem()
        {
            var root = Resources.GetTemplate("PackageReleaseDetailsItem.uxml");

            Add(root);
            cache = new VisualElementCache(root);
        }
예제 #7
0
        public PackageList()
        {
            var root = Resources.GetTemplate("PackageList.uxml");

            Add(root);
            root.StretchToParentSize();
            cache = new VisualElementCache(root);

            viewDataKey            = "package-list-key";
            scrollView.viewDataKey = "package-list-scrollview-key";

            SetEmptyAreaDisplay(false);
            UIUtils.SetElementDisplay(loadMoreContainer, false);

            loginButton.clickable.clicked += OnLoginClicked;
            loadMoreLabel.OnLeftClick(LoadMoreItemsClicked);

            RegisterCallback <AttachToPanelEvent>(OnEnterPanel);
            RegisterCallback <DetachFromPanelEvent>(OnLeavePanel);

            m_PackageListLoaded  = false;
            m_PackageItemsLookup = new Dictionary <string, PackageItem>();

            m_RefreshInProgress = false;
            focusable           = true;
        }
예제 #8
0
        public PackageDetails()
        {
            root = Resources.GetTemplate("PackageDetails.uxml");
            Add(root);

            Cache = new VisualElementCache(root);

            foreach (var extension in PackageManagerExtensions.Extensions)
            {
                CustomContainer.Add(extension.CreateExtensionUI());
            }

            root.StretchToParentSize();

            SetContentVisibility(false);
            SetUpdateVisibility(false);
            RemoveButton.visible  = false;
            UpdateBuiltIn.visible = false;

            UpdateButton.clickable.clicked        += UpdateClick;
            UpdateBuiltIn.clickable.clicked       += UpdateClick;
            RemoveButton.clickable.clicked        += RemoveClick;
            ViewDocButton.clickable.clicked       += ViewDocClick;
            ViewChangelogButton.clickable.clicked += ViewChangelogClick;
            ViewLicenses.clickable.clicked        += ViewLicensesClick;

            RegisterCallback <AttachToPanelEvent>(OnEnterPanel);
            RegisterCallback <DetachFromPanelEvent>(OnLeavePanel);
        }
예제 #9
0
        public DropdownButton()
        {
            root = Resources.GetTemplate("DropdownButton.uxml");
            Add(root);
            Cache = new VisualElementCache(root);

            DropDown.clickable.clicked += OnDropdownButtonClicked;
        }
        public PackageStatusBar()
        {
            var root = Resources.GetTemplate("PackageStatusBar.uxml");

            Add(root);
            cache = new VisualElementCache(root);

            m_LastErrorMessages = new string[Enum.GetNames(typeof(PackageFilterTab)).Length];
        }
        public PackageStatusBar()
        {
            var root = Resources.GetTemplate("PackageStatusBar.uxml");

            Add(root);
            cache = new VisualElementCache(root);

            statusLabel.ShowTextTooltipOnSizeChange();
        }
예제 #12
0
        public PackageStatusBar()
        {
            var root = Resources.GetTemplate("PackageStatusBar.uxml");

            Add(root);
            cache = new VisualElementCache(root);

            statusLabel.RegisterCallback <GeometryChangedEvent>(OnSizeChange);
        }
예제 #13
0
        public PackageStatusBar()
        {
            root = Resources.GetTemplate("PackageStatusBar.uxml");
            Add(root);
            Cache = new VisualElementCache(root);

            LastErrorMessage     = string.Empty;
            operationsInProgress = new List <IBaseOperation>();
        }
예제 #14
0
        public PackageStatusBar()
        {
            var root = Resources.GetTemplate("PackageStatusBar.uxml");

            Add(root);
            cache = new VisualElementCache(root);

            m_LastErrorMessage = string.Empty;
        }
        public PackageLoadBar()
        {
            var root = Resources.GetTemplate("PackageLoadBar.uxml");

            Add(root);
            cache = new VisualElementCache(root);

            loadMinLabel.OnLeftClick(LoadMinItemsClicked);
            loadMaxLabel.OnLeftClick(LoadMaxItemsClicked);
        }
        public void OnEnable()
        {
            this.SetAntiAliasing(4);
            if (s_Window == null)
            {
                s_Window = this;
            }
            if (s_Window != this)
            {
                return;
            }

            var windowResource = Resources.GetVisualTreeAsset("PackageManagerWindow.uxml");

            if (windowResource != null)
            {
                var root = windowResource.CloneTree();
                root.styleSheets.Add(Resources.GetStyleSheet());
                cache = new VisualElementCache(root);

                PageManager.instance.Setup();

                packageDetails.OnEnable();
                packageList.OnEnable();
                packageManagerToolbar.OnEnable();
                packageStatusbar.OnEnable();

                packageManagerToolbar.SetEnabled(!PackageDatabase.instance.isEmpty);
                packageDetails.packageToolbarContainer.SetEnabled(!PackageDatabase.instance.isEmpty);

                PackageDatabase.instance.onRefreshOperationFinish += OnRefreshOperationFinish;
                PackageDatabase.instance.onRefreshOperationStart  += OnRefreshOperationStart;
                PackageDatabase.instance.onRefreshOperationError  += OnRefreshOperationError;

                PackageManagerWindowAnalytics.Setup();

                rootVisualElement.Add(root);
                root.StretchToParentSize();

                PackageFiltering.instance.currentFilterTab = PackageManagerPrefs.instance.lastUsedPackageFilter ?? PackageFilterTab.All;

                if (!PageManager.instance.HasFetchedPageForFilterTab(PackageFiltering.instance.currentFilterTab))
                {
                    PageManager.instance.Refresh(RefreshOptions.CurrentFilter);
                }

                if (PackageFiltering.instance.currentFilterTab != PackageFilterTab.All && !PageManager.instance.HasFetchedPageForFilterTab(PackageFilterTab.All))
                {
                    PageManager.instance.Refresh(RefreshOptions.All);
                }

                EditorApplication.focusChanged += OnFocusChanged;
            }
        }
예제 #17
0
        public PackageManagerToolbar()
        {
            root = Resources.GetTemplate("PackageManagerToolbar.uxml");
            Add(root);
            root.StretchToParentSize();
            Cache = new VisualElementCache(root);

            AddButton.RegisterCallback <MouseDownEvent>(OnAddButtonMouseDown);
            FilterButton.RegisterCallback <MouseDownEvent>(OnFilterButtonMouseDown);
            AdvancedButton.RegisterCallback <MouseDownEvent>(OnAdvancedButtonMouseDown);
        }
예제 #18
0
        public PackageStatusBar()
        {
            ResolveDependencies();

            var root = m_ResourceLoader.GetTemplate("PackageStatusBar.uxml");

            Add(root);
            cache = new VisualElementCache(root);

            statusLabel.ShowTextTooltipOnSizeChange();
        }
예제 #19
0
        public PackageSampleList()
        {
            ResolveDependencies();

            var root = m_ResourceLoader.GetTemplate("PackageSampleList.uxml");

            Add(root);
            cache = new VisualElementCache(root);

            RegisterCallback <GeometryChangedEvent>(OnGeometryChanged);
        }
        public PackageReleaseDetailsItem()
        {
            var root = Resources.GetTemplate("PackageReleaseDetailsItem.uxml");

            Add(root);
            cache = new VisualElementCache(root);

            root.Query <TextField>().ForEach(t =>
            {
                t.isReadOnly = true;
            });
        }
예제 #21
0
        public PackageLoadBar()
        {
            ResolveDependencies();

            var root = m_ResourceLoader.GetTemplate("PackageLoadBar.uxml");

            Add(root);
            cache = new VisualElementCache(root);

            loadMinLabel.OnLeftClick(LoadMinItemsClicked);
            loadMaxLabel.OnLeftClick(LoadMaxItemsClicked);
        }
예제 #22
0
        public PackageSampleList()
        {
            ResolveDependencies();

            var root = m_ResourceLoader.GetTemplate("PackageSampleList.uxml");

            Add(root);
            cache = new VisualElementCache(root);

            SetExpanded(m_PackageManagerPrefs.samplesExpanded);
            samplesExpander.RegisterValueChangedCallback(evt => SetExpanded(evt.newValue));
            RegisterCallback <GeometryChangedEvent>(OnGeometryChanged);
        }
예제 #23
0
        public PackageManagerToolbar()
        {
            var root = Resources.GetTemplate("PackageManagerToolbar.uxml");

            Add(root);
            root.StretchToParentSize();
            Cache = new VisualElementCache(root);

            SetupAddMenu();
            SetupFilterMenu();
            SetupAdvancedMenu();
            SetupSearchToolbar();
        }
예제 #24
0
        public PackageAddFromUrlField()
        {
            root = Resources.GetTemplate("PackageAddFromUrlField.uxml");
            Add(root);
            Cache = new VisualElementCache(root);

            UrlTextField.value = urlText;

            AddButton.SetEnabled(!string.IsNullOrEmpty(urlText));
            AddButton.clickable.clicked += OnAddButtonClick;

            RegisterCallback <AttachToPanelEvent>(OnEnterPanel);
            RegisterCallback <DetachFromPanelEvent>(OnLeavePanel);
        }
예제 #25
0
        public PackageVersionItem(IPackage package, IPackageVersion version)
        {
            ResolveDependencies();

            var root = m_ResourceLoader.GetTemplate("PackageVersionItem.uxml");

            Add(root);
            cache = new VisualElementCache(root);

            this.package = package;
            this.version = version;
            RefreshLabel();
            this.OnLeftClick(() => m_PageManager.SetSelected(package, version, true));
        }
예제 #26
0
        public PackageReleaseDetailsItem()
        {
            ResolveDependencies();

            var root = m_ResourceLoader.GetTemplate("PackageReleaseDetailsItem.uxml");

            Add(root);
            cache = new VisualElementCache(root);

            root.Query <TextField>().ForEach(t =>
            {
                t.isReadOnly = true;
            });
        }
예제 #27
0
        public ProgressBar()
        {
            UIUtils.SetElementDisplay(this, false);

            var root = Resources.GetTemplate("ProgressBar.uxml");

            Add(root);
            root.StretchToParentSize();

            cache = new VisualElementCache(root);

            currentProgressText.text       = string.Empty;
            currentProgressBar.style.width = Length.Percent(0);
        }
예제 #28
0
        public PackageSearchToolbar()
        {
            root = Resources.GetTemplate("PackageSearchToolbar.uxml");
            Add(root);
            root.StretchToParentSize();
            Cache = new VisualElementCache(root);

            SearchTextField.maxLength             = 64;
            SearchTextField.name                  = "";
            SearchCancelButton.clickable.clicked += SearchCancelButtonClick;

            RegisterCallback <AttachToPanelEvent>(OnEnterPanel);
            RegisterCallback <DetachFromPanelEvent>(OnLeavePanel);
        }
        public PackageManagerToolbar()
        {
            var root = Resources.GetTemplate("PackageManagerToolbar.uxml");

            Add(root);
            root.StretchToParentSize();
            cache = new VisualElementCache(root);

            SetupAddMenu();
            SetupFilterTabsMenu();
            SetupOrdering();
            SetupFilters();
            SetupAdvancedMenu();

            m_SearchTextChangeTimestamp = 0;
        }
예제 #30
0
        public PackageItem(IPackage package)
        {
            var root = Resources.GetTemplate("PackageItem.uxml");
            Add(root);
            cache = new VisualElementCache(root);

            itemLabel.OnLeftClick(SelectMainItem);
            seeAllVersionsLabel.OnLeftClick(SeeAllVersionsClick);
            arrowExpander.RegisterValueChangedCallback(ToggleExpansion);
            nameLabel.ShowTextTooltipOnSizeChange();

            UpdateExpanderUI(false);

            SetPackage(package);
            UpdateVisualState();
        }