code stringlengths 73 34.1k | label stringclasses 1
value |
|---|---|
public boolean detectBlackBerryHigh() {
//Disambiguate for BlackBerry OS 6 or 7 (WebKit) browser
if (detectBlackBerryWebKit()) {
return false;
}
if (detectBlackBerry()) {
if (detectBlackBerryTouch()
|| (userAgent.indexOf(deviceBBBold) != -... | java |
public boolean detectBlackBerryTouch() {
if (detectBlackBerry()
&& ((userAgent.indexOf(deviceBBStorm) != -1)
|| (userAgent.indexOf(deviceBBTorch) != -1)
|| (userAgent.indexOf(deviceBBBoldTouch) != -1)
|| (userAgent.indexOf(deviceBBCurveTouch) !=... | java |
public boolean detectMobileQuick() {
//Let's exclude tablets
if (isTierTablet) {
return false;
}
//Most mobile browsing is done on smartphones
if (detectSmartphone()) {
return true;
}
//Catch-all for many mobile devices
... | java |
public boolean detectNintendo() {
if ((userAgent.indexOf(deviceNintendo) != -1)
|| (userAgent.indexOf(deviceWii) != -1)
|| (userAgent.indexOf(deviceNintendoDs) != -1)) {
return true;
}
return false;
} | java |
public boolean detectOperaMobile() {
if ((userAgent.indexOf(engineOpera) != -1)
&& ((userAgent.indexOf(mini) != -1) || (userAgent.indexOf(mobi) != -1))) {
return true;
}
return false;
} | java |
public boolean detectSonyMylo() {
if ((userAgent.indexOf(manuSony) != -1)
&& ((userAgent.indexOf(qtembedded) != -1) || (userAgent.indexOf(mylocom2) != -1))) {
return true;
}
return false;
} | java |
public boolean detectTierIphone() {
if (detectIphoneOrIpod()
|| detectAndroidPhone()
|| detectWindowsPhone()
|| detectBlackBerry10Phone()
|| (detectBlackBerryWebKit() && detectBlackBerryTouch())
|| detectPalmWebOS()
|| detectBada()... | java |
public boolean detectTierRichCss() {
boolean result = false;
//The following devices are explicitly ok.
//Note: 'High' BlackBerry devices ONLY
if (detectMobileQuick()) {
//Exclude iPhone Tier and e-Ink Kindle devices.
if (!detectTierIphone() && !detectKi... | java |
private void setCorrectDay(Calendar date) {
if (monthHasNotDay(date)) {
date.set(Calendar.DAY_OF_MONTH, date.getActualMaximum(Calendar.DAY_OF_MONTH));
} else {
date.set(Calendar.DAY_OF_MONTH, m_dayOfMonth);
}
} | java |
public String getDbProperty(String key) {
// extract the database key out of the entire key
String databaseKey = key.substring(0, key.indexOf('.'));
Properties databaseProperties = getDatabaseProperties().get(databaseKey);
return databaseProperties.getProperty(key, "");
} | java |
public String isChecked(String value1, String value2) {
if ((value1 == null) || (value2 == null)) {
return "";
}
if (value1.trim().equalsIgnoreCase(value2.trim())) {
return "checked";
}
return "";
} | java |
public boolean canLockBecauseOfInactivity(CmsObject cms, CmsUser user) {
return !user.isManaged()
&& !user.isWebuser()
&& !OpenCms.getDefaultUsers().isDefaultUser(user.getName())
&& !OpenCms.getRoleManager().hasRole(cms, user.getName(), CmsRole.ROOT_ADMIN);
} | java |
private void addDownloadButton(final CmsLogFileView view) {
Button button = CmsToolBar.createButton(
FontOpenCms.DOWNLOAD,
CmsVaadinUtils.getMessageText(Messages.GUI_LOGFILE_DOWNLOAD_0));
button.addClickListener(new ClickListener() {
private static final long serial... | java |
@SuppressWarnings("unchecked")
public static boolean addPropertyDefault(PropertiesImpl props, PropertyDefinition<?> propDef) {
if ((props == null) || (props.getProperties() == null)) {
throw new IllegalArgumentException("Props must not be null!");
}
if (propDef == null) ... | java |
public static boolean checkAddProperty(
CmsCmisTypeManager typeManager,
Properties properties,
String typeId,
Set<String> filter,
String id) {
if ((properties == null) || (properties.getProperties() == null)) {
throw new IllegalArgumentException("Prop... | java |
public static GregorianCalendar millisToCalendar(long millis) {
GregorianCalendar result = new GregorianCalendar();
result.setTimeZone(TimeZone.getTimeZone("GMT"));
result.setTimeInMillis((long)(Math.ceil(millis / 1000) * 1000));
return result;
} | java |
private void updateGhostStyle() {
if (CmsStringUtil.isEmpty(m_realValue)) {
if (CmsStringUtil.isEmpty(m_ghostValue)) {
updateTextArea(m_realValue);
return;
}
if (!m_focus) {
setGhostStyleEnabled(true);
updateTex... | java |
private Map<String, String> generateCommonConfigPart() {
Map<String, String> result = new HashMap<>();
if (m_category != null) {
result.put(CONFIGURATION_CATEGORY, m_category);
}
// append 'only leafs' to configuration
if (m_onlyLeafs) {
result.put(CONFIG... | java |
public Map<TimestampMode, List<String>> getDefaultTimestampModes() {
Map<TimestampMode, List<String>> result = new HashMap<TimestampMode, List<String>>();
for (String resourcetype : m_defaultTimestampModes.keySet()) {
TimestampMode mode = m_defaultTimestampModes.get(resourcetype);
... | java |
protected <H extends EventHandler> HandlerRegistration addHandler(final H handler, GwtEvent.Type<H> type) {
return ensureHandlers().addHandlerToSource(type, this, handler);
} | java |
protected List<I_CmsFacetQueryItem> parseFacetQueryItems(final String path) throws Exception {
final List<I_CmsXmlContentValue> values = m_xml.getValues(path, m_locale);
if (values == null) {
return null;
} else {
List<I_CmsFacetQueryItem> parsedItems = new ArrayList<I_C... | java |
protected I_CmsSearchConfigurationFacetField parseFieldFacet(final String pathPrefix) {
try {
final String field = parseMandatoryStringValue(pathPrefix + XML_ELEMENT_FACET_FIELD);
final String name = parseOptionalStringValue(pathPrefix + XML_ELEMENT_FACET_NAME);
final String... | java |
protected Boolean parseOptionalBooleanValue(final String path) {
final I_CmsXmlContentValue value = m_xml.getValue(path, m_locale);
if (value == null) {
return null;
} else {
final String stringValue = value.getStringValue(null);
try {
final B... | java |
protected Integer parseOptionalIntValue(final String path) {
final I_CmsXmlContentValue value = m_xml.getValue(path, m_locale);
if (value == null) {
return null;
} else {
final String stringValue = value.getStringValue(null);
try {
final Integ... | java |
protected String parseOptionalStringValue(final String path) {
final I_CmsXmlContentValue value = m_xml.getValue(path, m_locale);
if (value == null) {
return null;
} else {
return value.getStringValue(null);
}
} | java |
protected List<String> parseOptionalStringValues(final String path) {
final List<I_CmsXmlContentValue> values = m_xml.getValues(path, m_locale);
if (values == null) {
return null;
} else {
List<String> stringValues = new ArrayList<String>(values.size());
for ... | java |
protected I_CmsSearchConfigurationFacetRange parseRangeFacet(String pathPrefix) {
try {
final String range = parseMandatoryStringValue(pathPrefix + XML_ELEMENT_RANGE_FACET_RANGE);
final String name = parseOptionalStringValue(pathPrefix + XML_ELEMENT_FACET_NAME);
final String... | java |
private List<Integer> getPageSizes() {
final String pageSizes = parseOptionalStringValue(XML_ELEMENT_PAGESIZE);
if (pageSizes != null) {
String[] pageSizesArray = pageSizes.split("-");
if (pageSizesArray.length > 0) {
try {
List<Integer> resul... | java |
private String getQueryParam() {
final String param = parseOptionalStringValue(XML_ELEMENT_QUERYPARAM);
if (param == null) {
return DEFAULT_QUERY_PARAM;
} else {
return param;
}
} | java |
private List<I_CmsSearchConfigurationSortOption> getSortOptions() {
final List<I_CmsSearchConfigurationSortOption> options = new ArrayList<I_CmsSearchConfigurationSortOption>();
final CmsXmlContentValueSequence sortOptions = m_xml.getValueSequence(XML_ELEMENT_SORTOPTIONS, m_locale);
if (sortOpt... | java |
private I_CmsFacetQueryItem parseFacetQueryItem(final String prefix) {
I_CmsXmlContentValue query = m_xml.getValue(prefix + XML_ELEMENT_QUERY_FACET_QUERY_QUERY, m_locale);
if (null != query) {
String queryString = query.getStringValue(null);
I_CmsXmlContentValue label = m_xml.ge... | java |
private String parseMandatoryStringValue(final String path) throws Exception {
final String value = parseOptionalStringValue(path);
if (value == null) {
throw new Exception();
}
return value;
} | java |
protected I_CmsSearchDocument createDefaultIndexDocument() {
try {
return m_index.getFieldConfiguration().createDocument(m_cms, m_res, m_index, null);
} catch (CmsException e) {
LOG.error(
"Default document for "
+ m_res.getRootPath()
... | java |
public CmsJspInstanceDateBean getToInstanceDate() {
if (m_instanceDate == null) {
m_instanceDate = new CmsJspInstanceDateBean(getToDate(), m_cms.getRequestContext().getLocale());
}
return m_instanceDate;
} | java |
public static String getGalleryNotFoundKey(String gallery) {
StringBuffer sb = new StringBuffer(ERROR_REASON_NO_PREFIX);
sb.append(gallery.toUpperCase());
sb.append(GUI_TITLE_POSTFIX);
return sb.toString();
} | java |
public static String getTitleGalleryKey(String gallery) {
StringBuffer sb = new StringBuffer(GUI_TITLE_PREFIX);
sb.append(gallery.toUpperCase());
sb.append(GUI_TITLE_POSTFIX);
return sb.toString();
} | java |
public static String getTemplateMapperConfig(ServletRequest request) {
String result = null;
CmsTemplateContext templateContext = (CmsTemplateContext)request.getAttribute(
CmsTemplateContextManager.ATTR_TEMPLATE_CONTEXT);
if (templateContext != null) {
I_CmsTemplateConte... | java |
private CmsTemplateMapperConfiguration getConfiguration(final CmsObject cms) {
if (!m_enabled) {
return CmsTemplateMapperConfiguration.EMPTY_CONFIG;
}
if (m_configPath == null) {
m_configPath = OpenCms.getSystemInfo().getConfigFilePath(cms, "template-mapping.xml");
... | java |
private void onShow() {
if (m_detailsFieldset != null) {
m_detailsFieldset.getContentPanel().getElement().getStyle().setPropertyPx(
"maxHeight",
getAvailableHeight(m_messageWidget.getOffsetHeight()));
}
} | java |
public void addModuleToExport(final String moduleName) {
if (m_modulesToExport == null) {
m_modulesToExport = new HashSet<String>();
}
m_modulesToExport.add(moduleName);
} | java |
public int checkIn() {
try {
synchronized (STATIC_LOCK) {
m_logStream = new PrintStream(new FileOutputStream(DEFAULT_LOGFILE_PATH, false));
CmsObject cms = getCmsObject();
if (cms != null) {
return checkInInternal();
... | java |
public boolean setCurrentConfiguration(CmsGitConfiguration configuration) {
if ((null != configuration) && configuration.isValid()) {
m_currentConfiguration = configuration;
return true;
}
return false;
} | java |
private int checkInInternal() {
m_logStream.println("[" + new Date() + "] STARTING Git task");
m_logStream.println("=========================");
m_logStream.println();
if (m_checkout) {
m_logStream.println("Running checkout script");
} else if (!(m_resetHead || m_r... | java |
private String checkinScriptCommand() {
String exportModules = "";
if ((m_modulesToExport != null) && !m_modulesToExport.isEmpty()) {
StringBuffer exportModulesParam = new StringBuffer();
for (String moduleName : m_modulesToExport) {
exportModulesParam.append(" "... | java |
private void exportModules() {
// avoid to export modules if unnecessary
if (((null != m_copyAndUnzip) && !m_copyAndUnzip.booleanValue())
|| ((null == m_copyAndUnzip) && !m_currentConfiguration.getDefaultCopyAndUnzip())) {
m_logStream.println();
m_logStream.println("... | java |
private List<CmsGitConfiguration> readConfigFiles() {
List<CmsGitConfiguration> configurations = new LinkedList<CmsGitConfiguration>();
// Default configuration file for backwards compatibility
addConfigurationIfValid(configurations, new File(DEFAULT_CONFIG_FILE));
// All files in the... | java |
private int runCommitScript() {
if (m_checkout && !m_fetchAndResetBeforeImport) {
m_logStream.println("Skipping script....");
return 0;
}
try {
m_logStream.flush();
String commandParam;
if (m_resetRemoteHead) {
commandP... | java |
protected void updateForNewConfiguration(CmsGitConfiguration gitConfig) {
if (!m_checkinBean.setCurrentConfiguration(gitConfig)) {
Notification.show(
CmsVaadinUtils.getMessageText(Messages.GUI_GIT_CONFIGURATION_SWITCH_FAILED_0),
CmsVaadinUtils.getMessageText(Messages... | java |
private void configureConfigurationSelector() {
if (m_checkinBean.getConfigurations().size() < 2) {
// Do not show the configuration selection at all.
removeComponent(m_configurationSelectionPanel);
} else {
for (CmsGitConfiguration configuration : m_checkinBean.getC... | java |
public void loadWithTimeout(int timeout) {
for (String stylesheet : m_stylesheets) {
boolean alreadyLoaded = checkStylesheet(stylesheet);
if (alreadyLoaded) {
m_loadCounter += 1;
} else {
appendStylesheet(stylesheet, m_jsCallback);
... | java |
protected boolean hasPermissions(CmsObject cms, CmsSolrDocument doc, CmsResourceFilter filter) {
return null != (filter == null ? getResource(cms, doc) : getResource(cms, doc, filter));
} | java |
private boolean isDebug(CmsObject cms, CmsSolrQuery query) {
String[] debugSecretValues = query.remove(REQUEST_PARAM_DEBUG_SECRET);
String debugSecret = (debugSecretValues == null) || (debugSecretValues.length < 1)
? null
: debugSecretValues[0];
if ((null != debugSecret) &... | java |
private void throwExceptionIfSafetyRestrictionsAreViolated(CmsObject cms, CmsSolrQuery query, boolean isSpell)
throws CmsSearchException {
if (!isDebug(cms, query)) {
if (isSpell) {
if (m_handlerSpellDisabled) {
throw new CmsSearchException(Messages.get... | java |
private String alterPrefix(String word, String oldPrefix, String newPrefix) {
if (word.startsWith(oldPrefix)) {
return word.replaceFirst(oldPrefix, newPrefix);
}
return (newPrefix + word);
} | java |
public void updateColor(TestColor color) {
switch (color) {
case green:
m_forwardButton.setEnabled(true);
m_confirmCheckbox.setVisible(false);
m_status.setValue(STATUS_GREEN);
break;
case yellow:
m_forwardBu... | java |
public void copyCategories(CmsObject cms, CmsResource fromResource, String toResourceSitePath) throws CmsException {
List<CmsCategory> categories = readResourceCategories(cms, fromResource);
for (CmsCategory category : categories) {
addResourceToCategory(cms, toResourceSitePath, category);
... | java |
static Locale getLocale(PageContext pageContext, String name) {
Locale loc = null;
Object obj = javax.servlet.jsp.jstl.core.Config.find(pageContext, name);
if (obj != null) {
if (obj instanceof Locale) {
loc = (Locale)obj;
} else {
... | java |
protected String generateCacheKey(
CmsObject cms,
String targetSiteRoot,
String detailPagePart,
String absoluteLink) {
return cms.getRequestContext().getSiteRoot() + ":" + targetSiteRoot + ":" + detailPagePart + absoluteLink;
} | java |
protected boolean isSecureLink(CmsObject cms, String vfsName, CmsSite targetSite, boolean secureRequest) {
return OpenCms.getStaticExportManager().isSecureLink(cms, vfsName, targetSite.getSiteRoot(), secureRequest);
} | java |
private float MIN(float first, float second, float third) {
float min = Integer.MAX_VALUE;
if (first < min) {
min = first;
}
if (second < min) {
min = second;
}
if (third < min) {
min = third;
}
return min;
... | java |
private void setHex() {
String hRed = Integer.toHexString(getRed());
String hGreen = Integer.toHexString(getGreen());
String hBlue = Integer.toHexString(getBlue());
if (hRed.length() == 0) {
hRed = "00";
}
if (hRed.length() == 1) {
hRed... | java |
private String formatDate(Date date) {
if (null == m_dateFormat) {
m_dateFormat = DateFormat.getDateInstance(
0,
OpenCms.getWorkplaceManager().getWorkplaceLocale(getCmsObject()));
}
return m_dateFormat.format(date);
} | java |
public static String createResource(
CmsObject cmsObject,
String newLink,
Locale locale,
String sitePath,
String modelFileName,
String mode,
String postCreateHandler) {
String[] newLinkParts = newLink.split("\\|");
String rootPath = newLinkParts[1... | java |
private static I_CmsResourceBundle tryBundle(String localizedName) {
I_CmsResourceBundle result = null;
try {
String resourceName = localizedName.replace('.', '/') + ".properties";
URL url = CmsResourceBundleLoader.class.getClassLoader().getResource(resourceName);
... | java |
private static ResourceBundle tryBundle(String baseName, Locale locale, boolean wantBase) {
I_CmsResourceBundle first = null; // The most specialized bundle.
I_CmsResourceBundle last = null; // The least specialized bundle.
List<String> bundleNames = CmsLocaleManager.getLocaleVariants(baseName... | java |
public CmsMessageContainer validateWithMessage() {
if (m_parsingFailed) {
return Messages.get().container(Messages.ERR_SERIALDATE_INVALID_VALUE_0);
}
if (!isStartSet()) {
return Messages.get().container(Messages.ERR_SERIALDATE_START_MISSING_0);
}
if (!isE... | java |
private JSONArray datesToJson(Collection<Date> individualDates) {
if (null != individualDates) {
JSONArray result = new JSONArray();
for (Date d : individualDates) {
result.put(dateToJson(d));
}
return result;
}
return null;
} | java |
private JSONArray readOptionalArray(JSONObject json, String key) {
try {
return json.getJSONArray(key);
} catch (JSONException e) {
LOG.debug("Reading optional JSON array failed. Default to provided default value.", e);
}
return null;
} | java |
private Boolean readOptionalBoolean(JSONObject json, String key) {
try {
return Boolean.valueOf(json.getBoolean(key));
} catch (JSONException e) {
LOG.debug("Reading optional JSON boolean failed. Default to provided default value.", e);
}
return null;
} | java |
private String readOptionalString(JSONObject json, String key, String defaultValue) {
try {
String str = json.getString(key);
if (str != null) {
return str;
}
} catch (JSONException e) {
LOG.debug("Reading optional JSON string failed. Def... | java |
private void readPattern(JSONObject patternJson) {
setPatternType(readPatternType(patternJson));
setInterval(readOptionalInt(patternJson, JsonKey.PATTERN_INTERVAL));
setWeekDays(readWeekDays(patternJson));
setDayOfMonth(readOptionalInt(patternJson, JsonKey.PATTERN_DAY_OF_MONTH));
... | java |
private JSONArray toJsonStringArray(Collection<? extends Object> collection) {
if (null != collection) {
JSONArray array = new JSONArray();
for (Object o : collection) {
array.put("" + o);
}
return array;
} else {
return null;
... | java |
private String validateDuration() {
if (!isValidEndTypeForPattern()) {
return Messages.ERR_SERIALDATE_INVALID_END_TYPE_FOR_PATTERN_0;
}
switch (getEndType()) {
case DATE:
return (getStart().getTime() < (getSeriesEndDate().getTime() + DAY_IN_MILLIS))
... | java |
private String validatePattern() {
String error = null;
switch (getPatternType()) {
case DAILY:
error = isEveryWorkingDay() ? null : validateInterval();
break;
case WEEKLY:
error = validateInterval();
if (null == er... | java |
public static HikariConfig createHikariConfig(CmsParameterConfiguration config, String key) {
Map<String, String> poolMap = Maps.newHashMap();
for (Map.Entry<String, String> entry : config.entrySet()) {
String suffix = getPropertyRelativeSuffix(KEY_DATABASE_POOL + "." + key, entry.getKey())... | java |
private CmsXmlContent unmarshalXmlContent(CmsFile file) throws CmsXmlException {
CmsXmlContent content = CmsXmlContentFactory.unmarshal(m_cms, file);
content.setAutoCorrectionEnabled(true);
content.correctXmlStructure(m_cms);
return content;
} | java |
protected CmsAccessControlEntry getImportAccessControlEntry(
CmsResource res,
String id,
String allowed,
String denied,
String flags) {
return new CmsAccessControlEntry(
res.getResourceId(),
new CmsUUID(id),
Integer.parseInt(allowed),
... | java |
public static String getStateKey(CmsResourceState state) {
StringBuffer sb = new StringBuffer(STATE_PREFIX);
sb.append(state);
sb.append(STATE_POSTFIX);
return sb.toString();
} | java |
public static Button createPublishButton(final I_CmsUpdateListener<String> updateListener) {
Button publishButton = CmsToolBar.createButton(
FontOpenCms.PUBLISH,
CmsVaadinUtils.getMessageText(Messages.GUI_PUBLISH_BUTTON_TITLE_0));
if (CmsAppWorkplaceUi.isOnlineProject()) {
... | java |
Map<Object, Object> getFilters() {
Map<Object, Object> result = new HashMap<Object, Object>(4);
result.put(TableProperty.KEY, m_table.getFilterFieldValue(TableProperty.KEY));
result.put(TableProperty.DEFAULT, m_table.getFilterFieldValue(TableProperty.DEFAULT));
result.put(TableProperty.... | java |
void saveAction() {
Map<Object, Object> filters = getFilters();
m_table.clearFilters();
try {
m_model.save();
disableSaveButtons();
} catch (CmsException e) {
LOG.error(m_messages.key(Messages.ERR_SAVING_CHANGES_0), e);
CmsErrorDialog.s... | java |
void setFilters(Map<Object, Object> filters) {
for (Object column : filters.keySet()) {
Object filterValue = filters.get(column);
if ((filterValue != null) && !filterValue.toString().isEmpty() && !m_table.isColumnCollapsed(column)) {
m_table.setFilterFieldValue(column, f... | java |
private void adjustOptionsColumn(
CmsMessageBundleEditorTypes.EditMode oldMode,
CmsMessageBundleEditorTypes.EditMode newMode) {
if (m_model.isShowOptionsColumn(oldMode) != m_model.isShowOptionsColumn(newMode)) {
m_table.removeGeneratedColumn(TableProperty.OPTIONS);
if (m... | java |
private void adjustVisibleColumns() {
if (m_table.isColumnCollapsingAllowed()) {
if ((m_model.hasDefaultValues()) || m_model.getBundleType().equals(BundleType.DESCRIPTOR)) {
m_table.setColumnCollapsed(TableProperty.DEFAULT, false);
} else {
m_table.setCol... | java |
private void cleanUpAction() {
try {
m_model.deleteDescriptorIfNecessary();
} catch (CmsException e) {
LOG.error(m_messages.key(Messages.ERR_DELETING_DESCRIPTOR_0), e);
}
// unlock resource
m_model.unlock();
} | java |
@SuppressWarnings("serial")
private Component createAddDescriptorButton() {
Button addDescriptorButton = CmsToolBar.createButton(
FontOpenCms.COPY_LOCALE,
m_messages.key(Messages.GUI_ADD_DESCRIPTOR_0));
addDescriptorButton.setDisableOnClick(true);
addDescriptorButt... | java |
@SuppressWarnings("serial")
private Component createCloseButton() {
Button closeBtn = CmsToolBar.createButton(
FontOpenCms.CIRCLE_INV_CANCEL,
m_messages.key(Messages.GUI_BUTTON_CANCEL_0));
closeBtn.addClickListener(new ClickListener() {
public void buttonClick(C... | java |
private Component createConvertToPropertyBundleButton() {
Button addDescriptorButton = CmsToolBar.createButton(
FontOpenCms.SETTINGS,
m_messages.key(Messages.GUI_CONVERT_TO_PROPERTY_BUNDLE_0));
addDescriptorButton.setDisableOnClick(true);
addDescriptorButton.addClickLi... | java |
private Component createMainComponent() throws IOException, CmsException {
VerticalLayout mainComponent = new VerticalLayout();
mainComponent.setSizeFull();
mainComponent.addStyleName("o-message-bundle-editor");
m_table = createTable();
Panel navigator = new Panel();
nav... | java |
@SuppressWarnings("serial")
private Button createSaveExitButton() {
Button saveExitBtn = CmsToolBar.createButton(
FontOpenCms.SAVE_EXIT,
m_messages.key(Messages.GUI_BUTTON_SAVE_AND_EXIT_0));
saveExitBtn.addClickListener(new ClickListener() {
public void buttonCl... | java |
private void fillToolBar(final I_CmsAppUIContext context) {
context.setAppTitle(m_messages.key(Messages.GUI_APP_TITLE_0));
// create components
Component publishBtn = createPublishButton();
m_saveBtn = createSaveButton();
m_saveExitBtn = createSaveExitButton();
Componen... | java |
private void handleChange(Object propertyId) {
if (!m_saveBtn.isEnabled()) {
m_saveBtn.setEnabled(true);
m_saveExitBtn.setEnabled(true);
}
m_model.handleChange(propertyId);
} | java |
private void initFieldFactories() {
if (m_model.hasMasterMode()) {
TranslateTableFieldFactory masterFieldFactory = new CmsMessageBundleEditorTypes.TranslateTableFieldFactory(
m_table,
m_model.getEditableColumns(CmsMessageBundleEditorTypes.EditMode.MASTER));
... | java |
private void initStyleGenerators() {
if (m_model.hasMasterMode()) {
m_styleGenerators.put(
CmsMessageBundleEditorTypes.EditMode.MASTER,
new CmsMessageBundleEditorTypes.TranslateTableCellStyleGenerator(
m_model.getEditableColumns(CmsMessageBundleEd... | java |
private boolean keyAlreadyExists(String newKey) {
Collection<?> itemIds = m_table.getItemIds();
for (Object itemId : itemIds) {
if (m_table.getItem(itemId).getItemProperty(TableProperty.KEY).getValue().equals(newKey)) {
return true;
}
}
return fal... | java |
public void uploadFields(
final Set<String> fields,
final Function<Map<String, String>, Void> filenameCallback,
final I_CmsErrorCallback errorCallback) {
disableAllFileFieldsExcept(fields);
final String id = CmsJsUtils.generateRandomId();
updateFormAction(id);
//... | java |
public static CmsJspResourceWrapper convertResource(CmsObject cms, Object input) throws CmsException {
CmsJspResourceWrapper result;
if (input instanceof CmsResource) {
result = CmsJspResourceWrapper.wrap(cms, (CmsResource)input);
} else {
result = CmsJspResourceWrapper.... | java |
public static List<CmsJspResourceWrapper> convertResourceList(CmsObject cms, List<CmsResource> list) {
List<CmsJspResourceWrapper> result = new ArrayList<CmsJspResourceWrapper>(list.size());
for (CmsResource res : list) {
result.add(CmsJspResourceWrapper.wrap(cms, res));
}
r... | java |
public static I_CmsSearchConfigurationPagination create(
String pageParam,
List<Integer> pageSizes,
Integer pageNavLength) {
return (pageParam != null) || (pageSizes != null) || (pageNavLength != null)
? new CmsSearchConfigurationPagination(pageParam, pageSizes, pageNavLength)
... | java |
public static String getDateCreatedTimeRangeFilterQuery(String searchField, long startTime, long endTime) {
String sStartTime = null;
String sEndTime = null;
// Convert startTime to ISO 8601 format
if ((startTime > Long.MIN_VALUE) && (startTime < Long.MAX_VALUE)) {
sStartTi... | java |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.