@Override protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { String mode = req.getParameter("mode"); int status; if ("request".equals(mode)) { status = Boolean.TRUE.equals(req.getAttribute(BAT_ATTRIBUTE_NAME)) ? HttpServletResponse.SC_OK : HttpServletResponse.SC_INTERNAL_SERVER_ERROR; } else if ("sce".equals(mode)) { status = Boolean.TRUE.equals(req.getServletContext().getAttribute(BAT_ATTRIBUTE_NAME)) ? HttpServletResponse.SC_OK : HttpServletResponse.SC_INTERNAL_SERVER_ERROR; } else if ("session".equals(mode)) { status = Boolean.TRUE.equals(req.getSession().getAttribute(BAT_ATTRIBUTE_NAME)) ? HttpServletResponse.SC_OK : HttpServletResponse.SC_INTERNAL_SERVER_ERROR; } else { status = HttpServletResponse.SC_NOT_FOUND; } resp.setStatus(status); }
private void maybeShowFor(Component c, MouseEvent me) { if (!(c instanceof JComponent)) return; JComponent comp = (JComponent) c; Window wnd = SwingUtilities.getWindowAncestor(comp); if (wnd == null) return; if (!wnd.isActive()) { if (JBPopupFactory.getInstance().isChildPopupFocused(wnd)) return; } String tooltipText = comp.getToolTipText(me); if (tooltipText == null || tooltipText.trim().isEmpty()) return; boolean centerDefault = Boolean.TRUE.equals(comp.getClientProperty(UIUtil.CENTER_TOOLTIP_DEFAULT)); boolean centerStrict = Boolean.TRUE.equals(comp.getClientProperty(UIUtil.CENTER_TOOLTIP_STRICT)); int shift = centerStrict ? 0 : centerDefault ? 4 : 0; // Balloon may appear exactly above useful content, such behavior is rather annoying. if (c instanceof JTree) { TreePath path = ((JTree) c).getClosestPathForLocation(me.getX(), me.getY()); if (path != null) { Rectangle pathBounds = ((JTree) c).getPathBounds(path); if (pathBounds != null && pathBounds.y + 4 < me.getY()) { shift += me.getY() - pathBounds.y - 4; } } } queueShow(comp, me, centerStrict || centerDefault, shift, -shift, -shift); }
/** * Called before window creation, descendants should override to initialize the data, initialize * params. */ void preInit(XCreateWindowParams params) { state_lock = new StateLock(); initialising = InitialiseState.NOT_INITIALISED; embedded = Boolean.TRUE.equals(params.get(EMBEDDED)); visible = Boolean.TRUE.equals(params.get(VISIBLE)); Object parent = params.get(PARENT); if (parent instanceof XBaseWindow) { parentWindow = (XBaseWindow) parent; } else { Long parentWindowID = (Long) params.get(PARENT_WINDOW); if (parentWindowID != null) { parentWindow = XToolkit.windowToXWindow(parentWindowID); } } Long eventMask = (Long) params.get(EVENT_MASK); if (eventMask != null) { long mask = eventMask.longValue(); mask |= SubstructureNotifyMask; params.put(EVENT_MASK, mask); } screen = -1; }
static String toString( Boolean preserveReplication, Boolean preserveBlockSize, Boolean preserveUser, Boolean preserveGroup, Boolean preservePermission) { StringBuilder sb = new StringBuilder(); if (Boolean.TRUE.equals(preserveReplication)) { sb.append("r"); } if (Boolean.TRUE.equals(preserveBlockSize)) { sb.append("b"); } if (Boolean.TRUE.equals(preserveUser)) { sb.append("u"); } if (Boolean.TRUE.equals(preserveGroup)) { sb.append("g"); } if (Boolean.TRUE.equals(preservePermission)) { sb.append("p"); } if (sb.length() > 0) { sb.insert(0, "-p"); } return sb.toString(); }
private BuildActionExecuter<ProviderOperationParameters> createExecuter( ProviderOperationParameters operationParameters) { LoggingServiceRegistry loggingServices; Parameters params = initParams(operationParameters); BuildActionExecuter<BuildActionParameters> executer; if (Boolean.TRUE.equals(operationParameters.isEmbedded())) { loggingServices = this.loggingServices; executer = embeddedExecutor; } else { if (Boolean.TRUE.equals(operationParameters.isColorOutput())) { PrintStream outStr = new PrintStream(operationParameters.getStandardOutput()); DefaultColorMap colourMap = new DefaultColorMap(); colourMap.setUseColor(true); Console console = new AnsiConsole(outStr, outStr, colourMap, true); loggingServices = this.loggingServices.newColoredLogging(console); } else { loggingServices = this.loggingServices.newToolingApiLogging(); } loggingServices .get(OutputEventRenderer.class) .configure(operationParameters.getBuildLogLevel()); ServiceRegistry clientServices = daemonClientFactory.createBuildClientServices( loggingServices.get(OutputEventListener.class), params.daemonParams, operationParameters.getStandardInput(SafeStreams.emptyInput())); executer = clientServices.get(DaemonClient.class); } Factory<LoggingManagerInternal> loggingManagerFactory = loggingServices.getFactory(LoggingManagerInternal.class); return new LoggingBridgingBuildActionExecuter( new DaemonBuildActionExecuter(executer, params.daemonParams), loggingManagerFactory); }
public void summaryRowSelection(final ReportEvent event) { if (rowbandingOnGroup == false) { return; } if (StringUtils.isEmpty(group)) { final Group group = event.getReport().getGroup(event.getState().getCurrentGroupIndex()); if (group instanceof CrosstabRowGroup) { final GroupBody body = group.getBody(); if (body instanceof CrosstabColumnGroupBody) { if (Boolean.TRUE.equals( group.getAttribute( AttributeNames.Crosstab.NAMESPACE, AttributeNames.Crosstab.PRINT_SUMMARY))) { triggerVisibleStateCrosstab(event); } } } } else { if (FunctionUtilities.isDefinedGroup(group, event)) { final Group group = event.getReport().getGroup(event.getState().getCurrentGroupIndex()); if (Boolean.TRUE.equals( group.getAttribute( AttributeNames.Crosstab.NAMESPACE, AttributeNames.Crosstab.PRINT_SUMMARY))) { triggerVisibleStateCrosstab(event); } } } }
static Predicate<ServiceConfiguration> listAllOrInternal( final Boolean listAllArg, final Boolean listUserServicesArg, final Boolean listInternalArg) { final boolean listAll = Boolean.TRUE.equals(listAllArg); final boolean listInternal = Boolean.TRUE.equals(listInternalArg); final boolean listUserServices = Boolean.TRUE.equals(listUserServicesArg); return new Predicate<ServiceConfiguration>() { @Override public boolean apply(final ServiceConfiguration input) { if (listAll) { return true; } else if (input.getComponentId().isDistributedService() || Empyrean.class.equals(input.getComponentId().getClass())) { return true; } else if (input.getComponentId().isPublicService()) { return Internets.testLocal(input.getHostName()); } else if (input.getComponentId().isAdminService() && listUserServices) { return Internets.testLocal(input.getHostName()); } else if (input.getComponentId().isInternal() && listInternal) { return Internets.testLocal(input.getHostName()); } else { return false; } } }; }
@Override public String getFirst(Map flags, String... keys) { for (String k : keys) { if (k != null && containsKey(k)) return (String) get(k); } if (flags.get("warnIfNone") != null && !Boolean.FALSE.equals(flags.get("warnIfNone"))) { if (Boolean.TRUE.equals(flags.get("warnIfNone"))) LOG.warn("Unable to find Brooklyn property " + keys); else LOG.warn("" + flags.get("warnIfNone")); } if (flags.get("failIfNone") != null && !Boolean.FALSE.equals(flags.get("failIfNone"))) { Object f = flags.get("failIfNone"); if (f instanceof Closure) ((Closure) f).call((Object[]) keys); if (Boolean.TRUE.equals(f)) throw new NoSuchElementException( "Brooklyn unable to find mandatory property " + keys[0] + (keys.length > 1 ? " (or " + (keys.length - 1) + " other possible names, full list is " + Arrays.asList(keys) + ")" : "")); else throw new NoSuchElementException("" + f); } if (flags.get("defaultIfNone") != null) { return (String) flags.get("defaultIfNone"); } return null; }
public static DescribeServicesResponseType describeService(final DescribeServicesType request) { final DescribeServicesResponseType reply = request.getReply(); Topology.touch(request); if (request.getServices().isEmpty()) { final ComponentId compId = (request.getByServiceType() != null) ? ComponentIds.lookup(request.getByServiceType().toLowerCase()) : Empyrean.INSTANCE; final boolean showEventStacks = Boolean.TRUE.equals(request.getShowEventStacks()); final boolean showEvents = Boolean.TRUE.equals(request.getShowEvents()) || showEventStacks; final Function<ServiceConfiguration, ServiceStatusType> transformToStatus = ServiceConfigurations.asServiceStatus(showEvents, showEventStacks); final List<Predicate<ServiceConfiguration>> filters = new ArrayList<Predicate<ServiceConfiguration>>() { { if (request.getByPartition() != null) { Partitions.exists(request.getByPartition()); this.add(Filters.partition(request.getByPartition())); } if (request.getByState() != null) { final Component.State stateFilter = Component.State.valueOf(request.getByState().toUpperCase()); this.add(Filters.state(stateFilter)); } if (!request.getServiceNames().isEmpty()) { this.add(Filters.name(request.getServiceNames())); } this.add(Filters.host(request.getByHost())); this.add( Filters.listAllOrInternal( request.getListAll(), request.getListUserServices(), request.getListInternal())); } }; final Predicate<Component> componentFilter = Filters.componentType(compId); final Predicate<ServiceConfiguration> configPredicate = Predicates.and(filters); List<ServiceConfiguration> replyConfigs = Lists.newArrayList(); for (final Component comp : Components.list()) { if (componentFilter.apply(comp)) { Collection<ServiceConfiguration> acceptedConfigs = Collections2.filter(comp.services(), configPredicate); replyConfigs.addAll(acceptedConfigs); } } ImmutableList<ServiceConfiguration> sortedReplyConfigs = ServiceOrderings.defaultOrdering().immutableSortedCopy(replyConfigs); final Collection<ServiceStatusType> transformedReplyConfigs = Collections2.transform(sortedReplyConfigs, transformToStatus); reply.getServiceStatuses().addAll(transformedReplyConfigs); } else { for (ServiceId s : request.getServices()) { reply.getServiceStatuses().add(TypeMappers.transform(s, ServiceStatusType.class)); } } return reply; }
public void update(final AnActionEvent e) { final FileGroupInfo fileGroupInfo = new FileGroupInfo(); myHelperAction.setFileIterationListener(fileGroupInfo); myHelperAction.update(e); myGetterStub.setDelegate(fileGroupInfo); if ((e.getPresentation().isEnabled())) { removeAll(); if (myHelperAction.allAreIgnored()) { final DataContext dataContext = e.getDataContext(); final Project project = CommonDataKeys.PROJECT.getData(dataContext); SvnVcs vcs = SvnVcs.getInstance(project); final Ref<Boolean> filesOk = new Ref<Boolean>(Boolean.FALSE); final Ref<Boolean> extensionOk = new Ref<Boolean>(Boolean.FALSE); // virtual files parameter is not used -> can pass null SvnPropertyService.doCheckIgnoreProperty( vcs, project, null, fileGroupInfo, fileGroupInfo.getExtensionMask(), filesOk, extensionOk); if (Boolean.TRUE.equals(filesOk.get())) { myRemoveExactAction.setActionText( fileGroupInfo.oneFileSelected() ? fileGroupInfo.getFileName() : SvnBundle.message("action.Subversion.UndoIgnore.text")); add(myRemoveExactAction); } if (Boolean.TRUE.equals(extensionOk.get())) { myRemoveExtensionAction.setActionText(fileGroupInfo.getExtensionMask()); add(myRemoveExtensionAction); } e.getPresentation().setText(SvnBundle.message("group.RevertIgnoreChoicesGroup.text")); } else if (myHelperAction.allCanBeIgnored()) { final String ignoreExactlyName = (fileGroupInfo.oneFileSelected()) ? fileGroupInfo.getFileName() : SvnBundle.message("action.Subversion.Ignore.ExactMatch.text"); myAddExactAction.setActionText(ignoreExactlyName); add(myAddExactAction); if (fileGroupInfo.sameExtension()) { myAddExtensionAction.setActionText(fileGroupInfo.getExtensionMask()); add(myAddExtensionAction); } e.getPresentation().setText(SvnBundle.message("group.IgnoreChoicesGroup.text")); } } }
@RequestMapping(value = "/summary/createUpdateDeliveryAddress.json", method = RequestMethod.POST) @RequireHardLogIn public String createUpdateDeliveryAddress( final Model model, @Valid final AddressForm form, final BindingResult bindingResult) { if (bindingResult.hasErrors()) { model.addAttribute("edit", Boolean.valueOf(StringUtils.isNotBlank(form.getAddressId()))); // Work out if the address form should be displayed based on the payment type final B2BPaymentTypeData paymentType = getCheckoutFacade().getCheckoutCart().getPaymentType(); final boolean payOnAccount = paymentType != null && CheckoutPaymentType.ACCOUNT.getCode().equals(paymentType.getCode()); model.addAttribute("showAddressForm", Boolean.valueOf(!payOnAccount)); return ControllerConstants.Views.Fragments.SingleStepCheckout.DeliveryAddressFormPopup; } // create delivery address and set it on cart final AddressData addressData = new AddressData(); addressData.setId(form.getAddressId()); addressData.setTitleCode(form.getTitleCode()); addressData.setFirstName(form.getFirstName()); addressData.setLastName(form.getLastName()); addressData.setLine1(form.getLine1()); addressData.setLine2(form.getLine2()); addressData.setTown(form.getTownCity()); addressData.setPostalCode(form.getPostcode()); addressData.setCountry(getI18NFacade().getCountryForIsocode(form.getCountryIso())); addressData.setShippingAddress( Boolean.TRUE.equals(form.getShippingAddress()) || Boolean.TRUE.equals(form.getSaveInAddressBook())); addressData.setVisibleInAddressBook( Boolean.TRUE.equals(form.getSaveInAddressBook()) || StringUtils.isNotBlank(form.getAddressId())); addressData.setDefaultAddress(Boolean.TRUE.equals(form.getDefaultAddress())); if (StringUtils.isBlank(form.getAddressId())) { getUserFacade().addAddress(addressData); } else { getUserFacade().editAddress(addressData); } getCheckoutFacade().setDeliveryAddress(addressData); if (getCheckoutFacade().getCheckoutCart().getDeliveryMode() == null) { getCheckoutFacade().setDeliveryModeIfAvailable(); } model.addAttribute("createUpdateStatus", "Success"); model.addAttribute("addressId", addressData.getId()); return REDIRECT_PREFIX + "/checkout/single/summary/getDeliveryAddressForm.json?addressId=" + addressData.getId() + "&createUpdateStatus=Success"; }
@Override protected void onBtnSaveClick() throws ims.framework.exceptions.PresentationLogicException { PatientElectiveListBedAdmissionVo patientElectiveList = null; if (Boolean.TRUE.equals(ConfigFlag.GEN.USE_ELECTIVE_LIST_FUNCTIONALITY.getValue())) { // Get current Patient Elective List patientElectiveList = domain.getPatientElectiveListForAppointment( form.getGlobalContext().Scheduling.getBookingAppointmentRef()); if (patientElectiveList != null) { if (Specialty.EMERGENCY.equals(form.cmbSpecialty().getValue())) { // If there are no other elective list to be cancelled TCIOutcomeForPatientElectiveListVo outcome = new TCIOutcomeForPatientElectiveListVo(); if (ElectiveListReason.DIAGNOSTIC.equals(patientElectiveList.getElectiveListReason())) outcome.setOutcome(AdmissionOfferOutcome.PATIENT_ADMITTED); else outcome.setOutcome(AdmissionOfferOutcome.PATIENT_ADMITTED_COMMENCED_8); outcome.setChangeBy((MemberOfStaffRefVo) domain.getMosUser()); outcome.setStatusDateTime(new DateTime()); outcome.setOutcomeReason(null); patientElectiveList.getTCIDetails().setCurrentOutcome(outcome); patientElectiveList.getTCIDetails().getOutcomeHistory().add(outcome); patientElectiveList.getTCIDetails().setIsActive(Boolean.FALSE); if (ElectiveListReason.DIAGNOSTIC.equals(patientElectiveList.getElectiveListReason())) { if (patientElectiveList.getPathwayClock() != null) patientElectiveList .getPathwayClock() .setStopDate( form.dtimAdmDateTime().getValue() != null ? form.dtimAdmDateTime().getValue().getDate() : null); } // Check for existing Patient Elective list if (Boolean.TRUE.equals( domain.hasPatientElectiveListsToBeCancelled( form.getGlobalContext().Core.getPatientShort(), patientElectiveList, patientElectiveList.getElectiveList().getService()))) { form.getLocalContext().setPatientElectiveList(patientElectiveList); engine.showMessage( "Patient has other Patient Elective records for the same service. Cancel these records?", "Warning", MessageButtons.YESNOCANCEL); return; } } } } if (saveAdmission(patientElectiveList, null)) engine.close(DialogResult.OK); }
@RequestMapping(value = "/select-suggested-address", method = RequestMethod.POST) public String doSelectSuggestedAddress( final AddressForm addressForm, final RedirectAttributes redirectModel) { final Set<String> resolveCountryRegions = org.springframework.util.StringUtils.commaDelimitedListToSet( Config.getParameter("resolve.country.regions")); final AddressData selectedAddress = new AddressData(); selectedAddress.setId(addressForm.getAddressId()); selectedAddress.setTitleCode(addressForm.getTitleCode()); selectedAddress.setFirstName(addressForm.getFirstName()); selectedAddress.setLastName(addressForm.getLastName()); selectedAddress.setLine1(addressForm.getLine1()); selectedAddress.setLine2(addressForm.getLine2()); selectedAddress.setTown(addressForm.getTownCity()); selectedAddress.setPostalCode(addressForm.getPostcode()); selectedAddress.setBillingAddress(false); selectedAddress.setShippingAddress(true); selectedAddress.setVisibleInAddressBook(true); final CountryData countryData = i18NFacade.getCountryForIsocode(addressForm.getCountryIso()); selectedAddress.setCountry(countryData); if (resolveCountryRegions.contains(countryData.getIsocode())) { if (addressForm.getRegionIso() != null && !StringUtils.isEmpty(addressForm.getRegionIso())) { final RegionData regionData = getI18NFacade().getRegion(addressForm.getCountryIso(), addressForm.getRegionIso()); selectedAddress.setRegion(regionData); } } if (resolveCountryRegions.contains(countryData.getIsocode())) { if (addressForm.getRegionIso() != null && !StringUtils.isEmpty(addressForm.getRegionIso())) { final RegionData regionData = getI18NFacade().getRegion(addressForm.getCountryIso(), addressForm.getRegionIso()); selectedAddress.setRegion(regionData); } } if (Boolean.TRUE.equals(addressForm.getEditAddress())) { selectedAddress.setDefaultAddress( Boolean.TRUE.equals(addressForm.getDefaultAddress()) || userFacade.getAddressBook().size() <= 1); userFacade.editAddress(selectedAddress); } else { selectedAddress.setDefaultAddress( Boolean.TRUE.equals(addressForm.getDefaultAddress()) || userFacade.isAddressBookEmpty()); userFacade.addAddress(selectedAddress); } GlobalMessages.addFlashMessage( redirectModel, GlobalMessages.CONF_MESSAGES_HOLDER, "account.confirmation.address.added"); return REDIRECT_TO_ADDRESS_BOOK_PAGE; }
public void restoreState(FacesContext context, UIOrderingList list, Object _state) { Object[] state = (Object[]) _state; value = restoreAttachedState(context, state[0]); selection = (Set) restoreAttachedState(context, state[1]); selectionSet = Boolean.TRUE.equals(state[2]); activeItem = restoreAttachedState(context, state[3]); activeItemSet = Boolean.TRUE.equals(state[4]); }
public Boolean a() { if (this.b == null) this.b = a(Boolean.class, IsNativeNewsFeedEnabled.class); if (!Boolean.TRUE.equals(this.b.b())) ; for (Boolean localBoolean = Boolean.valueOf(false); ; localBoolean = Boolean.valueOf( Boolean.TRUE.equals( Gatekeeper.a( FbandroidAppModule.a(this.a), "android_mustang_log_fetch_errors")))) return localBoolean; }
public static void invokeAndWaitInterruptedWhenClosing( final Project project, final Runnable runnable, final ModalityState modalityState) { final Ref<Boolean> start = new Ref<Boolean>(Boolean.TRUE); final Application application = ApplicationManager.getApplication(); LOG.assertTrue(!application.isDispatchThread()); final Semaphore semaphore = new Semaphore(); semaphore.down(); Runnable runnable1 = new Runnable() { public void run() { try { runnable.run(); } finally { semaphore.up(); } } @NonNls public String toString() { return "PeriodicalTaskCloser's invoke and wait [" + runnable.toString() + "]"; } }; LaterInvocator.invokeLater( runnable1, modalityState, new Condition<Object>() { public boolean value(Object o) { synchronized (start) { return !start.get(); } } }); while (true) { if (semaphore.waitFor(1000)) { return; } final Ref<Boolean> fire = new Ref<Boolean>(); synchronized (ourLock) { final Boolean state = myStates.get(project); if (!Boolean.TRUE.equals(state)) { fire.set(Boolean.TRUE); } if (Boolean.TRUE.equals(fire.get())) { synchronized (start) { start.set(Boolean.FALSE); return; } } } } }
/** * This methods updates the ADS properties (the ones that were read from the ADS) with the * contents of the server properties (the ones that were read directly from the server). */ public void updateAdsPropertiesWithServerProperties() { adsProperties.put(ADSContext.ServerProperty.HOST_NAME, getHostName()); ServerProperty[][] sProps = { {ServerProperty.LDAP_ENABLED, ServerProperty.LDAP_PORT}, {ServerProperty.LDAPS_ENABLED, ServerProperty.LDAPS_PORT}, {ServerProperty.ADMIN_ENABLED, ServerProperty.ADMIN_PORT}, {ServerProperty.JMX_ENABLED, ServerProperty.JMX_PORT}, {ServerProperty.JMXS_ENABLED, ServerProperty.JMXS_PORT} }; ADSContext.ServerProperty[][] adsProps = { {ADSContext.ServerProperty.LDAP_ENABLED, ADSContext.ServerProperty.LDAP_PORT}, {ADSContext.ServerProperty.LDAPS_ENABLED, ADSContext.ServerProperty.LDAPS_PORT}, {ADSContext.ServerProperty.ADMIN_ENABLED, ADSContext.ServerProperty.ADMIN_PORT}, {ADSContext.ServerProperty.JMX_ENABLED, ADSContext.ServerProperty.JMX_PORT}, {ADSContext.ServerProperty.JMXS_ENABLED, ADSContext.ServerProperty.JMXS_PORT} }; for (int i = 0; i < sProps.length; i++) { ArrayList<?> s = (ArrayList<?>) serverProperties.get(sProps[i][0]); ArrayList<?> p = (ArrayList<?>) serverProperties.get(sProps[i][1]); if (s != null) { int port = -1; for (int j = 0; j < s.size(); j++) { if (Boolean.TRUE.equals(s.get(j))) { port = (Integer) p.get(j); break; } } if (port == -1) { adsProperties.put(adsProps[i][0], "false"); if (p.size() > 0) { port = (Integer) p.iterator().next(); } } else { adsProperties.put(adsProps[i][0], "true"); } adsProperties.put(adsProps[i][1], String.valueOf(port)); } } ArrayList<?> array = (ArrayList<?>) serverProperties.get(ServerProperty.STARTTLS_ENABLED); boolean startTLSEnabled = false; if ((array != null) && !array.isEmpty()) { startTLSEnabled = Boolean.TRUE.equals(array.get(array.size() - 1)); } adsProperties.put( ADSContext.ServerProperty.STARTTLS_ENABLED, startTLSEnabled ? "true" : "false"); adsProperties.put(ADSContext.ServerProperty.ID, getHostPort(true)); adsProperties.put( ADSContext.ServerProperty.INSTANCE_PUBLIC_KEY_CERTIFICATE, getInstancePublicKeyCertificate()); }
protected void addCommon(final AbstractOrderModel source, final AbstractOrderData prototype) { prototype.setCode(source.getCode()); if (source.getSite() != null) { prototype.setSite(source.getSite().getUid()); } if (source.getStore() != null) { prototype.setStore(source.getStore().getUid()); } prototype.setTotalItems(calcTotalItems(source)); prototype.setNet(Boolean.TRUE.equals(source.getNet())); prototype.setGuid(source.getGuid()); prototype.setCalculated(Boolean.TRUE.equals(source.getCalculated())); }
protected static boolean isTextAntialiased( UIXRenderingContext context, UINode node, Style classStyle, Style inlineStyle) { if (inlineStyle != null) { Object value = inlineStyle.getParsedProperty(Style.TEXT_ANTIALIAS_KEY); return Boolean.TRUE.equals(value); } if (classStyle != null) { Object value = classStyle.getParsedProperty(Style.TEXT_ANTIALIAS_KEY); return Boolean.TRUE.equals(value); } return false; }
@Override public Command createCommand(String command) { if (command.startsWith("scp ")) { SCPAction action = parseScpCommand(command.substring(4)); if (action == null) return new FailCommand("Unrecognized command " + command); if (Boolean.TRUE.equals(action.isSource())) { return new SourceCommand(action); } else if (Boolean.TRUE.equals(action.isSink())) { return new SinkCommand(action); } } return new FailCommand("Cannot execute command " + command); }
FeatureId addFeature( SimpleFeature feature, FeatureWriter<SimpleFeatureType, SimpleFeature> writer) throws IOException { // grab next feature and populate it // JD: worth a note on how we do this... we take a "pull" approach // because the raw schema we are inserting into may not match the // schema of the features we are inserting SimpleFeature toWrite = writer.next(); for (int i = 0; i < toWrite.getType().getAttributeCount(); i++) { String name = toWrite.getType().getDescriptor(i).getLocalName(); toWrite.setAttribute(name, feature.getAttribute(name)); } // copy over the user data if (feature.getUserData().size() > 0) { toWrite.getUserData().putAll(feature.getUserData()); } // pass through the fid if the user asked so boolean useExisting = Boolean.TRUE.equals(feature.getUserData().get(Hints.USE_PROVIDED_FID)); if (getQueryCapabilities().isUseProvidedFIDSupported() && useExisting) { ((FeatureIdImpl) toWrite.getIdentifier()).setID(feature.getID()); } // perform the write writer.write(); // copy any metadata from the feature that was actually written feature.getUserData().putAll(toWrite.getUserData()); // add the id to the set of inserted FeatureId id = toWrite.getIdentifier(); return id; }
public Object convertValue(Map context, Object value, Class toType) { if (value == null) { return null; } else { return Boolean.TRUE.equals(value) ? 1 : 0; } }
@Override public void encodeGeometryColumn( GeometryDescriptor gatt, String prefix, int srid, Hints hints, StringBuffer sql) { boolean geography = "geography".equals(gatt.getUserData().get(JDBCDataStore.JDBC_NATIVE_TYPENAME)); if (geography) { sql.append("encode(ST_AsBinary("); encodeColumnName(prefix, gatt.getLocalName(), sql); sql.append("),'base64')"); } else { boolean force2D = hints != null && hints.containsKey(Hints.FEATURE_2D) && Boolean.TRUE.equals(hints.get(Hints.FEATURE_2D)); if (force2D) { sql.append("encode(ST_AsBinary(ST_Force_2D("); encodeColumnName(prefix, gatt.getLocalName(), sql); sql.append(")),'base64')"); } else { sql.append("encode(ST_AsEWKB("); encodeColumnName(prefix, gatt.getLocalName(), sql); sql.append("),'base64')"); } } }
@Override protected StorageItem doRetrieveItem(ResourceStoreRequest request) throws IllegalOperationException, ItemNotFoundException, StorageException { StorageItem result = super.doRetrieveItem(request); List<String> wf = getWelcomeFiles(); boolean useWelcomeFiles = !request.getRequestContext().containsKey(WebSiteRepository.USE_WELCOME_FILES_KEY) || Boolean.TRUE.equals( request.getRequestContext().get(WebSiteRepository.USE_WELCOME_FILES_KEY)); if (useWelcomeFiles && result instanceof StorageCollectionItem && wf.size() > 0) { // it is a collection, check for one of the "welcome" files Collection<StorageItem> collItems = list(false, (StorageCollectionItem) result); for (StorageItem item : collItems) { if (item instanceof StorageFileItem && wf.contains(item.getName())) { // it is a file, it's name is in welcomeFiles list, so return it instead parent collection return item; } } } return result; }
/** * Retrieves authentication data from an implementation-specific datasource (RDBMS, LDAP, etc) for * the given authentication token. * * @param token the authentication token containing the user's principal and credentials. * @return an AuthenticationInfo object containing account data resulting from the authentication * ONLY if the lookup is successful (i.e. account exists and is valid, etc.) * @throws AuthenticationException if there is an error acquiring data or performing * realm-specific authentication logic for the specified token */ protected AuthenticationInfo doGetAuthenticationInfo(AuthenticationToken token) throws AuthenticationException { String username = (String) token.getPrincipal(); AuthorizationUser user = _authorizationUserService.loadUserByUsername(username); if (Boolean.TRUE.equals(user.getLocked())) { throw new LockedAccountException(); // account locked } // call CredentialsMatcher to match password // if need, can do this yourself SimpleAuthenticationInfo info = new SimpleAuthenticationInfo( user.getUsername(), user.getPassword(), ByteSource.Util.bytes(user.getCredentialsSalt()), getName()); if (_logger.isDebugEnabled()) { _logger.debug("call doGetAuthenticationInfo.. salt=" + user.getCredentialsSalt()); } return info; }
@Override public void processUpdates(FacesContext context) { if (context == null) { throw new NullPointerException(); } // Skip processing if our rendered flag is false if (!isRendered()) { return; } processFacetsAndChildrenWithVariable(context, PhaseId.UPDATE_MODEL_VALUES); if (Boolean.TRUE.equals(getSubmitValue())) { try { updateModel(context); } catch (RuntimeException e) { context.renderResponse(); throw e; } } if (!isValid()) { context.renderResponse(); } }
@Override protected void deleteSelectedItems() { if (!isSelectAll) { Collection<SimpleRole> currentDataList = view.getPagedBeanTable().getCurrentDataList(); List<Role> keyList = new ArrayList<>(); for (SimpleRole item : currentDataList) { if (item.isSelected()) { if (Boolean.TRUE.equals(item.getIssystemrole())) { NotificationUtil.showErrorNotification( String.format( "Can not delete role %s because it is the system role.", item.getRolename())); } else { keyList.add(item); } } } if (keyList.size() > 0) { roleService.massRemoveWithSession( keyList, AppContext.getUsername(), AppContext.getAccountId()); doSearch(searchCriteria); } } else { roleService.removeByCriteria(searchCriteria, AppContext.getAccountId()); doSearch(searchCriteria); } }
@Override protected final String value() { if (Boolean.TRUE.equals(booleanValue())) { return "Y"; } return "N"; }
@Override @SuppressWarnings("unchecked") public <T> T prompt(final String message, final Class<T> clazz, final T defaultIfEmpty) { Object result; String input; do { String query = " [" + defaultIfEmpty + "] "; if (defaultIfEmpty instanceof Boolean) { if (Boolean.TRUE.equals(defaultIfEmpty)) query = " [Y/n] "; else { query = " [y/N] "; } } input = prompt(message + query); if ((input == null) || "".equals(input.trim())) { result = defaultIfEmpty; } else { input = input.trim(); try { result = DataConversion.convert(input, clazz); } catch (Exception e) { result = InvalidInput.INSTANCE; } } } while ((result instanceof InvalidInput)); return (T) result; }
public boolean[] getFillShapes() { final boolean[] retval = new boolean[fillShapes.size()]; for (int i = 0; i < retval.length; i++) { retval[i] = Boolean.TRUE.equals(fillShapes.get(i)); } return retval; }