return x;
}
public final void markDirty(final boolean doIt) {
if (writeRight == -1 && view != null) {
XUser usr = ((Workbench)Registry.get(Workbench.ID)).getUser();
WPaloCubeViewServiceProvider.getInstance().isOwner(usr.getSessionId(), view.getId(), new AsyncCallback<Boolean>(){
public void onFailure(Throwable arg0) {
XUser user = ((Workbench)Registry.get(Workbench.ID)).getUser();
writeRight = 0;
if (user.hasRoleName("EDITOR")) {
writeRight = 1;
isDirty = doIt;
Widget parent = getParent();
if(parent instanceof TabItem) {
TabItem tab = (TabItem) parent;
String title = doIt ? "*"+view.getName() : view.getName();
tab.setText(modify(title));
}
save.setEnabled(doIt);
}
if (writeRight == 0) {
save.setEnabled(false);
}
}
public void onSuccess(Boolean result) {
if (result) {
writeRight = 1;
isDirty = doIt;
Widget parent = getParent();
if(parent instanceof TabItem) {
TabItem tab = (TabItem) parent;
String title = doIt ? "*"+view.getName() : view.getName();
tab.setText(modify(title));
}
save.setEnabled(doIt);
} else {
XUser user = ((Workbench)Registry.get(Workbench.ID)).getUser();
writeRight = 0;
if (user.hasRoleName("EDITOR")) {
writeRight = 1;
isDirty = doIt;
Widget parent = getParent();
if(parent instanceof TabItem) {
TabItem tab = (TabItem) parent;