/** * @see org.opencms.workplace.list.CmsListDirectAction#resolveOnClic(java.util.Locale) */ @Override protected String resolveOnClic(Locale locale) { String confirmationMessage = getConfirmationMessage().key(locale); if ((getColumnForTexts() != null) && (getItem().get(getColumnForTexts()) != null)) { confirmationMessage = new MessageFormat(confirmationMessage, locale).format( new Object[] {getItem().get(getColumnForTexts())}); } StringBuffer onClic = new StringBuffer(128); if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(confirmationMessage)) { onClic.append("if (confirm('"); onClic.append(confirmationMessage); onClic.append("')) { "); } onClic.append(jsCode()); if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(confirmationMessage)) { onClic.append(" } "); } return onClic.toString(); }
/** * @see org.opencms.workplace.tools.I_CmsHtmlIconButton#isEnabled() */ @Override public boolean isEnabled() { if (getResourceName() != null) { return super.isEnabled(); } return false; }
/** * @see org.opencms.workplace.tools.I_CmsHtmlIconButton#getHelpText() */ @Override public CmsMessageContainer getHelpText() { if (isEnabled()) { return super.getHelpText(); } return Messages.get().container(Messages.GUI_OPENRESOURCE_ACTION_DISABLED_HELP_0); }
/** * @see org.opencms.workplace.tools.I_CmsHtmlIconButton#getHelpText() */ @Override public CmsMessageContainer getHelpText() { if (isEnabled()) { return super.getHelpText(); } return Messages.get().container(Messages.GUI_OPENRESOURCE_ACTION_DISABLED_HELP_0); }
/** * @see org.opencms.workplace.list.CmsListDirectAction#resolveOnClic(java.util.Locale) */ @Override protected String resolveOnClic(Locale locale) { String confirmationMessage = getConfirmationMessage().key(locale); if ((getColumnForTexts() != null) && (getItem().get(getColumnForTexts()) != null)) { confirmationMessage = new MessageFormat(confirmationMessage, locale).format(new Object[] {getItem().get( getColumnForTexts())}); } StringBuffer onClic = new StringBuffer(128); if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(confirmationMessage)) { onClic.append("if (confirm('"); onClic.append(confirmationMessage); onClic.append("')) { "); } onClic.append(jsCode()); if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(confirmationMessage)) { onClic.append(" } "); } return onClic.toString(); }
/** * @see org.opencms.workplace.tools.I_CmsHtmlIconButton#isEnabled() */ @Override public boolean isEnabled() { if (getResourceName() != null) { return super.isEnabled(); } return false; }