Class BaseEditor<T,​M>

  • Direct Known Subclasses:
    HtmlEditor

    public abstract class BaseEditor<T,​M>
    extends Object
    • Field Detail

      • isReadOnly

        protected boolean isReadOnly
      • concurrentUpdateSessionInfo

        protected org.uberfire.backend.vfs.ObservablePath.OnConcurrentUpdateEvent concurrentUpdateSessionInfo
      • menus

        protected org.uberfire.workbench.model.menu.Menus menus
      • makeMenuBarPromise

        protected elemental2.promise.Promise<Void> makeMenuBarPromise
      • saveWithComments

        protected boolean saveWithComments
      • placeManager

        @Inject
        protected org.uberfire.client.mvp.PlaceManager placeManager
      • changeTitleNotification

        @Inject
        protected javax.enterprise.event.Event<org.uberfire.client.workbench.events.ChangeTitleWidgetEvent> changeTitleNotification
      • notification

        @Inject
        protected javax.enterprise.event.Event<org.uberfire.workbench.events.NotificationEvent> notification
      • menuBuilderManagedInstance

        @Inject
        protected org.jboss.errai.ioc.client.api.ManagedInstance<BasicFileMenuBuilder> menuBuilderManagedInstance
      • promises

        @Inject
        protected org.uberfire.client.promise.Promises promises
      • concurrentChangePopup

        protected org.uberfire.ext.widgets.common.client.common.ConcurrentChangePopup concurrentChangePopup
      • place

        protected org.uberfire.mvp.PlaceRequest place
      • type

        protected org.uberfire.client.workbench.type.ClientResourceType type
      • originalHash

        protected Integer originalHash
      • metadataOriginalHash

        protected Integer metadataOriginalHash
      • isValidationRunning

        protected boolean isValidationRunning
    • Constructor Detail

      • BaseEditor

        protected BaseEditor()
    • Method Detail

      • init

        protected void init​(org.uberfire.backend.vfs.ObservablePath path,
                            org.uberfire.mvp.PlaceRequest place,
                            org.uberfire.client.workbench.type.ClientResourceType type,
                            MenuItems... menuItems)
      • init

        protected void init​(org.uberfire.backend.vfs.ObservablePath path,
                            org.uberfire.mvp.PlaceRequest place,
                            org.uberfire.client.workbench.type.ClientResourceType type,
                            boolean addFileChangeListeners,
                            boolean displayShowMoreVersions,
                            MenuItems... menuItems)
      • init

        protected void init​(org.uberfire.backend.vfs.ObservablePath path,
                            org.uberfire.mvp.PlaceRequest place,
                            org.uberfire.client.workbench.type.ClientResourceType type,
                            boolean addFileChangeListeners,
                            boolean displayShowMoreVersions,
                            Collection<MenuItems> menuItems)
      • showVersions

        protected void showVersions()
      • makeMenuBar

        protected elemental2.promise.Promise<Void> makeMenuBar()
        If you want to customize the menu content override this method.
      • downloadMenuItem

        protected org.uberfire.workbench.model.menu.MenuItem downloadMenuItem()
      • getSaveAndRename

        protected org.uberfire.mvp.Command getSaveAndRename()
      • getBeforeSaveAndRenameCommand

        protected org.uberfire.mvp.Command getBeforeSaveAndRenameCommand()
      • onSuccess

        protected org.uberfire.mvp.ParameterizedCommand<org.uberfire.backend.vfs.Path> onSuccess()
      • getPathSupplier

        protected Supplier<org.uberfire.backend.vfs.Path> getPathSupplier()
      • getRenameValidator

        public Validator getRenameValidator()
      • getCopyValidator

        public Validator getCopyValidator()
      • setOriginalHash

        public void setOriginalHash​(Integer originalHash)
      • onRename

        protected void onRename()
      • getTitle

        protected com.google.gwt.user.client.ui.IsWidget getTitle()
        Override this method and use @WorkbenchPartTitleDecoration
        Returns:
        The widget for the title
      • getTitleText

        public String getTitleText()
      • onSave

        protected void onSave()
      • showConcurrentUpdatePopup

        protected void showConcurrentUpdatePopup()
      • getSaveSuccessCallback

        public org.jboss.errai.common.client.api.RemoteCallback<org.uberfire.backend.vfs.Path> getSaveSuccessCallback​(int newHash)
      • onRestore

        public void onRestore​(@Observes
                              org.uberfire.ext.editor.commons.version.events.RestoreEvent restore)
      • reload

        public void reload()
      • disableMenuItem

        public void disableMenuItem​(MenuItems menuItem)
      • enableMenuItem

        public void enableMenuItem​(MenuItems menuItem)
      • getMenus

        public void getMenus​(Consumer<org.uberfire.workbench.model.menu.Menus> menusConsumer)
      • getValidateCommand

        public org.uberfire.mvp.Command getValidateCommand()
      • onBeforeValidate

        protected void onBeforeValidate()
      • onAfterValidate

        protected void onAfterValidate()
      • onValidate

        protected void onValidate​(org.uberfire.mvp.Command finished)
        If your editor has validation, overwrite this.
        Parameters:
        finished - Called when validation is finished.
      • loadContent

        protected abstract void loadContent()
      • getContentSupplier

        protected Supplier<T> getContentSupplier()
      • getCurrentContentHash

        protected Integer getCurrentContentHash()
      • getMetadataSupplier

        protected Supplier<M> getMetadataSupplier()
      • save

        protected void save()
        Needs to be overwritten for save to work
      • getDeleteServiceCaller

        protected org.jboss.errai.common.client.api.Caller<? extends org.uberfire.ext.editor.commons.service.support.SupportsDelete> getDeleteServiceCaller()
      • getRenameServiceCaller

        protected org.jboss.errai.common.client.api.Caller<? extends org.uberfire.ext.editor.commons.service.support.SupportsRename> getRenameServiceCaller()
      • getSaveAndRenameServiceCaller

        protected org.jboss.errai.common.client.api.Caller<? extends org.uberfire.ext.editor.commons.service.support.SupportsSaveAndRename<T,​M>> getSaveAndRenameServiceCaller()
      • getCopyServiceCaller

        protected org.jboss.errai.common.client.api.Caller<? extends org.uberfire.ext.editor.commons.service.support.SupportsCopy> getCopyServiceCaller()
      • mayClose

        public boolean mayClose​(Integer currentHash)
      • isDirty

        public boolean isDirty​(Integer currentHash)
      • setMetadataOriginalHash

        public void setMetadataOriginalHash​(Integer metadataOriginalHash)