public abstract class BaseEditor<T,M> extends Object
Modifier | Constructor and Description |
---|---|
protected |
BaseEditor() |
protected |
BaseEditor(BaseEditorView baseView) |
Modifier and Type | Method and Description |
---|---|
protected void |
addDownloadMenuItem(BasicFileMenuBuilder menuBuilder) |
protected void |
buildMenuBar()
If you want to customize the menu construction override this method.
|
void |
disableMenuItem(MenuItems menuItem) |
protected MenuItem |
downloadMenuItem() |
void |
enableMenuItem(MenuItems menuItem) |
protected Supplier<T> |
getContentSupplier() |
protected org.jboss.errai.common.client.api.Caller<? extends SupportsCopy> |
getCopyServiceCaller() |
Validator |
getCopyValidator() |
protected Integer |
getCurrentContentHash() |
protected org.jboss.errai.common.client.api.Caller<? extends SupportsDelete> |
getDeleteServiceCaller() |
void |
getMenus(Consumer<Menus> menusConsumer) |
protected Supplier<M> |
getMetadataSupplier() |
protected Supplier<Path> |
getPathSupplier() |
protected org.jboss.errai.common.client.api.Caller<? extends SupportsRename> |
getRenameServiceCaller() |
Validator |
getRenameValidator() |
protected Command |
getSaveAndRename() |
protected SaveAndRenameCommandBuilder<T,M> |
getSaveAndRenameCommandBuilder() |
protected org.jboss.errai.common.client.api.Caller<? extends SupportsSaveAndRename<T,M>> |
getSaveAndRenameServiceCaller() |
org.jboss.errai.common.client.api.RemoteCallback<Path> |
getSaveSuccessCallback(int newHash) |
protected com.google.gwt.user.client.ui.IsWidget |
getTitle()
Override this method and use @WorkbenchPartTitleDecoration
|
String |
getTitleText() |
Command |
getValidateCommand() |
VersionRecordManager |
getVersionRecordManager() |
protected void |
init(ObservablePath path,
PlaceRequest place,
ClientResourceType type,
boolean addFileChangeListeners,
boolean displayShowMoreVersions,
Collection<MenuItems> menuItems) |
protected void |
init(ObservablePath path,
PlaceRequest place,
ClientResourceType type,
boolean addFileChangeListeners,
boolean displayShowMoreVersions,
MenuItems... menuItems) |
protected void |
init(ObservablePath path,
PlaceRequest place,
ClientResourceType type,
MenuItems... menuItems) |
boolean |
isDirty(Integer currentHash) |
protected Supplier<Boolean> |
isDirtySupplier() |
protected abstract void |
loadContent() |
protected elemental2.promise.Promise<Void> |
makeMenuBar()
If you want to customize the menu content override this method.
|
boolean |
mayClose(Integer currentHash) |
protected void |
onAfterValidate() |
protected void |
onBeforeValidate() |
protected void |
onRename() |
void |
onRestore(RestoreEvent restore) |
protected void |
onSave() |
protected ParameterizedCommand<Path> |
onSuccess() |
protected void |
onValidate(Command finished)
If your editor has validation, overwrite this.
|
void |
reload() |
protected void |
save()
Needs to be overwritten for save to work
|
void |
setMetadataOriginalHash(Integer metadataOriginalHash) |
void |
setOriginalHash(Integer originalHash) |
protected void |
showConcurrentUpdatePopup() |
protected void |
showVersions() |
protected boolean isReadOnly
protected BaseEditorView baseView
protected ObservablePath.OnConcurrentUpdateEvent concurrentUpdateSessionInfo
protected Menus menus
protected elemental2.promise.Promise<Void> makeMenuBarPromise
@Inject protected PlaceManager placeManager
@Inject protected javax.enterprise.event.Event<ChangeTitleWidgetEvent> changeTitleNotification
@Inject protected javax.enterprise.event.Event<NotificationEvent> notification
@Inject protected VersionRecordManager versionRecordManager
@Inject protected org.jboss.errai.ioc.client.api.ManagedInstance<BasicFileMenuBuilder> menuBuilderManagedInstance
@Inject protected BasicFileMenuBuilder menuBuilder
@Inject protected DefaultFileNameValidator fileNameValidator
@Inject protected SaveAndRenameCommandBuilder<T,M> saveAndRenameCommandBuilder
@Inject protected javax.enterprise.event.Event<ConcurrentDeleteAcceptedEvent> concurrentDeleteAcceptedEvent
@Inject protected javax.enterprise.event.Event<ConcurrentDeleteIgnoredEvent> concurrentDeleteIgnoredEvent
@Inject protected javax.enterprise.event.Event<ConcurrentRenameAcceptedEvent> concurrentRenameAcceptedEvent
@Inject protected javax.enterprise.event.Event<ConcurrentRenameIgnoredEvent> concurrentRenameIgnoredEvent
@Inject protected Promises promises
protected PlaceRequest place
protected ClientResourceType type
protected Integer originalHash
protected Integer metadataOriginalHash
protected boolean isValidationRunning
protected BaseEditor()
protected BaseEditor(BaseEditorView baseView)
protected void init(ObservablePath path, PlaceRequest place, ClientResourceType type, MenuItems... menuItems)
protected void init(ObservablePath path, PlaceRequest place, ClientResourceType type, boolean addFileChangeListeners, boolean displayShowMoreVersions, MenuItems... menuItems)
protected void init(ObservablePath path, PlaceRequest place, ClientResourceType type, boolean addFileChangeListeners, boolean displayShowMoreVersions, Collection<MenuItems> menuItems)
protected void showVersions()
protected elemental2.promise.Promise<Void> makeMenuBar()
protected void addDownloadMenuItem(BasicFileMenuBuilder menuBuilder)
protected MenuItem downloadMenuItem()
protected Command getSaveAndRename()
protected ParameterizedCommand<Path> onSuccess()
protected SaveAndRenameCommandBuilder<T,M> getSaveAndRenameCommandBuilder()
protected void buildMenuBar()
makeMenuBar()
should be used to add items to the BasicFileMenuBuilder
. This method then instructs
BasicFileMenuBuilder.build()
to create the Menus
public Validator getRenameValidator()
public Validator getCopyValidator()
public void setOriginalHash(Integer originalHash)
protected void onRename()
protected com.google.gwt.user.client.ui.IsWidget getTitle()
public String getTitleText()
protected void onSave()
protected void showConcurrentUpdatePopup()
public org.jboss.errai.common.client.api.RemoteCallback<Path> getSaveSuccessCallback(int newHash)
public void onRestore(@Observes RestoreEvent restore)
public void reload()
public void disableMenuItem(MenuItems menuItem)
public void enableMenuItem(MenuItems menuItem)
public Command getValidateCommand()
protected void onBeforeValidate()
protected void onAfterValidate()
protected void onValidate(Command finished)
finished
- Called when validation is finished.protected abstract void loadContent()
protected Integer getCurrentContentHash()
protected void save()
protected org.jboss.errai.common.client.api.Caller<? extends SupportsDelete> getDeleteServiceCaller()
protected org.jboss.errai.common.client.api.Caller<? extends SupportsRename> getRenameServiceCaller()
protected org.jboss.errai.common.client.api.Caller<? extends SupportsSaveAndRename<T,M>> getSaveAndRenameServiceCaller()
protected org.jboss.errai.common.client.api.Caller<? extends SupportsCopy> getCopyServiceCaller()
public boolean mayClose(Integer currentHash)
public boolean isDirty(Integer currentHash)
public VersionRecordManager getVersionRecordManager()
public void setMetadataOriginalHash(Integer metadataOriginalHash)
Copyright © 2012–2019 JBoss by Red Hat. All rights reserved.