Class DefaultNewResourceHandler

    • Field Detail

      • extensions

        protected final List<org.uberfire.commons.data.Pair<String,​? extends com.google.gwt.user.client.ui.IsWidget>> extensions
      • context

        @Inject
        protected org.guvnor.common.services.project.client.context.WorkspaceProjectContext context
      • moduleService

        @Inject
        protected org.jboss.errai.common.client.api.Caller<org.kie.workbench.common.services.shared.project.KieModuleService> moduleService
      • validationService

        @Inject
        protected org.jboss.errai.common.client.api.Caller<org.kie.workbench.common.services.shared.validation.ValidationService> validationService
      • placeManager

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

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

        @Inject
        protected javax.enterprise.event.Event<NewResourceSuccessEvent> newResourceSuccessEvent
      • busyIndicatorView

        @Inject
        protected org.uberfire.ext.widgets.common.client.common.BusyIndicatorView busyIndicatorView
    • Constructor Detail

      • DefaultNewResourceHandler

        public DefaultNewResourceHandler()
    • Method Detail

      • getExtensions

        public List<org.uberfire.commons.data.Pair<String,​? extends com.google.gwt.user.client.ui.IsWidget>> getExtensions()
        Description copied from interface: NewResourceHandler
        Return a List of Widgets that the NewResourceHandler can use to gather additional parameters for the new resource. The List is of Pairs, where each Pair consists of a String caption and IsWidget editor.
        Specified by:
        getExtensions in interface NewResourceHandler
        Returns:
        null if no extension is provided
      • validate

        public void validate​(String baseFileName,
                             org.uberfire.ext.editor.commons.client.validation.ValidatorWithReasonCallback callback)
        Description copied from interface: NewResourceHandler
        Provide NewResourceHandlers with the ability to validate additional parameters before the creation of the new resource
        Specified by:
        validate in interface NewResourceHandler
        Parameters:
        baseFileName - The base file name for the new item (excluding extension)
        callback - Callback depending on validation result
      • getCommand

        public org.uberfire.mvp.Command getCommand​(NewResourcePresenter newResourcePresenter)
        Description copied from interface: NewResourceHandler
        A command to execute instead of defaulting to the NewResourceView. If this returns null the NewResourceView is shown by default.
        Specified by:
        getCommand in interface NewResourceHandler
        Returns:
      • buildFileName

        protected String buildFileName​(String baseFileName,
                                       org.uberfire.workbench.type.ResourceTypeDefinition resourceType)
      • notifySuccess

        protected void notifySuccess()
      • getSuccessCallback

        protected org.jboss.errai.common.client.api.RemoteCallback<org.uberfire.backend.vfs.Path> getSuccessCallback​(NewResourcePresenter presenter)
      • canCreate

        public boolean canCreate()
        Description copied from interface: NewResourceHandler
        Asks if the resource handler can be created or not. For example a lack of a certain role can return false.
        Specified by:
        canCreate in interface NewResourceHandler
        Returns:
        If true this resource handler can be added.