idx int64 0 41.2k | question stringlengths 74 4.21k | target stringlengths 5 888 |
|---|---|---|
9,800 | public static void validate ( Declaration d ) throws IllegalArgumentException { Collection < AnnotationMirror > mirrors = d . getAnnotationMirrors ( ) ; for ( AnnotationMirror m : mirrors ) { AnnotationTypeDeclaration decl = m . getAnnotationType ( ) . getDeclaration ( ) ; if ( decl == null ) { continue ; } else if ( d... | This method ensures that any control property value assignment satisfies all property constraints . This method should be called from an annotation processor to ensure declarative control property assignment using annotations are validated at build time . This method is currently called from ControlAnnotationProcessor ... |
9,801 | public AptEventSet initSuperEventSet ( ) { AptControlInterface superControl = _controlIntf . getSuperClass ( ) ; if ( superControl == null ) return null ; HashSet < String > extendNames = new HashSet < String > ( ) ; for ( InterfaceType superType : _eventSet . getSuperinterfaces ( ) ) { InterfaceDeclaration superDecl =... | Checks to see if this EventSet extends an EventSet declared on a parent control interface . If found it will return the parent EventSet or return null if not found . |
9,802 | protected AptMethodSet < AptEvent > initEvents ( ) { AptMethodSet < AptEvent > events = new AptMethodSet < AptEvent > ( ) ; if ( _eventSet == null || _eventSet . getMethods ( ) == null ) return events ; ArrayList < InterfaceDeclaration > intfList = new ArrayList < InterfaceDeclaration > ( ) ; intfList . add ( _eventSet... | Initializes the list of Events associated with this EventSet |
9,803 | public int getEventCount ( ) { int count = _events . size ( ) ; if ( _superEventSet != null ) count += _superEventSet . getEventCount ( ) ; return count ; } | Returns the number of Events for this EventSet and any super event set |
9,804 | public String getDescriptorName ( ) { String name = getShortName ( ) ; return Character . toLowerCase ( name . charAt ( 0 ) ) + name . substring ( 1 ) ; } | Returns the programmatic descriptor name to be returned by the EventDescriptor for the event set . |
9,805 | public String getNotifierClass ( ) { StringBuffer sb = new StringBuffer ( getShortName ( ) ) ; sb . append ( "Notifier" ) ; sb . append ( getFormalTypeParameterNames ( ) ) ; return sb . toString ( ) ; } | Returns the name of the generated notifier class for this ControlEventSet |
9,806 | private AptMethodSet < AptOperation > initOperations ( ) { AptMethodSet < AptOperation > operList = new AptMethodSet < AptOperation > ( ) ; if ( _intfDecl == null ) return operList ; Vector < InterfaceDeclaration > checkIntfs = new Vector < InterfaceDeclaration > ( ) ; checkIntfs . add ( _intfDecl ) ; for ( int i = 0 ;... | Initializes the list of operations declared by this AptControlInterface |
9,807 | private ArrayList < AptPropertySet > initPropertySets ( ) { ArrayList < AptPropertySet > propSets = new ArrayList < AptPropertySet > ( ) ; if ( _intfDecl == null ) return propSets ; TypeDeclaration basePropsDecl = _ap . getAnnotationProcessorEnvironment ( ) . getTypeDeclaration ( "org.apache.beehive.controls.api.proper... | Initializes the list of PropertySets declared or referenced by this AptControlInterface |
9,808 | public int getPropertyCount ( ) { int count ; if ( _superClass == null ) count = 0 ; else count = _superClass . getPropertyCount ( ) ; for ( AptPropertySet propertySet : _propertySets ) { if ( propertySet . hasSetters ( ) || ! propertySet . isOptional ( ) ) { count += propertySet . getProperties ( ) . size ( ) ; } } co... | Returns the total number of properties for this control interface |
9,809 | private ArrayList < AptEventSet > initEventSets ( ) { ArrayList < AptEventSet > eventSets = new ArrayList < AptEventSet > ( ) ; if ( _intfDecl == null || _intfDecl . getNestedTypes ( ) == null ) return eventSets ; for ( TypeDeclaration innerDecl : _intfDecl . getNestedTypes ( ) ) { if ( ! ( innerDecl instanceof Interfa... | Initializes the list of EventSets declared by this AptControlInterface |
9,810 | public AptEventSet getEventSet ( String name ) { for ( AptEventSet eventSet : getEventSets ( ) ) if ( eventSet . getClassName ( ) . equals ( name ) ) return eventSet ; if ( _superClass != null ) return _superClass . getEventSet ( name ) ; return null ; } | Returns the AptEventSet with the specified name |
9,811 | public List < GeneratorOutput > getCheckOutput ( Filer filer ) throws IOException { HashMap < String , Object > map = new HashMap < String , Object > ( ) ; map . put ( "intf" , this ) ; map . put ( "bean" , _bean ) ; ArrayList < GeneratorOutput > genList = new ArrayList < GeneratorOutput > ( ) ; Writer beanWriter = new... | Returns the information necessary to generate a ControlBean from this AptControlInterface |
9,812 | public List < GeneratorOutput > getGenerateOutput ( Filer filer ) throws IOException { HashMap < String , Object > map = new HashMap < String , Object > ( ) ; map . put ( "intf" , this ) ; map . put ( "bean" , _bean ) ; ArrayList < GeneratorOutput > genList = new ArrayList < GeneratorOutput > ( ) ; Writer manifestWrite... | Returns the information necessary to generate a packaging information from this AptControlInterface . Since this information is not needed during type validation it can be delated until the generate phase . |
9,813 | public AptControlInterface getMostDerivedInterface ( ) { AptControlInterface ancestor = getSuperClass ( ) ; while ( ancestor != null ) { if ( ! ancestor . isExtension ( ) ) break ; ancestor = ancestor . getSuperClass ( ) ; } return ancestor ; } | Returns the most - derived interface in the inheritance chain that is annotated with |
9,814 | public ClassLoader getExternalClassLoader ( ) { Map < String , String > opts = _ap . getAnnotationProcessorEnvironment ( ) . getOptions ( ) ; String classpath = opts . get ( "-classpath" ) ; if ( classpath != null ) { String [ ] cpEntries = classpath . split ( File . pathSeparator ) ; ArrayList a = new ArrayList ( ) ; ... | Returns a classloader that can be used to load external classes |
9,815 | private boolean isValidManifestAttribute ( ManifestAttribute attr ) { String name = attr . name ( ) ; String value = attr . value ( ) ; boolean isValid = true ; if ( name == null || name . length ( ) == 0 ) { _ap . printError ( _intfDecl , "manifestattribute.illegal.name.1" ) ; isValid = false ; } else { if ( alphaNum ... | Validates a manifest attribute . If the attribute is invalid it will generate appropriate APT messager entries and return false else return true . |
9,816 | public HashMap < String , String > getManifestAttributes ( ) { HashMap < String , String > attributes = new HashMap < String , String > ( ) ; if ( _intfDecl == null ) return attributes ; try { ManifestAttributes annotAttrs = _intfDecl . getAnnotation ( ManifestAttributes . class ) ; if ( annotAttrs != null ) { Manifest... | Returns the array of ManifestAttributes associated with the AptControlInterface |
9,817 | private String getIntfPropertyName ( AptMethod method ) { String opName = method . getName ( ) ; int prefixIdx = 3 ; if ( opName . startsWith ( "is" ) ) prefixIdx = 2 ; if ( opName . length ( ) == prefixIdx + 1 ) return "" + Character . toLowerCase ( opName . charAt ( prefixIdx ) ) ; return Character . toLowerCase ( op... | Generate a property name from a method name . |
9,818 | protected int renderEndTag ( int state ) throws JspException { if ( _padText == null && bodyContent != null ) { _padText = bodyContent . getString ( ) ; } if ( hasErrors ( ) ) { reportErrors ( ) ; localRelease ( ) ; return EVAL_PAGE ; } PadContext pc = new PadContext ( _padText , ( _minRepeat != null ? _minRepeat . int... | Complete rendering the body of this tag . If the padText property was unset the body of the tag is used as the pad text . |
9,819 | public synchronized JSONArray loadPage ( int i ) { if ( pages == null || pages . get ( i ) == null ) { String url ; if ( path . contains ( "?" ) ) { url = path + "&" ; } else { url = path + "?" ; } JSONObject result = client . get ( url + "per_page=" + perPage + "&page=" + i ) ; if ( result != null && result . names ( ... | Requests i th page from UserVoice . Thread - safe and makes one HTTP connection . |
9,820 | public static String formatDuration ( long millis ) { StringBuilder sb = new StringBuilder ( ) ; if ( millis > DAY_MILLIS ) { sb . append ( millis / DAY_MILLIS ) ; sb . append ( " days, " ) ; millis %= DAY_MILLIS ; } if ( millis > HOUR_MILLIS ) { sb . append ( millis / HOUR_MILLIS ) ; sb . append ( " hours, " ) ; milli... | Formats a duration in milliseconds as a pretty - print string . |
9,821 | public List < XLog > parse ( InputStream is ) throws Exception { BufferedInputStream bis = new BufferedInputStream ( is ) ; MxmlHandler handler = new MxmlHandler ( ) ; SAXParserFactory parserFactory = SAXParserFactory . newInstance ( ) ; SAXParser parser = parserFactory . newSAXParser ( ) ; parser . parse ( bis , handl... | Parses a set of logs from the given input stream which is supposed to deliver an MXML serialization . |
9,822 | synchronized public void removeListener ( Object listener ) { if ( ! _listeners . contains ( listener ) ) throw new IllegalStateException ( "Invalid listener, not currently registered" ) ; _listeners . remove ( listener ) ; } | Remove an existing callback event listener for this EventNotifier |
9,823 | protected void firePropertyChange ( String name , Object oldValue , Object newValue ) { _propertyChangeSupport . firePropertyChange ( name , oldValue , newValue ) ; } | Fire a property change event . |
9,824 | SqlFragment [ ] getChildren ( ) { SqlFragment [ ] fragments = new SqlFragment [ _children . size ( ) ] ; return _children . toArray ( fragments ) ; } | Return the array of children . |
9,825 | String getPreparedStatementText ( ControlBeanContext context , Method m , Object [ ] args ) { StringBuilder sb = new StringBuilder ( ) ; for ( SqlFragment sf : _children ) { sb . append ( sf . getPreparedStatementText ( context , m , args ) ) ; } return sb . toString ( ) ; } | builds the text of the prepared statement |
9,826 | public int doEndTag ( ) throws JspException { ServletRequest req = pageContext . getRequest ( ) ; String scriptId = null ; if ( hasErrors ( ) ) return reportAndExit ( EVAL_PAGE ) ; String uri = null ; if ( _state . src != null ) { try { uri = PageFlowTagUtils . rewriteResourceURL ( pageContext , _state . src , _params ... | Render the end of the IMG tag . |
9,827 | private static void continueChainNoWrapper ( ServletRequest request , ServletResponse response , FilterChain chain ) throws IOException , ServletException { if ( request instanceof PageFlowRequestWrapper ) request = ( ( PageFlowRequestWrapper ) request ) . getHttpRequest ( ) ; chain . doFilter ( request , response ) ; ... | Internal method used to handle cases where the filter should continue without processing the request by rendering a page associated with a page flow . |
9,828 | public void setStyle ( String style ) { if ( "" . equals ( style ) ) return ; AbstractHtmlState tsh = getState ( ) ; tsh . style = style ; } | Sets the style of the rendered html tag . |
9,829 | public void setStyleClass ( String styleClass ) { if ( "" . equals ( styleClass ) ) return ; AbstractHtmlState tsh = getState ( ) ; tsh . styleClass = styleClass ; } | Sets the style class of the rendered html tag . |
9,830 | public void setTitle ( String title ) { AbstractHtmlState tsh = getState ( ) ; tsh . registerAttribute ( AbstractHtmlState . ATTR_GENERAL , TITLE , title ) ; } | Sets the value of the title attribute . |
9,831 | public void setLang ( String lang ) { AbstractHtmlState tsh = getState ( ) ; tsh . registerAttribute ( AbstractHtmlState . ATTR_GENERAL , LANG , lang ) ; } | Sets the lang attribute for the HTML element . |
9,832 | public void setDir ( String dir ) { AbstractHtmlState tsh = getState ( ) ; tsh . registerAttribute ( AbstractHtmlState . ATTR_GENERAL , DIR , dir ) ; } | Sets the dir attribute for the HTML element . |
9,833 | public String getOnClick ( ) { AbstractHtmlState tsh = getState ( ) ; return tsh . getAttribute ( AbstractHtmlState . ATTR_JAVASCRIPT , ONCLICK ) ; } | Gets the onClick javascript event . |
9,834 | public void setOnDblClick ( String ondblclick ) { AbstractHtmlState tsh = getState ( ) ; tsh . registerAttribute ( AbstractHtmlState . ATTR_JAVASCRIPT , ONDBLCLICK , ondblclick ) ; } | Sets the onDblClick javascript event . |
9,835 | public void setOnKeyDown ( String onkeydown ) { AbstractHtmlState tsh = getState ( ) ; tsh . registerAttribute ( AbstractHtmlState . ATTR_JAVASCRIPT , ONKEYDOWN , onkeydown ) ; } | Sets the onKeyDown javascript event . |
9,836 | public void setOnKeyPress ( String onkeypress ) { AbstractHtmlState tsh = getState ( ) ; tsh . registerAttribute ( AbstractHtmlState . ATTR_JAVASCRIPT , ONKEYPRESS , onkeypress ) ; } | Sets the onKeyPress javascript event . |
9,837 | public void setOnKeyUp ( String onkeyup ) { AbstractHtmlState tsh = getState ( ) ; tsh . registerAttribute ( AbstractHtmlState . ATTR_JAVASCRIPT , ONKEYUP , onkeyup ) ; } | Sets the onKeyUp javascript event . |
9,838 | public void setOnMouseDown ( String onmousedown ) { AbstractHtmlState tsh = getState ( ) ; tsh . registerAttribute ( AbstractHtmlState . ATTR_JAVASCRIPT , ONMOUSEDOWN , onmousedown ) ; } | Sets the onMouseDown javascript event . |
9,839 | public void setOnMouseMove ( String onmousemove ) { AbstractHtmlState tsh = getState ( ) ; tsh . registerAttribute ( AbstractHtmlState . ATTR_JAVASCRIPT , ONMOUSEMOVE , onmousemove ) ; } | Sets the onMouseMove javascript event . |
9,840 | public void setOnMouseOut ( String onmouseout ) { AbstractHtmlState tsh = getState ( ) ; tsh . registerAttribute ( AbstractHtmlState . ATTR_JAVASCRIPT , ONMOUSEOUT , onmouseout ) ; } | Sets the onMouseOut javascript event . |
9,841 | public void setOnMouseOver ( String onmouseover ) { AbstractHtmlState tsh = getState ( ) ; tsh . registerAttribute ( AbstractHtmlState . ATTR_JAVASCRIPT , ONMOUSEOVER , onmouseover ) ; } | Sets the onMouseOver javascript event . |
9,842 | public void setOnMouseUp ( String onmouseup ) { AbstractHtmlState tsh = getState ( ) ; tsh . registerAttribute ( AbstractHtmlState . ATTR_JAVASCRIPT , ONMOUSEUP , onmouseup ) ; } | Sets the onMouseUp javascript event . |
9,843 | protected void setStateAttribute ( String name , String value , AbstractHtmlState tsh ) throws JspException { boolean error = false ; if ( name == null || name . length ( ) <= 0 ) { String s = Bundle . getString ( "Tags_AttributeNameNotSet" ) ; registerTagError ( s , null ) ; error = true ; } if ( name != null && ( nam... | Attribute implementation . |
9,844 | public static Logger getInstance ( Class loggerClient ) { return new Logger ( org . apache . commons . logging . LogFactory . getLog ( loggerClient . getName ( ) ) ) ; } | Factory method for creating NetUI Logger instances . |
9,845 | public void addCommand ( Command command ) { if ( command == null ) throw new IllegalArgumentException ( ) ; if ( _frozen ) throw new IllegalStateException ( ) ; Command [ ] results = new Command [ _commands . length + 1 ] ; System . arraycopy ( _commands , 0 , results , 0 , _commands . length ) ; results [ _commands .... | Add a command to the chian . |
9,846 | public final String rewriteName ( String name , Tag currentTag ) throws ExpressionEvaluationException { if ( _logger . isDebugEnabled ( ) ) _logger . debug ( "rewrite expression \"" + name + "\"" ) ; IDataAccessProvider dap = getCurrentProvider ( currentTag ) ; if ( dap == null ) return name ; Expression parsed = getEx... | Rewrite an expression into a fully - qualified reference to a specific JavaBean property on an object . |
9,847 | private final String rewriteNameInternal ( IDataAccessProvider dap ) throws ExpressionEvaluationException { if ( _logger . isDebugEnabled ( ) ) _logger . debug ( "assign index to name: " + dap . getDataSource ( ) ) ; Expression parsedDataSource = getExpressionEvaluator ( ) . parseExpression ( dap . getDataSource ( ) ) ... | Rewrite a parent IDataAccessProvider s dataSource to be fully qualified . |
9,848 | public Object invoke ( FacesContext context , Object params [ ] ) throws EvaluationException , MethodNotFoundException { Object result = _delegate . invoke ( context , params ) ; if ( result instanceof String ) { String action = ( String ) result ; ExternalContext externalContext = context . getExternalContext ( ) ; Ob... | Before returning the result from the base MethodBinding see if the bound method is annotated with Jpf . CommandHandler . If it is look through the raiseActions annotation array for a form bean member variable associated with the action being raised . If one is found set it in the request so it gets passed to the action... |
9,849 | public void emit ( Filer f , String pkg , File mf , String csn ) throws IOException { PrintWriter pw = f . createTextFile ( Filer . Location . CLASS_TREE , pkg , mf , csn ) ; pw . println ( "# Apache Beehive Controls client manifest (auto-generated, do not edit!)" ) ; Set props = _properties . keySet ( ) ; for ( Object... | Emits the manifest via an apt Filer implementation |
9,850 | protected AptControlInterface initControlInterface ( ) { TypeMirror controlType = _fieldDecl . getType ( ) ; if ( ! ( controlType instanceof DeclaredType ) ) { _ap . printError ( _fieldDecl , "control.field.bad.type" ) ; return null ; } TypeDeclaration typeDecl = ( ( DeclaredType ) controlType ) . getDeclaration ( ) ; ... | Initializes the ControlInterface associated with this ControlField |
9,851 | public static void processTreeRequest ( String treeId , TreeElement treeRoot , HttpServletRequest request , HttpServletResponse response ) { assert ( treeId != null ) : "parameter treeId must not be null." ; assert ( treeRoot != null ) : "parameter treeRoot must not be null." ; assert ( request != null ) : "paramater r... | If this tree was selected or expanded this will handle that processing . |
9,852 | protected static void setSelected ( TreeElement node , String selected , ServletRequest request ) { assert ( node != null ) : "parameter 'node' must not be null" ; assert ( selected != null ) : "parameter 'selected' must not be null" ; assert ( request != null ) : "parameter 'requested' must not be null" ; if ( node . ... | Recursive routine to set the selected node . This will set the selected node and clear the selection on all other nodes . It will walk the full tree . |
9,853 | public static TreeElement findSelected ( TreeElement root ) { assert ( root != null ) : "parameter 'root' must not be null" ; if ( root instanceof ITreeRootElement ) { return ( ( ITreeRootElement ) root ) . getSelectedNode ( ) ; } return recursiveFindSelected ( root ) ; } | This will return the currently selected node from a tree . |
9,854 | private static TreeElement recursiveFindSelected ( TreeElement elem ) { assert ( elem != null ) ; if ( elem . isSelected ( ) ) return elem ; TreeElement children [ ] = elem . getChildren ( ) ; assert ( children != null ) ; for ( int i = 0 ; i < children . length ; i ++ ) { TreeElement e = recursiveFindSelected ( childr... | Recursive method that will find the currently selected element in the tree . |
9,855 | public String getEventDescriptor ( Class controlInterface ) { if ( _descriptor == null ) _descriptor = computeEventDescriptor ( _method ) ; return _descriptor ; } | Returns the event descriptor string associated with the EventRef . |
9,856 | private String computeEventDescriptor ( Method method ) { StringBuilder sb = new StringBuilder ( ) ; sb . append ( method . getDeclaringClass ( ) . getName ( ) ) ; sb . append ( "." ) ; sb . append ( method . getName ( ) ) ; Class [ ] parms = method . getParameterTypes ( ) ; sb . append ( "(" ) ; for ( int i = 0 ; i < ... | Helper method that computes the event descriptor sting for a method |
9,857 | private void appendTypeDescriptor ( StringBuilder sb , Class clazz ) { if ( clazz . isPrimitive ( ) ) sb . append ( _primToType . get ( clazz ) ) ; else if ( clazz . isArray ( ) ) sb . append ( clazz . getName ( ) . replace ( '.' , '/' ) ) ; else { sb . append ( "L" ) ; sb . append ( clazz . getName ( ) . replace ( '.'... | Helper method that appends a type descriptor to a StringBuilder . Used while accumulating an event descriptor string . |
9,858 | public Method getEventMethod ( Class controlInterface ) { if ( _method != null && _method . getDeclaringClass ( ) . getClassLoader ( ) . equals ( controlInterface . getClassLoader ( ) ) ) return _method ; String eventDescriptor = getEventDescriptor ( controlInterface ) ; HashMap < String , Method > descriptorMap = getD... | Returns the event Method associated with this EventRef . |
9,859 | protected void scanDir ( File srcDir , File destDir , String [ ] files , String ext ) { if ( ! _hasSourcepath ) { Path srcPath = new Path ( getProject ( ) ) ; srcPath . setLocation ( srcDir ) ; setSourcepath ( srcPath ) ; } GlobPatternMapper m = new GlobPatternMapper ( ) ; m . setFrom ( ext ) ; m . setTo ( "*.class" ) ... | Override the implementation of scanDir to look for additional files based upon any specified source extensions |
9,860 | public static void loadImplicitObjects ( HttpServletRequest request , HttpServletResponse response , ServletContext servletContext , PageFlowController currentPageFlow ) { loadPageFlow ( request , currentPageFlow ) ; BundleMap bundleMap = new BundleMap ( request , servletContext ) ; loadBundleMap ( request , bundleMap ... | Load the NetUI framework s implicit objects into the request . |
9,861 | public static void loadPageFlow ( ServletRequest request , PageFlowController pageFlow ) { if ( pageFlow != null ) request . setAttribute ( PAGE_FLOW_IMPLICIT_OBJECT_KEY , pageFlow ) ; Map map = InternalUtils . getPageInputMap ( request ) ; request . setAttribute ( PAGE_INPUT_IMPLICIT_OBJECT_KEY , map != null ? map : C... | Load Page Flow related implicit objects into the request . This method will set the Page Flow itself and any available page inputs into the request . |
9,862 | public static void loadFacesBackingBean ( ServletRequest request , FacesBackingBean facesBackingBean ) { if ( facesBackingBean != null ) request . setAttribute ( BACKING_IMPLICIT_OBJECT_KEY , facesBackingBean ) ; } | Load the JSF backing bean into the request . |
9,863 | public static void loadSharedFlow ( ServletRequest request , Map sharedFlows ) { if ( sharedFlows != null ) request . setAttribute ( SHARED_FLOW_IMPLICIT_OBJECT_KEY , sharedFlows ) ; } | Load the shared flow into the request . |
9,864 | public static void loadGlobalApp ( ServletRequest request , GlobalApp globalApp ) { if ( globalApp != null ) request . setAttribute ( GLOBAL_APP_IMPLICIT_OBJECT_KEY , globalApp ) ; } | Load the global app into the request |
9,865 | public static void loadOutputFormBean ( ServletRequest request , Object bean ) { if ( bean != null ) request . setAttribute ( OUTPUT_FORM_BEAN_OBJECT_KEY , bean ) ; } | Load the output form bean into the request . |
9,866 | protected boolean isSetterMethod ( Method method ) { Matcher matcher = _setterRegex . matcher ( method . getName ( ) ) ; if ( matcher . matches ( ) ) { if ( Modifier . isStatic ( method . getModifiers ( ) ) ) return false ; if ( ! Modifier . isPublic ( method . getModifiers ( ) ) ) return false ; if ( ! Void . TYPE . e... | Determine if the given method is a java bean setter method . |
9,867 | public static Method lookupMethod ( Class parentClass , String methodName , Class [ ] signature ) { try { return parentClass . getDeclaredMethod ( methodName , signature ) ; } catch ( NoSuchMethodException e ) { Class superClass = parentClass . getSuperclass ( ) ; return superClass != null ? lookupMethod ( superClass ,... | Get a Method in a Class . |
9,868 | public static Field lookupField ( Class parentClass , String fieldName ) { try { return parentClass . getDeclaredField ( fieldName ) ; } catch ( NoSuchFieldException e ) { Class superClass = parentClass . getSuperclass ( ) ; return superClass != null ? lookupField ( superClass , fieldName ) : null ; } } | Get a Field in a Class . |
9,869 | public static boolean isLongLived ( ModuleConfig moduleConfig ) { ControllerConfig cc = moduleConfig . getControllerConfig ( ) ; if ( cc instanceof PageFlowControllerConfig ) { return ( ( PageFlowControllerConfig ) cc ) . isLongLivedPageFlow ( ) ; } else { return false ; } } | Tell whether the given module is a long - lived page flow . |
9,870 | public static boolean isNestable ( ModuleConfig moduleConfig ) { ControllerConfig cc = moduleConfig . getControllerConfig ( ) ; return cc instanceof PageFlowControllerConfig && ( ( PageFlowControllerConfig ) cc ) . isNestedPageFlow ( ) ; } | Tell whether the given module is a nested page flow . |
9,871 | public static ModuleConfig getModuleConfig ( String modulePath , ServletContext context ) { return ( ModuleConfig ) context . getAttribute ( Globals . MODULE_KEY + modulePath ) ; } | Get the Struts ModuleConfig for the given module path . |
9,872 | public static ModuleConfig ensureModuleConfig ( String modulePath , ServletContext context ) { try { ModuleConfig ret = getModuleConfig ( modulePath , context ) ; if ( ret != null ) { return ret ; } else { ActionServlet as = getActionServlet ( context ) ; if ( as instanceof AutoRegisterActionServlet ) { return ( ( Auto... | Get the Struts ModuleConfig for the given module path . If there is none registered and if it is possible to register one automatically do so . |
9,873 | public static void initDelegatingConfigs ( ModuleConfig moduleConfig , ServletContext servletContext ) { ActionConfig [ ] actionConfigs = moduleConfig . findActionConfigs ( ) ; for ( int i = 0 ; i < actionConfigs . length ; i ++ ) { ActionConfig actionConfig = actionConfigs [ i ] ; if ( actionConfig instanceof Delegati... | Initialize delegating action configs and exception configs for a Struts module that should delegate to one generated from a superclass . |
9,874 | public static ActionServlet getActionServlet ( ServletContext context ) { if ( context == null ) return null ; return ( ActionServlet ) context . getAttribute ( Globals . ACTION_SERVLET_KEY ) ; } | Get the current ActionServlet . |
9,875 | public static void addBindingUpdateError ( ServletRequest request , String expression , String message , Throwable cause ) { Map errors = ( Map ) request . getAttribute ( BINDING_UPDATE_ERRORS_ATTR ) ; if ( errors == null ) { errors = new LinkedHashMap ( ) ; request . setAttribute ( BINDING_UPDATE_ERRORS_ATTR , errors ... | Add a BindingUpdateError to the request . |
9,876 | public static ActionConfig findActionConfig ( String actionConfigPath , String modulePath , ServletContext context ) { ModuleConfig moduleConfig = getModuleConfig ( modulePath , context ) ; assert moduleConfig != null ; return moduleConfig . findActionConfig ( actionConfigPath ) ; } | Get the Struts ActionConfig for the given action config path and module path . |
9,877 | public static String getActionMappingPath ( ServletRequest request ) { ActionMapping actionMapping = ( ActionMapping ) request . getAttribute ( Globals . MAPPING_KEY ) ; return actionMapping != null ? actionMapping . getPath ( ) : null ; } | Get the Struts ActionMapping path from the ActionMapping that is in the request under the key Globals . MAPPING_KEY . |
9,878 | public static String getModulePathFromReqAttr ( HttpServletRequest request ) { ModuleConfig config = ( ModuleConfig ) request . getAttribute ( Globals . MODULE_KEY ) ; return config != null ? config . getPrefix ( ) : PageFlowUtils . getModulePath ( request ) ; } | Gets the Struts module path from the input request . If a ModuleConfig object has been populated into the request it is used to get the module prefix otherwise getModulePath is called which derives the module path from the request URI . |
9,879 | public static ModuleConfig selectModule ( String prefix , HttpServletRequest request , ServletContext servletContext ) { ModuleConfig moduleConfig = getModuleConfig ( prefix , servletContext ) ; if ( moduleConfig == null ) { request . removeAttribute ( Globals . MODULE_KEY ) ; return null ; } ControllerConfig cc = modu... | Set the given Struts module in the request and expose its set of MessageResources as request attributes . |
9,880 | public static String getQualifiedBundleName ( String bundleName , ServletRequest request ) { if ( bundleName != null ) { if ( bundleName . indexOf ( '/' ) == - 1 ) { ModuleConfig mc = ( ModuleConfig ) request . getAttribute ( Globals . MODULE_KEY ) ; if ( mc != null && mc . getPrefix ( ) != null && mc . getPrefix ( ) .... | Qualify the given bundle name with the current module path to return a full bundle name . |
9,881 | public String getType ( ) { if ( _fieldDecl == null || _fieldDecl . getType ( ) == null ) return "" ; return _fieldDecl . getType ( ) . toString ( ) ; } | Returns the type of the field |
9,882 | public String getClassName ( ) { if ( _fieldDecl == null || _fieldDecl . getType ( ) == null ) return "" ; String typeName = _fieldDecl . getType ( ) . toString ( ) ; int formalIndex = typeName . indexOf ( '<' ) ; if ( formalIndex > 0 ) return typeName . substring ( 0 , formalIndex ) ; return typeName ; } | Returns the class name of the field ( does not include any formal type parameters |
9,883 | public String getAccessModifier ( ) { if ( _fieldDecl == null ) return "" ; Collection < Modifier > modifiers = _fieldDecl . getModifiers ( ) ; if ( modifiers . contains ( Modifier . PRIVATE ) ) return "private" ; if ( modifiers . contains ( Modifier . PROTECTED ) ) return "protected" ; if ( modifiers . contains ( Modi... | Returns the access modifier associated with the field |
9,884 | public String rewriteName ( String name , Tag currentTag ) throws ExpressionEvaluationException { ExpressionEvaluator eval = ExpressionEvaluatorFactory . getInstance ( ) ; try { if ( ! eval . isExpression ( name ) ) return eval . qualify ( "actionForm" , name ) ; return name ; } catch ( Exception e ) { if ( logger . is... | Qualify the name of a NetUI JSP tag into the actionForm data binding context . This feature is used to convert non - expression tag names as those used in Struts into actionForm expressions that NetUI consumes . |
9,885 | public static RibbonColumn getRibbonColumn ( String key , List < ClientToolInfo > tools , List < Parameter > parameters , MapWidget mapWidget ) { RibbonColumnCreator ribbonColumnCreator = REGISTRY . get ( key ) ; if ( ribbonColumnCreator == null ) { Log . logWarn ( "Could not find RibbonColumn with ID: " + key ) ; retu... | Get the ribbon column which matches the given key . |
9,886 | public boolean isClosed ( ) { if ( isEmpty ( ) ) { return false ; } if ( getNumPoints ( ) == 1 ) { return false ; } Coordinate [ ] coordinates = getCoordinates ( ) ; return coordinates [ 0 ] . equals ( coordinates [ coordinates . length - 1 ] ) ; } | Checks to see if the last coordinate equals the first . Should always be the case! |
9,887 | public boolean isValid ( ) { if ( isEmpty ( ) ) { return true ; } if ( ! isClosed ( ) ) { return false ; } Coordinate [ ] coordinates = getCoordinates ( ) ; if ( coordinates . length < 4 ) { return false ; } for ( int i = 0 ; i < coordinates . length - 1 ; i ++ ) { for ( int j = 0 ; j < coordinates . length - 1 ; j ++ ... | An empty LinearRing is valid . Furthermore this object must be closed and must not self - intersect . |
9,888 | public double distance ( Vector2D vector2d ) { double a = vector2d . x - x ; double b = vector2d . y - y ; return Math . sqrt ( a * a + b * b ) ; } | Calculate the distance between 2 vector by using Pythagoras formula . |
9,889 | public static String asMapLength ( MapWidget map , double length ) { double unitLength = map . getUnitLength ( ) ; double distance = length * unitLength ; String unit = "m" ; if ( map . getMapModel ( ) . getMapInfo ( ) . getDisplayUnitType ( ) == UnitType . METRIC ) { if ( distance > 10000 ) { distance /= METERS_IN_KM ... | Distance formatting method . Requires a length as parameter expressed in the CRS units of the given map . |
9,890 | public static String asMapArea ( MapWidget map , double area ) { double unitLength = map . getUnitLength ( ) ; double distance = area * unitLength * unitLength ; String unit = "m" ; if ( map . getMapModel ( ) . getMapInfo ( ) . getDisplayUnitType ( ) == UnitType . METRIC ) { if ( distance > ( METERS_IN_KM * METERS_IN_K... | Area formatting method . Requires an area as parameter expressed in the CRS units of the given map . |
9,891 | public void setMap ( Map map ) { this . map = ( MapImpl ) map ; mapWidget = this . map . getMapWidget ( ) ; delegate = new GeometryEditorImpl ( mapWidget ) ; editingService = new JsGeometryEditService ( delegate . getEditService ( ) ) ; splitService = new JsGeometrySplitService ( delegate . getEditService ( ) ) ; merge... | Set the map . |
9,892 | public void addLayerSnappingRules ( String layerId ) { Layer < ? > layer = mapWidget . getMapModel ( ) . getLayer ( layerId ) ; if ( layer != null && layer instanceof VectorLayer ) { VectorLayer vLayer = ( VectorLayer ) layer ; for ( SnappingRuleInfo snappingRuleInfo : vLayer . getLayerInfo ( ) . getSnappingRules ( ) )... | Add the list of snapping rules as they are configured for a specific layer within the XML configuration . |
9,893 | public static void keepWindowInScreen ( Window window ) { window . setKeepInParentRect ( true ) ; if ( null != window . getHeightAsString ( ) ) { int screenHeight = com . google . gwt . user . client . Window . getClientHeight ( ) ; int windowHeight = window . getViewportHeight ( ) ; window . setMaxHeight ( screenHeigh... | Try to force a window to stay within the screen bounds . |
9,894 | public Geometry execute ( Geometry geometry ) { if ( geometry instanceof Polygon ) { Polygon polygon = ( Polygon ) geometry ; if ( polygon . getNumInteriorRing ( ) == 0 ) { return null ; } if ( ringIndex < 0 ) { ringIndex = 0 ; } else if ( ringIndex >= polygon . getNumInteriorRing ( ) ) { ringIndex = polygon . getNumIn... | Execute the operation! When the geometry is not a Polygon null is returned . When the polygon does not have any interior rings null is returned . |
9,895 | public void onFolderClick ( FolderClickEvent event ) { try { if ( isIconTargetClicked ( ) ) { onIconClick ( event . getFolder ( ) ) ; } else { if ( event . getFolder ( ) instanceof LayerTreeTreeNode ) { mapModel . selectLayer ( ( ( LayerTreeTreeNode ) event . getFolder ( ) ) . getLayer ( ) ) ; } else { mapModel . selec... | When the user clicks on a folder nothing gets selected . |
9,896 | public void onLeafClick ( LeafClickEvent event ) { try { if ( isIconTargetClicked ( ) ) { onIconClick ( event . getLeaf ( ) ) ; } else { LayerTreeTreeNode layerTreeNode = ( LayerTreeTreeNode ) event . getLeaf ( ) ; mapModel . selectLayer ( layerTreeNode . getLayer ( ) ) ; } } catch ( Exception e ) { Log . logError ( e ... | When the user clicks on a leaf the headertext of the treetable is changed to the selected leaf and the toolbar buttons are updated to represent the correct state of the buttons . |
9,897 | private boolean isIconTargetClicked ( ) { String targetHtml = EventHandler . getNativeMouseTarget ( ) . getString ( ) ; if ( targetHtml . indexOf ( ICON_EXTENSION ) != - 1 ) { return true ; } return false ; } | Method that checks if the target html tag of mouse event contains given icon extension . Should be backwards compatible with smartgwt 3 . 1 where the source html tag is IMG . !Will probably not work on touch devices . |
9,898 | protected void buildTree ( ) { treeGrid . setWidth100 ( ) ; treeGrid . setHeight100 ( ) ; treeGrid . setShowHeader ( false ) ; treeGrid . setOverflow ( Overflow . AUTO ) ; tree = new RefreshableTree ( ) ; final TreeNode nodeRoot = new TreeNode ( "ROOT" ) ; tree . setRoot ( nodeRoot ) ; ClientLayerTreeInfo layerTreeInfo... | Builds up the tree showing the layers . |
9,899 | public String getAlgorithm ( ) { if ( cipher == null ) { return null ; } String transformation = cipher . getAlgorithm ( ) ; if ( transformation == null ) { return null ; } int pos = transformation . indexOf ( '/' ) ; if ( pos < 0 ) { return transformation ; } return transformation . substring ( 0 , pos ) ; } | Get the cipher algorithm name . |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.