id
int32
0
165k
repo
stringlengths
7
58
path
stringlengths
12
218
func_name
stringlengths
3
140
original_string
stringlengths
73
34.1k
language
stringclasses
1 value
code
stringlengths
73
34.1k
code_tokens
list
docstring
stringlengths
3
16k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
105
339
11,900
lievendoclo/Valkyrie-RCP
valkyrie-rcp-core/src/main/java/org/valkyriercp/application/splash/SimpleSplashScreen.java
SimpleSplashScreen.loadImage
private Image loadImage(Resource path) throws IOException { URL url = path.getURL(); if (url == null) { logger.warn("Unable to locate splash screen in classpath at: " + path); return null; } return Toolkit.getDefaultToolkit().createImage(url); }
java
private Image loadImage(Resource path) throws IOException { URL url = path.getURL(); if (url == null) { logger.warn("Unable to locate splash screen in classpath at: " + path); return null; } return Toolkit.getDefaultToolkit().createImage(url); }
[ "private", "Image", "loadImage", "(", "Resource", "path", ")", "throws", "IOException", "{", "URL", "url", "=", "path", ".", "getURL", "(", ")", ";", "if", "(", "url", "==", "null", ")", "{", "logger", ".", "warn", "(", "\"Unable to locate splash screen in classpath at: \"", "+", "path", ")", ";", "return", "null", ";", "}", "return", "Toolkit", ".", "getDefaultToolkit", "(", ")", ".", "createImage", "(", "url", ")", ";", "}" ]
Load image from path. @param path Path to image. @return Image @throws java.io.IOException @throws NullPointerException if {@code path} is null.
[ "Load", "image", "from", "path", "." ]
6aad6e640b348cda8f3b0841f6e42025233f1eb8
https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/application/splash/SimpleSplashScreen.java#L99-L106
11,901
lievendoclo/Valkyrie-RCP
valkyrie-rcp-core/src/main/java/org/valkyriercp/application/splash/SimpleSplashScreen.java
SimpleSplashScreen.createContentPane
protected Component createContentPane() { Image image = getImage(); if (image != null) { return new ImageCanvas(image); } return null; }
java
protected Component createContentPane() { Image image = getImage(); if (image != null) { return new ImageCanvas(image); } return null; }
[ "protected", "Component", "createContentPane", "(", ")", "{", "Image", "image", "=", "getImage", "(", ")", ";", "if", "(", "image", "!=", "null", ")", "{", "return", "new", "ImageCanvas", "(", "image", ")", ";", "}", "return", "null", ";", "}" ]
Returns a component that displays an image in a canvas.
[ "Returns", "a", "component", "that", "displays", "an", "image", "in", "a", "canvas", "." ]
6aad6e640b348cda8f3b0841f6e42025233f1eb8
https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/application/splash/SimpleSplashScreen.java#L168-L174
11,902
lievendoclo/Valkyrie-RCP
valkyrie-rcp-integrations/valkyrie-rcp-jidedocking/src/main/java/org/valkyriercp/application/docking/LayoutManager.java
LayoutManager.loadPageLayoutData
public static boolean loadPageLayoutData(DockingManager manager, String pageId, Perspective perspective){ manager.beginLoadLayoutData(); try{ if(isValidLayout(manager, pageId, perspective)){ String pageLayout = MessageFormat.format(PAGE_LAYOUT, pageId, perspective.getId()); manager.loadLayoutDataFrom(pageLayout); return true; } else{ manager.loadLayoutData(); return false; } } catch(Exception e){ manager.loadLayoutData(); return false; } }
java
public static boolean loadPageLayoutData(DockingManager manager, String pageId, Perspective perspective){ manager.beginLoadLayoutData(); try{ if(isValidLayout(manager, pageId, perspective)){ String pageLayout = MessageFormat.format(PAGE_LAYOUT, pageId, perspective.getId()); manager.loadLayoutDataFrom(pageLayout); return true; } else{ manager.loadLayoutData(); return false; } } catch(Exception e){ manager.loadLayoutData(); return false; } }
[ "public", "static", "boolean", "loadPageLayoutData", "(", "DockingManager", "manager", ",", "String", "pageId", ",", "Perspective", "perspective", ")", "{", "manager", ".", "beginLoadLayoutData", "(", ")", ";", "try", "{", "if", "(", "isValidLayout", "(", "manager", ",", "pageId", ",", "perspective", ")", ")", "{", "String", "pageLayout", "=", "MessageFormat", ".", "format", "(", "PAGE_LAYOUT", ",", "pageId", ",", "perspective", ".", "getId", "(", ")", ")", ";", "manager", ".", "loadLayoutDataFrom", "(", "pageLayout", ")", ";", "return", "true", ";", "}", "else", "{", "manager", ".", "loadLayoutData", "(", ")", ";", "return", "false", ";", "}", "}", "catch", "(", "Exception", "e", ")", "{", "manager", ".", "loadLayoutData", "(", ")", ";", "return", "false", ";", "}", "}" ]
Loads a the previously saved layout for the current page. If no previously persisted layout exists for the given page the built in default layout is used. @param manager The docking manager to use @param pageId The page to get the layout for @return a boolean saying if the layout requested was previously saved
[ "Loads", "a", "the", "previously", "saved", "layout", "for", "the", "current", "page", ".", "If", "no", "previously", "persisted", "layout", "exists", "for", "the", "given", "page", "the", "built", "in", "default", "layout", "is", "used", "." ]
6aad6e640b348cda8f3b0841f6e42025233f1eb8
https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-integrations/valkyrie-rcp-jidedocking/src/main/java/org/valkyriercp/application/docking/LayoutManager.java#L51-L68
11,903
lievendoclo/Valkyrie-RCP
valkyrie-rcp-integrations/valkyrie-rcp-jidedocking/src/main/java/org/valkyriercp/application/docking/LayoutManager.java
LayoutManager.savePageLayoutData
public static void savePageLayoutData(DockingManager manager, String pageId, String perspectiveId){ manager.saveLayoutDataAs(MessageFormat.format(PAGE_LAYOUT, pageId, perspectiveId)); }
java
public static void savePageLayoutData(DockingManager manager, String pageId, String perspectiveId){ manager.saveLayoutDataAs(MessageFormat.format(PAGE_LAYOUT, pageId, perspectiveId)); }
[ "public", "static", "void", "savePageLayoutData", "(", "DockingManager", "manager", ",", "String", "pageId", ",", "String", "perspectiveId", ")", "{", "manager", ".", "saveLayoutDataAs", "(", "MessageFormat", ".", "format", "(", "PAGE_LAYOUT", ",", "pageId", ",", "perspectiveId", ")", ")", ";", "}" ]
Saves the current page layout. @param manager The current docking manager @param pageId The page to saved the layout for
[ "Saves", "the", "current", "page", "layout", "." ]
6aad6e640b348cda8f3b0841f6e42025233f1eb8
https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-integrations/valkyrie-rcp-jidedocking/src/main/java/org/valkyriercp/application/docking/LayoutManager.java#L76-L79
11,904
lievendoclo/Valkyrie-RCP
valkyrie-rcp-core/src/main/java/org/valkyriercp/command/support/ShowViewCommand.java
ShowViewCommand.setViewDescriptor
public final void setViewDescriptor(ViewDescriptor viewDescriptor) { Assert.notNull(viewDescriptor, "viewDescriptor"); setId(viewDescriptor.getId()); setLabel(viewDescriptor.getShowViewCommandLabel()); setIcon(viewDescriptor.getIcon()); setCaption(viewDescriptor.getCaption()); this.viewDescriptor = viewDescriptor; }
java
public final void setViewDescriptor(ViewDescriptor viewDescriptor) { Assert.notNull(viewDescriptor, "viewDescriptor"); setId(viewDescriptor.getId()); setLabel(viewDescriptor.getShowViewCommandLabel()); setIcon(viewDescriptor.getIcon()); setCaption(viewDescriptor.getCaption()); this.viewDescriptor = viewDescriptor; }
[ "public", "final", "void", "setViewDescriptor", "(", "ViewDescriptor", "viewDescriptor", ")", "{", "Assert", ".", "notNull", "(", "viewDescriptor", ",", "\"viewDescriptor\"", ")", ";", "setId", "(", "viewDescriptor", ".", "getId", "(", ")", ")", ";", "setLabel", "(", "viewDescriptor", ".", "getShowViewCommandLabel", "(", ")", ")", ";", "setIcon", "(", "viewDescriptor", ".", "getIcon", "(", ")", ")", ";", "setCaption", "(", "viewDescriptor", ".", "getCaption", "(", ")", ")", ";", "this", ".", "viewDescriptor", "=", "viewDescriptor", ";", "}" ]
Sets the descriptor for the view that is to be opened by this command object. This command object will be assigned the id, label, icon, and caption from the given view descriptor. @param viewDescriptor The view descriptor, cannot be null. @throws IllegalArgumentException if {@code viewDescriptor} is null.
[ "Sets", "the", "descriptor", "for", "the", "view", "that", "is", "to", "be", "opened", "by", "this", "command", "object", ".", "This", "command", "object", "will", "be", "assigned", "the", "id", "label", "icon", "and", "caption", "from", "the", "given", "view", "descriptor", "." ]
6aad6e640b348cda8f3b0841f6e42025233f1eb8
https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/command/support/ShowViewCommand.java#L91-L98
11,905
lievendoclo/Valkyrie-RCP
valkyrie-rcp-integrations/valkyrie-rcp-jidedocking/src/main/java/org/valkyriercp/application/perspective/PerspectiveManager.java
PerspectiveManager.getCurrentPerspective
public Perspective getCurrentPerspective(){ String key = MessageFormat.format(CURRENT_PERSPECTIVE_KEY, new Object[]{pageName}); String id = prefs.get(key, DEFAULT_PERSPECTIVE_KEY); Iterator it = perspectives.iterator(); while(it.hasNext()){ Perspective perspective = (Perspective)it.next(); if(id.equals(perspective.getId())){ return perspective; } } return NullPerspective.NULL_PERSPECTIVE; }
java
public Perspective getCurrentPerspective(){ String key = MessageFormat.format(CURRENT_PERSPECTIVE_KEY, new Object[]{pageName}); String id = prefs.get(key, DEFAULT_PERSPECTIVE_KEY); Iterator it = perspectives.iterator(); while(it.hasNext()){ Perspective perspective = (Perspective)it.next(); if(id.equals(perspective.getId())){ return perspective; } } return NullPerspective.NULL_PERSPECTIVE; }
[ "public", "Perspective", "getCurrentPerspective", "(", ")", "{", "String", "key", "=", "MessageFormat", ".", "format", "(", "CURRENT_PERSPECTIVE_KEY", ",", "new", "Object", "[", "]", "{", "pageName", "}", ")", ";", "String", "id", "=", "prefs", ".", "get", "(", "key", ",", "DEFAULT_PERSPECTIVE_KEY", ")", ";", "Iterator", "it", "=", "perspectives", ".", "iterator", "(", ")", ";", "while", "(", "it", ".", "hasNext", "(", ")", ")", "{", "Perspective", "perspective", "=", "(", "Perspective", ")", "it", ".", "next", "(", ")", ";", "if", "(", "id", ".", "equals", "(", "perspective", ".", "getId", "(", ")", ")", ")", "{", "return", "perspective", ";", "}", "}", "return", "NullPerspective", ".", "NULL_PERSPECTIVE", ";", "}" ]
Returns the current perspective, or the NullPerspective instance if no current perspective is defined.
[ "Returns", "the", "current", "perspective", "or", "the", "NullPerspective", "instance", "if", "no", "current", "perspective", "is", "defined", "." ]
6aad6e640b348cda8f3b0841f6e42025233f1eb8
https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-integrations/valkyrie-rcp-jidedocking/src/main/java/org/valkyriercp/application/perspective/PerspectiveManager.java#L66-L77
11,906
lievendoclo/Valkyrie-RCP
valkyrie-rcp-core/src/main/java/org/valkyriercp/application/support/DefaultStatusBar.java
DefaultStatusBar.setMessage
public void setMessage(String message) { this.message = message; if (errorMessage == null) { logger.debug("Setting status bar message to \"" + message + "\""); messageLabel.setText(this.message); } }
java
public void setMessage(String message) { this.message = message; if (errorMessage == null) { logger.debug("Setting status bar message to \"" + message + "\""); messageLabel.setText(this.message); } }
[ "public", "void", "setMessage", "(", "String", "message", ")", "{", "this", ".", "message", "=", "message", ";", "if", "(", "errorMessage", "==", "null", ")", "{", "logger", ".", "debug", "(", "\"Setting status bar message to \\\"\"", "+", "message", "+", "\"\\\"\"", ")", ";", "messageLabel", ".", "setText", "(", "this", ".", "message", ")", ";", "}", "}" ]
Sets the message text to be displayed on the status bar. @param message the message to be set, if <code>null</code>, the status line is cleared.
[ "Sets", "the", "message", "text", "to", "be", "displayed", "on", "the", "status", "bar", "." ]
6aad6e640b348cda8f3b0841f6e42025233f1eb8
https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/application/support/DefaultStatusBar.java#L91-L97
11,907
lievendoclo/Valkyrie-RCP
valkyrie-rcp-core/src/main/java/org/valkyriercp/security/support/AbstractSecurityController.java
AbstractSecurityController.registerPostProcessorAction
protected void registerPostProcessorAction(String actionId) { if( postProcessorActionIds.contains( actionId ) ) { throw new IllegalArgumentException( "Post-processor Action '" + actionId + "' is already registered" ); } postProcessorActionIds.add( actionId ); }
java
protected void registerPostProcessorAction(String actionId) { if( postProcessorActionIds.contains( actionId ) ) { throw new IllegalArgumentException( "Post-processor Action '" + actionId + "' is already registered" ); } postProcessorActionIds.add( actionId ); }
[ "protected", "void", "registerPostProcessorAction", "(", "String", "actionId", ")", "{", "if", "(", "postProcessorActionIds", ".", "contains", "(", "actionId", ")", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"Post-processor Action '\"", "+", "actionId", "+", "\"' is already registered\"", ")", ";", "}", "postProcessorActionIds", ".", "add", "(", "actionId", ")", ";", "}" ]
Register a post-processor action. The action id specified must not conflict with any other action registered. Subclasses that provide additional post-processor actions MUST call this method to register them. @param actionId Id of post-processor action to register
[ "Register", "a", "post", "-", "processor", "action", ".", "The", "action", "id", "specified", "must", "not", "conflict", "with", "any", "other", "action", "registered", ".", "Subclasses", "that", "provide", "additional", "post", "-", "processor", "actions", "MUST", "call", "this", "method", "to", "register", "them", "." ]
6aad6e640b348cda8f3b0841f6e42025233f1eb8
https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/security/support/AbstractSecurityController.java#L132-L137
11,908
lievendoclo/Valkyrie-RCP
valkyrie-rcp-core/src/main/java/org/valkyriercp/security/support/AbstractSecurityController.java
AbstractSecurityController.updateControlledObject
protected void updateControlledObject(Authorizable controlledObject, boolean authorized) { if( logger.isDebugEnabled() ) { logger.debug( "setAuthorized( " + authorized + ") on: " + controlledObject ); } controlledObject.setAuthorized( authorized ); runPostProcessorActions( controlledObject, authorized ); }
java
protected void updateControlledObject(Authorizable controlledObject, boolean authorized) { if( logger.isDebugEnabled() ) { logger.debug( "setAuthorized( " + authorized + ") on: " + controlledObject ); } controlledObject.setAuthorized( authorized ); runPostProcessorActions( controlledObject, authorized ); }
[ "protected", "void", "updateControlledObject", "(", "Authorizable", "controlledObject", ",", "boolean", "authorized", ")", "{", "if", "(", "logger", ".", "isDebugEnabled", "(", ")", ")", "{", "logger", ".", "debug", "(", "\"setAuthorized( \"", "+", "authorized", "+", "\") on: \"", "+", "controlledObject", ")", ";", "}", "controlledObject", ".", "setAuthorized", "(", "authorized", ")", ";", "runPostProcessorActions", "(", "controlledObject", ",", "authorized", ")", ";", "}" ]
Update a controlled object based on the given authorization state. @param controlledObject Object being controlled @param authorized state that has been installed on controlledObject
[ "Update", "a", "controlled", "object", "based", "on", "the", "given", "authorization", "state", "." ]
6aad6e640b348cda8f3b0841f6e42025233f1eb8
https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/security/support/AbstractSecurityController.java#L174-L180
11,909
lievendoclo/Valkyrie-RCP
valkyrie-rcp-core/src/main/java/org/valkyriercp/security/support/AbstractSecurityController.java
AbstractSecurityController.runPostProcessorActions
protected void runPostProcessorActions(Object controlledObject, boolean authorized) { String actions = getPostProcessorActionsToRun(); if( logger.isDebugEnabled() ) { logger.debug( "Run post-processors actions: " + actions ); } String[] actionIds = StringUtils.commaDelimitedListToStringArray(actions); for( int i = 0; i < actionIds.length; i++ ) { doPostProcessorAction( actionIds[i], controlledObject, authorized ); } }
java
protected void runPostProcessorActions(Object controlledObject, boolean authorized) { String actions = getPostProcessorActionsToRun(); if( logger.isDebugEnabled() ) { logger.debug( "Run post-processors actions: " + actions ); } String[] actionIds = StringUtils.commaDelimitedListToStringArray(actions); for( int i = 0; i < actionIds.length; i++ ) { doPostProcessorAction( actionIds[i], controlledObject, authorized ); } }
[ "protected", "void", "runPostProcessorActions", "(", "Object", "controlledObject", ",", "boolean", "authorized", ")", "{", "String", "actions", "=", "getPostProcessorActionsToRun", "(", ")", ";", "if", "(", "logger", ".", "isDebugEnabled", "(", ")", ")", "{", "logger", ".", "debug", "(", "\"Run post-processors actions: \"", "+", "actions", ")", ";", "}", "String", "[", "]", "actionIds", "=", "StringUtils", ".", "commaDelimitedListToStringArray", "(", "actions", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "actionIds", ".", "length", ";", "i", "++", ")", "{", "doPostProcessorAction", "(", "actionIds", "[", "i", "]", ",", "controlledObject", ",", "authorized", ")", ";", "}", "}" ]
Run all the requested post-processor actions. @param controlledObject Object being controlled @param authorized state that has been installed on controlledObject
[ "Run", "all", "the", "requested", "post", "-", "processor", "actions", "." ]
6aad6e640b348cda8f3b0841f6e42025233f1eb8
https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/security/support/AbstractSecurityController.java#L187-L197
11,910
lievendoclo/Valkyrie-RCP
valkyrie-rcp-core/src/main/java/org/valkyriercp/security/support/AbstractSecurityController.java
AbstractSecurityController.doPostProcessorAction
protected void doPostProcessorAction(String actionId, Object controlledObject, boolean authorized) { if( VISIBLE_TRACKS_AUTHORIZED_ACTION.equals( actionId ) ) { setVisibilityOnControlledObject( controlledObject, authorized ); } }
java
protected void doPostProcessorAction(String actionId, Object controlledObject, boolean authorized) { if( VISIBLE_TRACKS_AUTHORIZED_ACTION.equals( actionId ) ) { setVisibilityOnControlledObject( controlledObject, authorized ); } }
[ "protected", "void", "doPostProcessorAction", "(", "String", "actionId", ",", "Object", "controlledObject", ",", "boolean", "authorized", ")", "{", "if", "(", "VISIBLE_TRACKS_AUTHORIZED_ACTION", ".", "equals", "(", "actionId", ")", ")", "{", "setVisibilityOnControlledObject", "(", "controlledObject", ",", "authorized", ")", ";", "}", "}" ]
Post-process a controlled object after its authorization state has been updated. Subclasses that override this method MUST ensure that this method is called id they do not process the given action id. @param actionId Id of the post-processor action to run @param controlledObject Object being controlled @param authorized state that has been installed on controlledObject
[ "Post", "-", "process", "a", "controlled", "object", "after", "its", "authorization", "state", "has", "been", "updated", ".", "Subclasses", "that", "override", "this", "method", "MUST", "ensure", "that", "this", "method", "is", "called", "id", "they", "do", "not", "process", "the", "given", "action", "id", "." ]
6aad6e640b348cda8f3b0841f6e42025233f1eb8
https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/security/support/AbstractSecurityController.java#L208-L212
11,911
lievendoclo/Valkyrie-RCP
valkyrie-rcp-core/src/main/java/org/valkyriercp/security/support/AbstractSecurityController.java
AbstractSecurityController.setVisibilityOnControlledObject
private void setVisibilityOnControlledObject(Object controlledObject, boolean authorized) { try { Method method = controlledObject.getClass().getMethod( "setVisible", new Class[] { boolean.class } ); method.invoke( controlledObject, new Object[] { new Boolean( authorized ) } ); } catch( NoSuchMethodException ignored ) { System.out.println( "NO setVisible method on object: " + controlledObject ); // No method to call, so nothing to do } catch( IllegalAccessException ignored ) { logger.error( "Could not call setVisible", ignored ); } catch( InvocationTargetException ignored ) { logger.error( "Could not call setVisible", ignored ); } }
java
private void setVisibilityOnControlledObject(Object controlledObject, boolean authorized) { try { Method method = controlledObject.getClass().getMethod( "setVisible", new Class[] { boolean.class } ); method.invoke( controlledObject, new Object[] { new Boolean( authorized ) } ); } catch( NoSuchMethodException ignored ) { System.out.println( "NO setVisible method on object: " + controlledObject ); // No method to call, so nothing to do } catch( IllegalAccessException ignored ) { logger.error( "Could not call setVisible", ignored ); } catch( InvocationTargetException ignored ) { logger.error( "Could not call setVisible", ignored ); } }
[ "private", "void", "setVisibilityOnControlledObject", "(", "Object", "controlledObject", ",", "boolean", "authorized", ")", "{", "try", "{", "Method", "method", "=", "controlledObject", ".", "getClass", "(", ")", ".", "getMethod", "(", "\"setVisible\"", ",", "new", "Class", "[", "]", "{", "boolean", ".", "class", "}", ")", ";", "method", ".", "invoke", "(", "controlledObject", ",", "new", "Object", "[", "]", "{", "new", "Boolean", "(", "authorized", ")", "}", ")", ";", "}", "catch", "(", "NoSuchMethodException", "ignored", ")", "{", "System", ".", "out", ".", "println", "(", "\"NO setVisible method on object: \"", "+", "controlledObject", ")", ";", "// No method to call, so nothing to do", "}", "catch", "(", "IllegalAccessException", "ignored", ")", "{", "logger", ".", "error", "(", "\"Could not call setVisible\"", ",", "ignored", ")", ";", "}", "catch", "(", "InvocationTargetException", "ignored", ")", "{", "logger", ".", "error", "(", "\"Could not call setVisible\"", ",", "ignored", ")", ";", "}", "}" ]
Set the visible property on a controlled action according to the provided authorization.
[ "Set", "the", "visible", "property", "on", "a", "controlled", "action", "according", "to", "the", "provided", "authorization", "." ]
6aad6e640b348cda8f3b0841f6e42025233f1eb8
https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/security/support/AbstractSecurityController.java#L218-L230
11,912
lievendoclo/Valkyrie-RCP
valkyrie-rcp-core/src/main/java/org/valkyriercp/security/support/AbstractSecurityController.java
AbstractSecurityController.removeControlledObject
public Object removeControlledObject(Authorizable object) { Object removed = null; for( Iterator iter = controlledObjects.iterator(); iter.hasNext(); ) { WeakReference ref = (WeakReference) iter.next(); Authorizable controlledObject = (Authorizable) ref.get(); if( controlledObject == null ) { // Has been GCed, remove from our list iter.remove(); } else if( controlledObject.equals( object ) ) { removed = controlledObject; iter.remove(); } } return removed; }
java
public Object removeControlledObject(Authorizable object) { Object removed = null; for( Iterator iter = controlledObjects.iterator(); iter.hasNext(); ) { WeakReference ref = (WeakReference) iter.next(); Authorizable controlledObject = (Authorizable) ref.get(); if( controlledObject == null ) { // Has been GCed, remove from our list iter.remove(); } else if( controlledObject.equals( object ) ) { removed = controlledObject; iter.remove(); } } return removed; }
[ "public", "Object", "removeControlledObject", "(", "Authorizable", "object", ")", "{", "Object", "removed", "=", "null", ";", "for", "(", "Iterator", "iter", "=", "controlledObjects", ".", "iterator", "(", ")", ";", "iter", ".", "hasNext", "(", ")", ";", ")", "{", "WeakReference", "ref", "=", "(", "WeakReference", ")", "iter", ".", "next", "(", ")", ";", "Authorizable", "controlledObject", "=", "(", "Authorizable", ")", "ref", ".", "get", "(", ")", ";", "if", "(", "controlledObject", "==", "null", ")", "{", "// Has been GCed, remove from our list", "iter", ".", "remove", "(", ")", ";", "}", "else", "if", "(", "controlledObject", ".", "equals", "(", "object", ")", ")", "{", "removed", "=", "controlledObject", ";", "iter", ".", "remove", "(", ")", ";", "}", "}", "return", "removed", ";", "}" ]
Remove an object from our controlled set. @param object to remove @return object removed or null if not found
[ "Remove", "an", "object", "from", "our", "controlled", "set", "." ]
6aad6e640b348cda8f3b0841f6e42025233f1eb8
https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/security/support/AbstractSecurityController.java#L317-L333
11,913
lievendoclo/Valkyrie-RCP
valkyrie-rcp-core/src/main/java/org/valkyriercp/security/support/AbstractSecurityController.java
AbstractSecurityController.afterPropertiesSet
public void afterPropertiesSet() throws Exception { // Ensure that all post-processors requested are registered String[] actions = StringUtils.commaDelimitedListToStringArray( getPostProcessorActionsToRun() ); for( int i = 0; i < actions.length; i++ ) { if( !postProcessorActionIds.contains( actions[i] ) ) { throw new IllegalArgumentException( "Requested post-processor action '" + actions[i] + "' is not registered." ); } } }
java
public void afterPropertiesSet() throws Exception { // Ensure that all post-processors requested are registered String[] actions = StringUtils.commaDelimitedListToStringArray( getPostProcessorActionsToRun() ); for( int i = 0; i < actions.length; i++ ) { if( !postProcessorActionIds.contains( actions[i] ) ) { throw new IllegalArgumentException( "Requested post-processor action '" + actions[i] + "' is not registered." ); } } }
[ "public", "void", "afterPropertiesSet", "(", ")", "throws", "Exception", "{", "// Ensure that all post-processors requested are registered", "String", "[", "]", "actions", "=", "StringUtils", ".", "commaDelimitedListToStringArray", "(", "getPostProcessorActionsToRun", "(", ")", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "actions", ".", "length", ";", "i", "++", ")", "{", "if", "(", "!", "postProcessorActionIds", ".", "contains", "(", "actions", "[", "i", "]", ")", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"Requested post-processor action '\"", "+", "actions", "[", "i", "]", "+", "\"' is not registered.\"", ")", ";", "}", "}", "}" ]
Validate our configuration. @throws Exception
[ "Validate", "our", "configuration", "." ]
6aad6e640b348cda8f3b0841f6e42025233f1eb8
https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/security/support/AbstractSecurityController.java#L347-L356
11,914
lievendoclo/Valkyrie-RCP
valkyrie-rcp-integrations/valkyrie-rcp-jidedocking/src/main/java/org/valkyriercp/application/docking/JideApplicationWindow.java
JideApplicationWindow.setActivePage
protected void setActivePage(ApplicationPage page) { getPage().getControl(); loadLayoutData(page.getId()); ((JideApplicationPage)getPage()).updateShowViewCommands(); }
java
protected void setActivePage(ApplicationPage page) { getPage().getControl(); loadLayoutData(page.getId()); ((JideApplicationPage)getPage()).updateShowViewCommands(); }
[ "protected", "void", "setActivePage", "(", "ApplicationPage", "page", ")", "{", "getPage", "(", ")", ".", "getControl", "(", ")", ";", "loadLayoutData", "(", "page", ".", "getId", "(", ")", ")", ";", "(", "(", "JideApplicationPage", ")", "getPage", "(", ")", ")", ".", "updateShowViewCommands", "(", ")", ";", "}" ]
Sets the active page by loading that page's components and applying the layout. Also updates the show view command menu to list the views within the page.
[ "Sets", "the", "active", "page", "by", "loading", "that", "page", "s", "components", "and", "applying", "the", "layout", ".", "Also", "updates", "the", "show", "view", "command", "menu", "to", "list", "the", "views", "within", "the", "page", "." ]
6aad6e640b348cda8f3b0841f6e42025233f1eb8
https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-integrations/valkyrie-rcp-jidedocking/src/main/java/org/valkyriercp/application/docking/JideApplicationWindow.java#L116-L120
11,915
lievendoclo/Valkyrie-RCP
valkyrie-rcp-core/src/main/java/org/valkyriercp/widget/TitledWidgetForm.java
TitledWidgetForm.setForm
public void setForm(AbstractForm form) { this.form = form; if(getId() == null) { setId(form.getId()); } }
java
public void setForm(AbstractForm form) { this.form = form; if(getId() == null) { setId(form.getId()); } }
[ "public", "void", "setForm", "(", "AbstractForm", "form", ")", "{", "this", ".", "form", "=", "form", ";", "if", "(", "getId", "(", ")", "==", "null", ")", "{", "setId", "(", "form", ".", "getId", "(", ")", ")", ";", "}", "}" ]
Set the inner form that needs decorating.
[ "Set", "the", "inner", "form", "that", "needs", "decorating", "." ]
6aad6e640b348cda8f3b0841f6e42025233f1eb8
https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/widget/TitledWidgetForm.java#L45-L51
11,916
lievendoclo/Valkyrie-RCP
valkyrie-rcp-core/src/main/java/org/valkyriercp/form/binding/swing/ShuttleListBinding.java
ShuttleListBinding.indicesOf
protected int[] indicesOf(final Object itemSet) { int[] ret = null; if (itemSet instanceof Collection) { Collection collection = (Collection) itemSet; ret = new int[collection.size()]; int i = 0; for (Iterator iter = collection.iterator(); iter.hasNext(); i++) { ret[i] = indexOf(iter.next()); } } else if (itemSet == null) { ret = new int[0]; } else if (itemSet.getClass().isArray()) { Object[] items = (Object[]) itemSet; ret = new int[items.length]; for (int i = 0; i < items.length; i++) { ret[i] = indexOf(items[i]); } } else { throw new IllegalArgumentException("itemSet must be eithe an Array or a Collection"); } return ret; }
java
protected int[] indicesOf(final Object itemSet) { int[] ret = null; if (itemSet instanceof Collection) { Collection collection = (Collection) itemSet; ret = new int[collection.size()]; int i = 0; for (Iterator iter = collection.iterator(); iter.hasNext(); i++) { ret[i] = indexOf(iter.next()); } } else if (itemSet == null) { ret = new int[0]; } else if (itemSet.getClass().isArray()) { Object[] items = (Object[]) itemSet; ret = new int[items.length]; for (int i = 0; i < items.length; i++) { ret[i] = indexOf(items[i]); } } else { throw new IllegalArgumentException("itemSet must be eithe an Array or a Collection"); } return ret; }
[ "protected", "int", "[", "]", "indicesOf", "(", "final", "Object", "itemSet", ")", "{", "int", "[", "]", "ret", "=", "null", ";", "if", "(", "itemSet", "instanceof", "Collection", ")", "{", "Collection", "collection", "=", "(", "Collection", ")", "itemSet", ";", "ret", "=", "new", "int", "[", "collection", ".", "size", "(", ")", "]", ";", "int", "i", "=", "0", ";", "for", "(", "Iterator", "iter", "=", "collection", ".", "iterator", "(", ")", ";", "iter", ".", "hasNext", "(", ")", ";", "i", "++", ")", "{", "ret", "[", "i", "]", "=", "indexOf", "(", "iter", ".", "next", "(", ")", ")", ";", "}", "}", "else", "if", "(", "itemSet", "==", "null", ")", "{", "ret", "=", "new", "int", "[", "0", "]", ";", "}", "else", "if", "(", "itemSet", ".", "getClass", "(", ")", ".", "isArray", "(", ")", ")", "{", "Object", "[", "]", "items", "=", "(", "Object", "[", "]", ")", "itemSet", ";", "ret", "=", "new", "int", "[", "items", ".", "length", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "items", ".", "length", ";", "i", "++", ")", "{", "ret", "[", "i", "]", "=", "indexOf", "(", "items", "[", "i", "]", ")", ";", "}", "}", "else", "{", "throw", "new", "IllegalArgumentException", "(", "\"itemSet must be eithe an Array or a Collection\"", ")", ";", "}", "return", "ret", ";", "}" ]
Return an array of indices in the selectableItems for each element in the provided set. The set can be either a Collection or an Array. @param itemSet Either an array or a Collection of items @return array of indices of the elements in itemSet within the selectableItems
[ "Return", "an", "array", "of", "indices", "in", "the", "selectableItems", "for", "each", "element", "in", "the", "provided", "set", ".", "The", "set", "can", "be", "either", "a", "Collection", "or", "an", "Array", "." ]
6aad6e640b348cda8f3b0841f6e42025233f1eb8
https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/form/binding/swing/ShuttleListBinding.java#L232-L258
11,917
lievendoclo/Valkyrie-RCP
valkyrie-rcp-core/src/main/java/org/valkyriercp/form/binding/swing/ShuttleListBinding.java
ShuttleListBinding.arraysEqual
protected boolean arraysEqual(Object[] a1, Object[] a2) { if (a1 != null && a2 != null && a1.length == a2.length) { // Loop over each element and compare them using our comparator for (int i = 0; i < a1.length; i++) { if (!equalByComparator(a1[i], a2[i])) { return false; } } return true; } else if (a1 == null && a2 == null) { return true; } return false; }
java
protected boolean arraysEqual(Object[] a1, Object[] a2) { if (a1 != null && a2 != null && a1.length == a2.length) { // Loop over each element and compare them using our comparator for (int i = 0; i < a1.length; i++) { if (!equalByComparator(a1[i], a2[i])) { return false; } } return true; } else if (a1 == null && a2 == null) { return true; } return false; }
[ "protected", "boolean", "arraysEqual", "(", "Object", "[", "]", "a1", ",", "Object", "[", "]", "a2", ")", "{", "if", "(", "a1", "!=", "null", "&&", "a2", "!=", "null", "&&", "a1", ".", "length", "==", "a2", ".", "length", ")", "{", "// Loop over each element and compare them using our comparator", "for", "(", "int", "i", "=", "0", ";", "i", "<", "a1", ".", "length", ";", "i", "++", ")", "{", "if", "(", "!", "equalByComparator", "(", "a1", "[", "i", "]", ",", "a2", "[", "i", "]", ")", ")", "{", "return", "false", ";", "}", "}", "return", "true", ";", "}", "else", "if", "(", "a1", "==", "null", "&&", "a2", "==", "null", ")", "{", "return", "true", ";", "}", "return", "false", ";", "}" ]
Compare two arrays for equality using the configured comparator. @param a1 First array to compare @param a2 Second array to compare @return boolean true if they are equal
[ "Compare", "two", "arrays", "for", "equality", "using", "the", "configured", "comparator", "." ]
6aad6e640b348cda8f3b0841f6e42025233f1eb8
https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/form/binding/swing/ShuttleListBinding.java#L351-L365
11,918
lievendoclo/Valkyrie-RCP
valkyrie-rcp-core/src/main/java/org/valkyriercp/form/binding/swing/ShuttleListBinding.java
ShuttleListBinding.collectionsEqual
protected boolean collectionsEqual(Collection a1, Collection a2) { if (a1 != null && a2 != null && a1.size() == a2.size()) { // Loop over each element and compare them using our comparator Iterator iterA1 = a1.iterator(); Iterator iterA2 = a2.iterator(); while (iterA1.hasNext()) { if (!equalByComparator(iterA1.next(), iterA2.next())) { return false; } } } else if (a1 == null && a2 == null) { return true; } return false; }
java
protected boolean collectionsEqual(Collection a1, Collection a2) { if (a1 != null && a2 != null && a1.size() == a2.size()) { // Loop over each element and compare them using our comparator Iterator iterA1 = a1.iterator(); Iterator iterA2 = a2.iterator(); while (iterA1.hasNext()) { if (!equalByComparator(iterA1.next(), iterA2.next())) { return false; } } } else if (a1 == null && a2 == null) { return true; } return false; }
[ "protected", "boolean", "collectionsEqual", "(", "Collection", "a1", ",", "Collection", "a2", ")", "{", "if", "(", "a1", "!=", "null", "&&", "a2", "!=", "null", "&&", "a1", ".", "size", "(", ")", "==", "a2", ".", "size", "(", ")", ")", "{", "// Loop over each element and compare them using our comparator", "Iterator", "iterA1", "=", "a1", ".", "iterator", "(", ")", ";", "Iterator", "iterA2", "=", "a2", ".", "iterator", "(", ")", ";", "while", "(", "iterA1", ".", "hasNext", "(", ")", ")", "{", "if", "(", "!", "equalByComparator", "(", "iterA1", ".", "next", "(", ")", ",", "iterA2", ".", "next", "(", ")", ")", ")", "{", "return", "false", ";", "}", "}", "}", "else", "if", "(", "a1", "==", "null", "&&", "a2", "==", "null", ")", "{", "return", "true", ";", "}", "return", "false", ";", "}" ]
Compare two collections for equality using the configured comparator. Element order must be the same for the collections to compare equal. @param a1 First collection to compare @param a2 Second collection to compare @return boolean true if they are equal
[ "Compare", "two", "collections", "for", "equality", "using", "the", "configured", "comparator", ".", "Element", "order", "must", "be", "the", "same", "for", "the", "collections", "to", "compare", "equal", "." ]
6aad6e640b348cda8f3b0841f6e42025233f1eb8
https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/form/binding/swing/ShuttleListBinding.java#L375-L390
11,919
lievendoclo/Valkyrie-RCP
valkyrie-rcp-core/src/main/java/org/valkyriercp/form/FormGuard.java
FormGuard.addGuarded
public void addGuarded(Guarded newGuarded, int mask) { this.guardedEntries.put(newGuarded, new Integer(mask)); newGuarded.setEnabled(stateMatchesMask(getFormModelState(), mask)); }
java
public void addGuarded(Guarded newGuarded, int mask) { this.guardedEntries.put(newGuarded, new Integer(mask)); newGuarded.setEnabled(stateMatchesMask(getFormModelState(), mask)); }
[ "public", "void", "addGuarded", "(", "Guarded", "newGuarded", ",", "int", "mask", ")", "{", "this", ".", "guardedEntries", ".", "put", "(", "newGuarded", ",", "new", "Integer", "(", "mask", ")", ")", ";", "newGuarded", ".", "setEnabled", "(", "stateMatchesMask", "(", "getFormModelState", "(", ")", ",", "mask", ")", ")", ";", "}" ]
Adds a guarded object to be guarded by this FormGuard @param newGuarded object to be guarded @param mask indicating which state of the formModel should enable the guarded obhject
[ "Adds", "a", "guarded", "object", "to", "be", "guarded", "by", "this", "FormGuard" ]
6aad6e640b348cda8f3b0841f6e42025233f1eb8
https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/form/FormGuard.java#L163-L166
11,920
lievendoclo/Valkyrie-RCP
valkyrie-rcp-core/src/main/java/org/valkyriercp/form/FormGuard.java
FormGuard.removeGuarded
public boolean removeGuarded(Guarded toRemove) { Object mask = this.guardedEntries.remove(toRemove); return mask != null; }
java
public boolean removeGuarded(Guarded toRemove) { Object mask = this.guardedEntries.remove(toRemove); return mask != null; }
[ "public", "boolean", "removeGuarded", "(", "Guarded", "toRemove", ")", "{", "Object", "mask", "=", "this", ".", "guardedEntries", ".", "remove", "(", "toRemove", ")", ";", "return", "mask", "!=", "null", ";", "}" ]
Removes the guarded object from the management of this FormGuard. @param toRemove object that no longer should be managed @return <code>false</code> if the object toRemove was not present in the list of managed guarded objects.
[ "Removes", "the", "guarded", "object", "from", "the", "management", "of", "this", "FormGuard", "." ]
6aad6e640b348cda8f3b0841f6e42025233f1eb8
https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/form/FormGuard.java#L176-L179
11,921
lievendoclo/Valkyrie-RCP
valkyrie-rcp-integrations/valkyrie-rcp-vldocking/src/main/java/org/valkyriercp/application/docking/VLDockingUtils.java
VLDockingUtils.fixVLDockingBug
public static DockableState fixVLDockingBug(DockingDesktop dockingDesktop, Dockable dockable) { Assert.notNull(dockingDesktop, "dockingDesktop"); Assert.notNull(dockable, "dockable"); final DockingContext dockingContext = dockingDesktop.getContext(); final DockKey dockKey = dockable.getDockKey(); DockableState dockableState = dockingDesktop.getDockableState(dockable); final Boolean thisFixApplies = (dockingContext.getDockableByKey(dockKey.getKey()) != null); if ((thisFixApplies) && (dockableState == null)) { dockingDesktop.registerDockable(dockable); dockableState = dockingDesktop.getDockableState(dockable); // dockKey.setLocation(dockableState.getLocation()); Assert.notNull(dockableState, "dockableState"); } return dockableState; }
java
public static DockableState fixVLDockingBug(DockingDesktop dockingDesktop, Dockable dockable) { Assert.notNull(dockingDesktop, "dockingDesktop"); Assert.notNull(dockable, "dockable"); final DockingContext dockingContext = dockingDesktop.getContext(); final DockKey dockKey = dockable.getDockKey(); DockableState dockableState = dockingDesktop.getDockableState(dockable); final Boolean thisFixApplies = (dockingContext.getDockableByKey(dockKey.getKey()) != null); if ((thisFixApplies) && (dockableState == null)) { dockingDesktop.registerDockable(dockable); dockableState = dockingDesktop.getDockableState(dockable); // dockKey.setLocation(dockableState.getLocation()); Assert.notNull(dockableState, "dockableState"); } return dockableState; }
[ "public", "static", "DockableState", "fixVLDockingBug", "(", "DockingDesktop", "dockingDesktop", ",", "Dockable", "dockable", ")", "{", "Assert", ".", "notNull", "(", "dockingDesktop", ",", "\"dockingDesktop\"", ")", ";", "Assert", ".", "notNull", "(", "dockable", ",", "\"dockable\"", ")", ";", "final", "DockingContext", "dockingContext", "=", "dockingDesktop", ".", "getContext", "(", ")", ";", "final", "DockKey", "dockKey", "=", "dockable", ".", "getDockKey", "(", ")", ";", "DockableState", "dockableState", "=", "dockingDesktop", ".", "getDockableState", "(", "dockable", ")", ";", "final", "Boolean", "thisFixApplies", "=", "(", "dockingContext", ".", "getDockableByKey", "(", "dockKey", ".", "getKey", "(", ")", ")", "!=", "null", ")", ";", "if", "(", "(", "thisFixApplies", ")", "&&", "(", "dockableState", "==", "null", ")", ")", "{", "dockingDesktop", ".", "registerDockable", "(", "dockable", ")", ";", "dockableState", "=", "dockingDesktop", ".", "getDockableState", "(", "dockable", ")", ";", "// dockKey.setLocation(dockableState.getLocation());", "Assert", ".", "notNull", "(", "dockableState", ",", "\"dockableState\"", ")", ";", "}", "return", "dockableState", ";", "}" ]
Fixes an VLDocking bug consisting on dockables that belong to a docking desktop have no state on it. @param dockable the dockable candidate. @return its dockable state. If none then registers the dockable again and ensures dockable state is not null.
[ "Fixes", "an", "VLDocking", "bug", "consisting", "on", "dockables", "that", "belong", "to", "a", "docking", "desktop", "have", "no", "state", "on", "it", "." ]
6aad6e640b348cda8f3b0841f6e42025233f1eb8
https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-integrations/valkyrie-rcp-vldocking/src/main/java/org/valkyriercp/application/docking/VLDockingUtils.java#L62-L82
11,922
lievendoclo/Valkyrie-RCP
valkyrie-rcp-integrations/valkyrie-rcp-vldocking/src/main/java/org/valkyriercp/application/docking/VLDockingUtils.java
VLDockingUtils.activationKey
public static String activationKey(String key, Boolean active) { Assert.notNull(key, "key"); Assert.notNull(active, "active"); final int index = key.lastIndexOf(VLDockingUtils.DOT); final String overlay = active ? VLDockingUtils.ACTIVE_INFIX : VLDockingUtils.INACTIVE_INFIX; // return StringUtils.overlay(key, overlay, index, index); return key; //TODO }
java
public static String activationKey(String key, Boolean active) { Assert.notNull(key, "key"); Assert.notNull(active, "active"); final int index = key.lastIndexOf(VLDockingUtils.DOT); final String overlay = active ? VLDockingUtils.ACTIVE_INFIX : VLDockingUtils.INACTIVE_INFIX; // return StringUtils.overlay(key, overlay, index, index); return key; //TODO }
[ "public", "static", "String", "activationKey", "(", "String", "key", ",", "Boolean", "active", ")", "{", "Assert", ".", "notNull", "(", "key", ",", "\"key\"", ")", ";", "Assert", ".", "notNull", "(", "active", ",", "\"active\"", ")", ";", "final", "int", "index", "=", "key", ".", "lastIndexOf", "(", "VLDockingUtils", ".", "DOT", ")", ";", "final", "String", "overlay", "=", "active", "?", "VLDockingUtils", ".", "ACTIVE_INFIX", ":", "VLDockingUtils", ".", "INACTIVE_INFIX", ";", "// return StringUtils.overlay(key, overlay, index, index);", "return", "key", ";", "//TODO", "}" ]
Transforms a UI object key into an activation aware key name. @param key the key. @param active <code>true</code> for <em>active</em> UI keys and <code>false</code> for inactive. @return the transformed key.
[ "Transforms", "a", "UI", "object", "key", "into", "an", "activation", "aware", "key", "name", "." ]
6aad6e640b348cda8f3b0841f6e42025233f1eb8
https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-integrations/valkyrie-rcp-vldocking/src/main/java/org/valkyriercp/application/docking/VLDockingUtils.java#L93-L103
11,923
lievendoclo/Valkyrie-RCP
valkyrie-rcp-core/src/main/java/org/valkyriercp/application/session/ApplicationSession.java
ApplicationSession.handleLoginEvent
protected void handleLoginEvent(LoginEvent event) { ApplicationSessionInitializer asi = getApplicationSessionInitializer(); if (asi != null) { asi.initializeUser(); Map<String, Object> userAttributes = asi.getUserAttributes(); if (userAttributes != null) { setUserAttributes(userAttributes); } } Authentication auth = (Authentication) event.getSource(); propertyChangeSupport.firePropertyChange(USER, null, auth); }
java
protected void handleLoginEvent(LoginEvent event) { ApplicationSessionInitializer asi = getApplicationSessionInitializer(); if (asi != null) { asi.initializeUser(); Map<String, Object> userAttributes = asi.getUserAttributes(); if (userAttributes != null) { setUserAttributes(userAttributes); } } Authentication auth = (Authentication) event.getSource(); propertyChangeSupport.firePropertyChange(USER, null, auth); }
[ "protected", "void", "handleLoginEvent", "(", "LoginEvent", "event", ")", "{", "ApplicationSessionInitializer", "asi", "=", "getApplicationSessionInitializer", "(", ")", ";", "if", "(", "asi", "!=", "null", ")", "{", "asi", ".", "initializeUser", "(", ")", ";", "Map", "<", "String", ",", "Object", ">", "userAttributes", "=", "asi", ".", "getUserAttributes", "(", ")", ";", "if", "(", "userAttributes", "!=", "null", ")", "{", "setUserAttributes", "(", "userAttributes", ")", ";", "}", "}", "Authentication", "auth", "=", "(", "Authentication", ")", "event", ".", "getSource", "(", ")", ";", "propertyChangeSupport", ".", "firePropertyChange", "(", "USER", ",", "null", ",", "auth", ")", ";", "}" ]
When a correct login occurs, read all relevant userinformation into session. @param event the loginEvent that triggered this handler.
[ "When", "a", "correct", "login", "occurs", "read", "all", "relevant", "userinformation", "into", "session", "." ]
6aad6e640b348cda8f3b0841f6e42025233f1eb8
https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/application/session/ApplicationSession.java#L84-L98
11,924
lievendoclo/Valkyrie-RCP
valkyrie-rcp-core/src/main/java/org/valkyriercp/application/session/ApplicationSession.java
ApplicationSession.handleLogoutEvent
protected void handleLogoutEvent(LogoutEvent event) { clearUser(); Authentication auth = (Authentication) event.getSource(); propertyChangeSupport.firePropertyChange(USER, auth, null); }
java
protected void handleLogoutEvent(LogoutEvent event) { clearUser(); Authentication auth = (Authentication) event.getSource(); propertyChangeSupport.firePropertyChange(USER, auth, null); }
[ "protected", "void", "handleLogoutEvent", "(", "LogoutEvent", "event", ")", "{", "clearUser", "(", ")", ";", "Authentication", "auth", "=", "(", "Authentication", ")", "event", ".", "getSource", "(", ")", ";", "propertyChangeSupport", ".", "firePropertyChange", "(", "USER", ",", "auth", ",", "null", ")", ";", "}" ]
When a logout occurs, remove all user related information from the session. @param event the logoutEvent that triggered this handler.
[ "When", "a", "logout", "occurs", "remove", "all", "user", "related", "information", "from", "the", "session", "." ]
6aad6e640b348cda8f3b0841f6e42025233f1eb8
https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/application/session/ApplicationSession.java#L107-L112
11,925
lievendoclo/Valkyrie-RCP
valkyrie-rcp-core/src/main/java/org/valkyriercp/application/session/ApplicationSession.java
ApplicationSession.initializeSession
public void initializeSession() { ApplicationSessionInitializer asi = getApplicationSessionInitializer(); if (asi != null) { asi.initializeSession(); Map<String, Object> sessionAttributes = asi.getSessionAttributes(); if (sessionAttributes != null) { setSessionAttributes(sessionAttributes); } propertyChangeSupport.firePropertyChange(SESSION_ATTRIBUTES, null, sessionAttributes); } }
java
public void initializeSession() { ApplicationSessionInitializer asi = getApplicationSessionInitializer(); if (asi != null) { asi.initializeSession(); Map<String, Object> sessionAttributes = asi.getSessionAttributes(); if (sessionAttributes != null) { setSessionAttributes(sessionAttributes); } propertyChangeSupport.firePropertyChange(SESSION_ATTRIBUTES, null, sessionAttributes); } }
[ "public", "void", "initializeSession", "(", ")", "{", "ApplicationSessionInitializer", "asi", "=", "getApplicationSessionInitializer", "(", ")", ";", "if", "(", "asi", "!=", "null", ")", "{", "asi", ".", "initializeSession", "(", ")", ";", "Map", "<", "String", ",", "Object", ">", "sessionAttributes", "=", "asi", ".", "getSessionAttributes", "(", ")", ";", "if", "(", "sessionAttributes", "!=", "null", ")", "{", "setSessionAttributes", "(", "sessionAttributes", ")", ";", "}", "propertyChangeSupport", ".", "firePropertyChange", "(", "SESSION_ATTRIBUTES", ",", "null", ",", "sessionAttributes", ")", ";", "}", "}" ]
Initialize the session attributes.
[ "Initialize", "the", "session", "attributes", "." ]
6aad6e640b348cda8f3b0841f6e42025233f1eb8
https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/application/session/ApplicationSession.java#L165-L178
11,926
lievendoclo/Valkyrie-RCP
valkyrie-rcp-core/src/main/java/org/valkyriercp/application/session/ApplicationSession.java
ApplicationSession.getUserAttribute
public Object getUserAttribute(String key, Object defaultValue) { Object attributeValue = this.userAttributes.get(key); if (attributeValue == null) attributeValue = defaultValue; return attributeValue; }
java
public Object getUserAttribute(String key, Object defaultValue) { Object attributeValue = this.userAttributes.get(key); if (attributeValue == null) attributeValue = defaultValue; return attributeValue; }
[ "public", "Object", "getUserAttribute", "(", "String", "key", ",", "Object", "defaultValue", ")", "{", "Object", "attributeValue", "=", "this", ".", "userAttributes", ".", "get", "(", "key", ")", ";", "if", "(", "attributeValue", "==", "null", ")", "attributeValue", "=", "defaultValue", ";", "return", "attributeValue", ";", "}" ]
Get a value from the user attributes map. @param key name of the attribute @param defaultValue a default value to return if no value is found. @return the attribute value
[ "Get", "a", "value", "from", "the", "user", "attributes", "map", "." ]
6aad6e640b348cda8f3b0841f6e42025233f1eb8
https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/application/session/ApplicationSession.java#L201-L207
11,927
lievendoclo/Valkyrie-RCP
valkyrie-rcp-core/src/main/java/org/valkyriercp/application/session/ApplicationSession.java
ApplicationSession.getSessionAttribute
public Object getSessionAttribute(String key, Object defaultValue) { Object attributeValue = this.sessionAttributes.get(key); if (attributeValue == null) attributeValue = defaultValue; return attributeValue; }
java
public Object getSessionAttribute(String key, Object defaultValue) { Object attributeValue = this.sessionAttributes.get(key); if (attributeValue == null) attributeValue = defaultValue; return attributeValue; }
[ "public", "Object", "getSessionAttribute", "(", "String", "key", ",", "Object", "defaultValue", ")", "{", "Object", "attributeValue", "=", "this", ".", "sessionAttributes", ".", "get", "(", "key", ")", ";", "if", "(", "attributeValue", "==", "null", ")", "attributeValue", "=", "defaultValue", ";", "return", "attributeValue", ";", "}" ]
Get a value from the session attributes map. @param key a unique string code @param defaultValue the default value if not found @return The session attibute or the default value if not found
[ "Get", "a", "value", "from", "the", "session", "attributes", "map", "." ]
6aad6e640b348cda8f3b0841f6e42025233f1eb8
https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/application/session/ApplicationSession.java#L264-L270
11,928
lievendoclo/Valkyrie-RCP
valkyrie-rcp-core/src/main/java/org/valkyriercp/application/session/ApplicationSession.java
ApplicationSession.getAttribute
public Object getAttribute(String key, Object defaultValue) { Object attributeValue = getUserAttribute(key, null); if (attributeValue != null) return attributeValue; attributeValue = getSessionAttribute(key, null); if (attributeValue != null) return attributeValue; return defaultValue; }
java
public Object getAttribute(String key, Object defaultValue) { Object attributeValue = getUserAttribute(key, null); if (attributeValue != null) return attributeValue; attributeValue = getSessionAttribute(key, null); if (attributeValue != null) return attributeValue; return defaultValue; }
[ "public", "Object", "getAttribute", "(", "String", "key", ",", "Object", "defaultValue", ")", "{", "Object", "attributeValue", "=", "getUserAttribute", "(", "key", ",", "null", ")", ";", "if", "(", "attributeValue", "!=", "null", ")", "return", "attributeValue", ";", "attributeValue", "=", "getSessionAttribute", "(", "key", ",", "null", ")", ";", "if", "(", "attributeValue", "!=", "null", ")", "return", "attributeValue", ";", "return", "defaultValue", ";", "}" ]
Get a value from the user OR session attributes map. @param key name of the attribute @param defaultValue a default value to return if no value is found. @return the attribute value
[ "Get", "a", "value", "from", "the", "user", "OR", "session", "attributes", "map", "." ]
6aad6e640b348cda8f3b0841f6e42025233f1eb8
https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/application/session/ApplicationSession.java#L329-L338
11,929
lievendoclo/Valkyrie-RCP
valkyrie-rcp-core/src/main/java/org/valkyriercp/application/config/support/UIManagerConfigurer.java
UIManagerConfigurer.installPrePackagedUIManagerDefaults
private void installPrePackagedUIManagerDefaults() { try { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); UIManager.put("Tree.line", "Angled"); UIManager.put("Tree.leafIcon", null); UIManager.put("Tree.closedIcon", null); UIManager.put("Tree.openIcon", null); UIManager.put("Tree.rightChildIndent", new Integer(10)); } catch (Exception e) { throw new ApplicationException("Unable to set defaults", e); } }
java
private void installPrePackagedUIManagerDefaults() { try { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); UIManager.put("Tree.line", "Angled"); UIManager.put("Tree.leafIcon", null); UIManager.put("Tree.closedIcon", null); UIManager.put("Tree.openIcon", null); UIManager.put("Tree.rightChildIndent", new Integer(10)); } catch (Exception e) { throw new ApplicationException("Unable to set defaults", e); } }
[ "private", "void", "installPrePackagedUIManagerDefaults", "(", ")", "{", "try", "{", "UIManager", ".", "setLookAndFeel", "(", "UIManager", ".", "getSystemLookAndFeelClassName", "(", ")", ")", ";", "UIManager", ".", "put", "(", "\"Tree.line\"", ",", "\"Angled\"", ")", ";", "UIManager", ".", "put", "(", "\"Tree.leafIcon\"", ",", "null", ")", ";", "UIManager", ".", "put", "(", "\"Tree.closedIcon\"", ",", "null", ")", ";", "UIManager", ".", "put", "(", "\"Tree.openIcon\"", ",", "null", ")", ";", "UIManager", ".", "put", "(", "\"Tree.rightChildIndent\"", ",", "new", "Integer", "(", "10", ")", ")", ";", "}", "catch", "(", "Exception", "e", ")", "{", "throw", "new", "ApplicationException", "(", "\"Unable to set defaults\"", ",", "e", ")", ";", "}", "}" ]
Initializes the UIManager defaults to values based on recommended, best-practices user interface design. This should generally be called once by an initializing application class.
[ "Initializes", "the", "UIManager", "defaults", "to", "values", "based", "on", "recommended", "best", "-", "practices", "user", "interface", "design", ".", "This", "should", "generally", "be", "called", "once", "by", "an", "initializing", "application", "class", "." ]
6aad6e640b348cda8f3b0841f6e42025233f1eb8
https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/application/config/support/UIManagerConfigurer.java#L82-L93
11,930
lievendoclo/Valkyrie-RCP
valkyrie-rcp-core/src/main/java/org/valkyriercp/binding/value/support/PropertyChangeSupport.java
PropertyChangeSupport.addPropertyChangeListener
public void addPropertyChangeListener(PropertyChangeListener listener) { if (listener instanceof PropertyChangeListenerProxy) { PropertyChangeListenerProxy proxy = (PropertyChangeListenerProxy) listener; addPropertyChangeListener(proxy.getPropertyName(), (PropertyChangeListener) proxy.getListener()); } else { if (listeners == null) { listeners = new EventListenerList(); } listeners.add(PropertyChangeListener.class, listener); } }
java
public void addPropertyChangeListener(PropertyChangeListener listener) { if (listener instanceof PropertyChangeListenerProxy) { PropertyChangeListenerProxy proxy = (PropertyChangeListenerProxy) listener; addPropertyChangeListener(proxy.getPropertyName(), (PropertyChangeListener) proxy.getListener()); } else { if (listeners == null) { listeners = new EventListenerList(); } listeners.add(PropertyChangeListener.class, listener); } }
[ "public", "void", "addPropertyChangeListener", "(", "PropertyChangeListener", "listener", ")", "{", "if", "(", "listener", "instanceof", "PropertyChangeListenerProxy", ")", "{", "PropertyChangeListenerProxy", "proxy", "=", "(", "PropertyChangeListenerProxy", ")", "listener", ";", "addPropertyChangeListener", "(", "proxy", ".", "getPropertyName", "(", ")", ",", "(", "PropertyChangeListener", ")", "proxy", ".", "getListener", "(", ")", ")", ";", "}", "else", "{", "if", "(", "listeners", "==", "null", ")", "{", "listeners", "=", "new", "EventListenerList", "(", ")", ";", "}", "listeners", ".", "add", "(", "PropertyChangeListener", ".", "class", ",", "listener", ")", ";", "}", "}" ]
Add a PropertyChangeListener to the listener list. The listener is registered for all properties. @param listener The PropertyChangeListener to be added
[ "Add", "a", "PropertyChangeListener", "to", "the", "listener", "list", ".", "The", "listener", "is", "registered", "for", "all", "properties", "." ]
6aad6e640b348cda8f3b0841f6e42025233f1eb8
https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/binding/value/support/PropertyChangeSupport.java#L67-L78
11,931
lievendoclo/Valkyrie-RCP
valkyrie-rcp-core/src/main/java/org/valkyriercp/binding/value/support/PropertyChangeSupport.java
PropertyChangeSupport.addPropertyChangeListener
public void addPropertyChangeListener(String propertyName, PropertyChangeListener listener) { if (children == null) { children = new HashMap(); } PropertyChangeSupport child = (PropertyChangeSupport) children.get(propertyName); if (child == null) { child = new PropertyChangeSupport(source); children.put(propertyName, child); } child.addPropertyChangeListener(listener); }
java
public void addPropertyChangeListener(String propertyName, PropertyChangeListener listener) { if (children == null) { children = new HashMap(); } PropertyChangeSupport child = (PropertyChangeSupport) children.get(propertyName); if (child == null) { child = new PropertyChangeSupport(source); children.put(propertyName, child); } child.addPropertyChangeListener(listener); }
[ "public", "void", "addPropertyChangeListener", "(", "String", "propertyName", ",", "PropertyChangeListener", "listener", ")", "{", "if", "(", "children", "==", "null", ")", "{", "children", "=", "new", "HashMap", "(", ")", ";", "}", "PropertyChangeSupport", "child", "=", "(", "PropertyChangeSupport", ")", "children", ".", "get", "(", "propertyName", ")", ";", "if", "(", "child", "==", "null", ")", "{", "child", "=", "new", "PropertyChangeSupport", "(", "source", ")", ";", "children", ".", "put", "(", "propertyName", ",", "child", ")", ";", "}", "child", ".", "addPropertyChangeListener", "(", "listener", ")", ";", "}" ]
Add a PropertyChangeListener for a specific property. The listener will be invoked only when a call on firePropertyChange names that specific property. @param propertyName The name of the property to listen on. @param listener The PropertyChangeListener to be added
[ "Add", "a", "PropertyChangeListener", "for", "a", "specific", "property", ".", "The", "listener", "will", "be", "invoked", "only", "when", "a", "call", "on", "firePropertyChange", "names", "that", "specific", "property", "." ]
6aad6e640b348cda8f3b0841f6e42025233f1eb8
https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/binding/value/support/PropertyChangeSupport.java#L160-L170
11,932
lievendoclo/Valkyrie-RCP
valkyrie-rcp-core/src/main/java/org/valkyriercp/binding/value/support/PropertyChangeSupport.java
PropertyChangeSupport.removePropertyChangeListener
public void removePropertyChangeListener(String propertyName, PropertyChangeListener listener) { if (children == null) { return; } PropertyChangeSupport child = (PropertyChangeSupport) children.get(propertyName); if (child == null) { return; } child.removePropertyChangeListener(listener); }
java
public void removePropertyChangeListener(String propertyName, PropertyChangeListener listener) { if (children == null) { return; } PropertyChangeSupport child = (PropertyChangeSupport) children.get(propertyName); if (child == null) { return; } child.removePropertyChangeListener(listener); }
[ "public", "void", "removePropertyChangeListener", "(", "String", "propertyName", ",", "PropertyChangeListener", "listener", ")", "{", "if", "(", "children", "==", "null", ")", "{", "return", ";", "}", "PropertyChangeSupport", "child", "=", "(", "PropertyChangeSupport", ")", "children", ".", "get", "(", "propertyName", ")", ";", "if", "(", "child", "==", "null", ")", "{", "return", ";", "}", "child", ".", "removePropertyChangeListener", "(", "listener", ")", ";", "}" ]
Remove a PropertyChangeListener for a specific property. @param propertyName The name of the property that was listened on. @param listener The PropertyChangeListener to be removed
[ "Remove", "a", "PropertyChangeListener", "for", "a", "specific", "property", "." ]
6aad6e640b348cda8f3b0841f6e42025233f1eb8
https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/binding/value/support/PropertyChangeSupport.java#L178-L187
11,933
lievendoclo/Valkyrie-RCP
valkyrie-rcp-core/src/main/java/org/valkyriercp/binding/value/support/PropertyChangeSupport.java
PropertyChangeSupport.firePropertyChange
public void firePropertyChange(String propertyName, Object oldValue, Object newValue) { firePropertyChange(new PropertyChangeEvent(source, propertyName, oldValue, newValue)); }
java
public void firePropertyChange(String propertyName, Object oldValue, Object newValue) { firePropertyChange(new PropertyChangeEvent(source, propertyName, oldValue, newValue)); }
[ "public", "void", "firePropertyChange", "(", "String", "propertyName", ",", "Object", "oldValue", ",", "Object", "newValue", ")", "{", "firePropertyChange", "(", "new", "PropertyChangeEvent", "(", "source", ",", "propertyName", ",", "oldValue", ",", "newValue", ")", ")", ";", "}" ]
Report a bound property update to any registered listeners. No event is fired if old and new are equal and non-null. @param propertyName The programmatic name of the property that was changed. @param oldValue The old value of the property. @param newValue The new value of the property.
[ "Report", "a", "bound", "property", "update", "to", "any", "registered", "listeners", ".", "No", "event", "is", "fired", "if", "old", "and", "new", "are", "equal", "and", "non", "-", "null", "." ]
6aad6e640b348cda8f3b0841f6e42025233f1eb8
https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/binding/value/support/PropertyChangeSupport.java#L217-L219
11,934
lievendoclo/Valkyrie-RCP
valkyrie-rcp-core/src/main/java/org/valkyriercp/binding/value/support/PropertyChangeSupport.java
PropertyChangeSupport.firePropertyChange
public void firePropertyChange(PropertyChangeEvent evt) { Object oldValue = evt.getOldValue(); Object newValue = evt.getNewValue(); if (ObjectUtils.nullSafeEquals(oldValue, newValue)) { return; } String propertyName = evt.getPropertyName(); PropertyChangeSupport child = null; if (children != null) { if (children != null && propertyName != null) { child = (PropertyChangeSupport) children.get(propertyName); } } if (listeners != null) { Object[] listenerList = listeners.getListenerList(); for (int i = 0; i <= listenerList.length - 2; i += 2) { if (listenerList[i] == PropertyChangeListener.class) { ((PropertyChangeListener) listenerList[i + 1]).propertyChange(evt); } } } if (child != null) { child.firePropertyChange(evt); } }
java
public void firePropertyChange(PropertyChangeEvent evt) { Object oldValue = evt.getOldValue(); Object newValue = evt.getNewValue(); if (ObjectUtils.nullSafeEquals(oldValue, newValue)) { return; } String propertyName = evt.getPropertyName(); PropertyChangeSupport child = null; if (children != null) { if (children != null && propertyName != null) { child = (PropertyChangeSupport) children.get(propertyName); } } if (listeners != null) { Object[] listenerList = listeners.getListenerList(); for (int i = 0; i <= listenerList.length - 2; i += 2) { if (listenerList[i] == PropertyChangeListener.class) { ((PropertyChangeListener) listenerList[i + 1]).propertyChange(evt); } } } if (child != null) { child.firePropertyChange(evt); } }
[ "public", "void", "firePropertyChange", "(", "PropertyChangeEvent", "evt", ")", "{", "Object", "oldValue", "=", "evt", ".", "getOldValue", "(", ")", ";", "Object", "newValue", "=", "evt", ".", "getNewValue", "(", ")", ";", "if", "(", "ObjectUtils", ".", "nullSafeEquals", "(", "oldValue", ",", "newValue", ")", ")", "{", "return", ";", "}", "String", "propertyName", "=", "evt", ".", "getPropertyName", "(", ")", ";", "PropertyChangeSupport", "child", "=", "null", ";", "if", "(", "children", "!=", "null", ")", "{", "if", "(", "children", "!=", "null", "&&", "propertyName", "!=", "null", ")", "{", "child", "=", "(", "PropertyChangeSupport", ")", "children", ".", "get", "(", "propertyName", ")", ";", "}", "}", "if", "(", "listeners", "!=", "null", ")", "{", "Object", "[", "]", "listenerList", "=", "listeners", ".", "getListenerList", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<=", "listenerList", ".", "length", "-", "2", ";", "i", "+=", "2", ")", "{", "if", "(", "listenerList", "[", "i", "]", "==", "PropertyChangeListener", ".", "class", ")", "{", "(", "(", "PropertyChangeListener", ")", "listenerList", "[", "i", "+", "1", "]", ")", ".", "propertyChange", "(", "evt", ")", ";", "}", "}", "}", "if", "(", "child", "!=", "null", ")", "{", "child", ".", "firePropertyChange", "(", "evt", ")", ";", "}", "}" ]
Fire an existing PropertyChangeEvent to any registered listeners. No event is fired if the given event's old and new values are equal and non-null. @param evt The PropertyChangeEvent object.
[ "Fire", "an", "existing", "PropertyChangeEvent", "to", "any", "registered", "listeners", ".", "No", "event", "is", "fired", "if", "the", "given", "event", "s", "old", "and", "new", "values", "are", "equal", "and", "non", "-", "null", "." ]
6aad6e640b348cda8f3b0841f6e42025233f1eb8
https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/binding/value/support/PropertyChangeSupport.java#L228-L255
11,935
lievendoclo/Valkyrie-RCP
valkyrie-rcp-core/src/main/java/org/valkyriercp/binding/value/support/PropertyChangeSupport.java
PropertyChangeSupport.hasListeners
public boolean hasListeners(String propertyName) { if (listeners != null && listeners.getListenerCount(PropertyChangeListener.class) > 0) { // there is a generic listener return true; } if (children != null) { PropertyChangeSupport child = (PropertyChangeSupport) children.get(propertyName); if (child != null) { // The child will always have a listeners ArrayList. return child.hasListeners(propertyName); } } return false; }
java
public boolean hasListeners(String propertyName) { if (listeners != null && listeners.getListenerCount(PropertyChangeListener.class) > 0) { // there is a generic listener return true; } if (children != null) { PropertyChangeSupport child = (PropertyChangeSupport) children.get(propertyName); if (child != null) { // The child will always have a listeners ArrayList. return child.hasListeners(propertyName); } } return false; }
[ "public", "boolean", "hasListeners", "(", "String", "propertyName", ")", "{", "if", "(", "listeners", "!=", "null", "&&", "listeners", ".", "getListenerCount", "(", "PropertyChangeListener", ".", "class", ")", ">", "0", ")", "{", "// there is a generic listener", "return", "true", ";", "}", "if", "(", "children", "!=", "null", ")", "{", "PropertyChangeSupport", "child", "=", "(", "PropertyChangeSupport", ")", "children", ".", "get", "(", "propertyName", ")", ";", "if", "(", "child", "!=", "null", ")", "{", "// The child will always have a listeners ArrayList.", "return", "child", ".", "hasListeners", "(", "propertyName", ")", ";", "}", "}", "return", "false", ";", "}" ]
Check if there are any listeners for a specific property. @param propertyName the property name. @return true if there are ore or more listeners for the given property
[ "Check", "if", "there", "are", "any", "listeners", "for", "a", "specific", "property", "." ]
6aad6e640b348cda8f3b0841f6e42025233f1eb8
https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/binding/value/support/PropertyChangeSupport.java#L263-L276
11,936
lievendoclo/Valkyrie-RCP
valkyrie-rcp-core/src/main/java/org/valkyriercp/security/SecurityAwareConfigurer.java
SecurityAwareConfigurer.broadcastAuthentication
protected void broadcastAuthentication(Authentication authentication) { if( logger.isDebugEnabled() ) logger.debug( "BROADCAST authentication: token=" + authentication ); // Save this for any new beans that we post-process currentAuthentication = authentication; final Iterator iter = getBeansToUpdate( AuthenticationAware.class ).iterator(); while( iter.hasNext() ) { ((AuthenticationAware) iter.next()).setAuthenticationToken( authentication ); } }
java
protected void broadcastAuthentication(Authentication authentication) { if( logger.isDebugEnabled() ) logger.debug( "BROADCAST authentication: token=" + authentication ); // Save this for any new beans that we post-process currentAuthentication = authentication; final Iterator iter = getBeansToUpdate( AuthenticationAware.class ).iterator(); while( iter.hasNext() ) { ((AuthenticationAware) iter.next()).setAuthenticationToken( authentication ); } }
[ "protected", "void", "broadcastAuthentication", "(", "Authentication", "authentication", ")", "{", "if", "(", "logger", ".", "isDebugEnabled", "(", ")", ")", "logger", ".", "debug", "(", "\"BROADCAST authentication: token=\"", "+", "authentication", ")", ";", "// Save this for any new beans that we post-process", "currentAuthentication", "=", "authentication", ";", "final", "Iterator", "iter", "=", "getBeansToUpdate", "(", "AuthenticationAware", ".", "class", ")", ".", "iterator", "(", ")", ";", "while", "(", "iter", ".", "hasNext", "(", ")", ")", "{", "(", "(", "AuthenticationAware", ")", "iter", ".", "next", "(", ")", ")", ".", "setAuthenticationToken", "(", "authentication", ")", ";", "}", "}" ]
Broadcast an authentication event to all the AuthenticationAware beans. @param authentication token
[ "Broadcast", "an", "authentication", "event", "to", "all", "the", "AuthenticationAware", "beans", "." ]
6aad6e640b348cda8f3b0841f6e42025233f1eb8
https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/security/SecurityAwareConfigurer.java#L80-L91
11,937
lievendoclo/Valkyrie-RCP
valkyrie-rcp-core/src/main/java/org/valkyriercp/security/SecurityAwareConfigurer.java
SecurityAwareConfigurer.broadcastLogin
protected void broadcastLogin(Authentication authentication) { if( logger.isDebugEnabled() ) logger.debug( "BROADCAST login: token=" + authentication ); final Iterator iter = getBeansToUpdate( LoginAware.class ).iterator(); while( iter.hasNext() ) { ((LoginAware) iter.next()).userLogin( authentication ); } }
java
protected void broadcastLogin(Authentication authentication) { if( logger.isDebugEnabled() ) logger.debug( "BROADCAST login: token=" + authentication ); final Iterator iter = getBeansToUpdate( LoginAware.class ).iterator(); while( iter.hasNext() ) { ((LoginAware) iter.next()).userLogin( authentication ); } }
[ "protected", "void", "broadcastLogin", "(", "Authentication", "authentication", ")", "{", "if", "(", "logger", ".", "isDebugEnabled", "(", ")", ")", "logger", ".", "debug", "(", "\"BROADCAST login: token=\"", "+", "authentication", ")", ";", "final", "Iterator", "iter", "=", "getBeansToUpdate", "(", "LoginAware", ".", "class", ")", ".", "iterator", "(", ")", ";", "while", "(", "iter", ".", "hasNext", "(", ")", ")", "{", "(", "(", "LoginAware", ")", "iter", ".", "next", "(", ")", ")", ".", "userLogin", "(", "authentication", ")", ";", "}", "}" ]
Broadcast a Login event to all the LoginAware beans. @param authentication token
[ "Broadcast", "a", "Login", "event", "to", "all", "the", "LoginAware", "beans", "." ]
6aad6e640b348cda8f3b0841f6e42025233f1eb8
https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/security/SecurityAwareConfigurer.java#L97-L105
11,938
lievendoclo/Valkyrie-RCP
valkyrie-rcp-core/src/main/java/org/valkyriercp/security/SecurityAwareConfigurer.java
SecurityAwareConfigurer.broadcastLogout
protected void broadcastLogout(Authentication authentication) { if( logger.isDebugEnabled() ) logger.debug( "BROADCAST logout: token=" + authentication ); final Iterator iter = getBeansToUpdate( LoginAware.class ).iterator(); while( iter.hasNext() ) { ((LoginAware) iter.next()).userLogout( authentication ); } }
java
protected void broadcastLogout(Authentication authentication) { if( logger.isDebugEnabled() ) logger.debug( "BROADCAST logout: token=" + authentication ); final Iterator iter = getBeansToUpdate( LoginAware.class ).iterator(); while( iter.hasNext() ) { ((LoginAware) iter.next()).userLogout( authentication ); } }
[ "protected", "void", "broadcastLogout", "(", "Authentication", "authentication", ")", "{", "if", "(", "logger", ".", "isDebugEnabled", "(", ")", ")", "logger", ".", "debug", "(", "\"BROADCAST logout: token=\"", "+", "authentication", ")", ";", "final", "Iterator", "iter", "=", "getBeansToUpdate", "(", "LoginAware", ".", "class", ")", ".", "iterator", "(", ")", ";", "while", "(", "iter", ".", "hasNext", "(", ")", ")", "{", "(", "(", "LoginAware", ")", "iter", ".", "next", "(", ")", ")", ".", "userLogout", "(", "authentication", ")", ";", "}", "}" ]
Broadcast a Logout event to all the LoginAware beans. @param authentication token
[ "Broadcast", "a", "Logout", "event", "to", "all", "the", "LoginAware", "beans", "." ]
6aad6e640b348cda8f3b0841f6e42025233f1eb8
https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/security/SecurityAwareConfigurer.java#L111-L119
11,939
lievendoclo/Valkyrie-RCP
valkyrie-rcp-core/src/main/java/org/valkyriercp/security/SecurityAwareConfigurer.java
SecurityAwareConfigurer.getBeansToUpdate
protected List getBeansToUpdate(Class beanType) { final ApplicationContext ac = getApplicationContext(); final List listeners = new ArrayList(); if( ac != null ) { if( logger.isDebugEnabled() ) logger.debug( "Constructing list of beans to notify; bean type=" + beanType.getName() ); final Map map = ac.getBeansOfType( beanType, false, true ); if( logger.isDebugEnabled() ) logger.debug( "bean map: " + map ); listeners.addAll( map.values() ); listeners.addAll( getNonSingletonListeners( beanType ) ); } if( logger.isDebugEnabled() ) logger.debug( "List of beans to notify:" + listeners ); return listeners; }
java
protected List getBeansToUpdate(Class beanType) { final ApplicationContext ac = getApplicationContext(); final List listeners = new ArrayList(); if( ac != null ) { if( logger.isDebugEnabled() ) logger.debug( "Constructing list of beans to notify; bean type=" + beanType.getName() ); final Map map = ac.getBeansOfType( beanType, false, true ); if( logger.isDebugEnabled() ) logger.debug( "bean map: " + map ); listeners.addAll( map.values() ); listeners.addAll( getNonSingletonListeners( beanType ) ); } if( logger.isDebugEnabled() ) logger.debug( "List of beans to notify:" + listeners ); return listeners; }
[ "protected", "List", "getBeansToUpdate", "(", "Class", "beanType", ")", "{", "final", "ApplicationContext", "ac", "=", "getApplicationContext", "(", ")", ";", "final", "List", "listeners", "=", "new", "ArrayList", "(", ")", ";", "if", "(", "ac", "!=", "null", ")", "{", "if", "(", "logger", ".", "isDebugEnabled", "(", ")", ")", "logger", ".", "debug", "(", "\"Constructing list of beans to notify; bean type=\"", "+", "beanType", ".", "getName", "(", ")", ")", ";", "final", "Map", "map", "=", "ac", ".", "getBeansOfType", "(", "beanType", ",", "false", ",", "true", ")", ";", "if", "(", "logger", ".", "isDebugEnabled", "(", ")", ")", "logger", ".", "debug", "(", "\"bean map: \"", "+", "map", ")", ";", "listeners", ".", "addAll", "(", "map", ".", "values", "(", ")", ")", ";", "listeners", ".", "addAll", "(", "getNonSingletonListeners", "(", "beanType", ")", ")", ";", "}", "if", "(", "logger", ".", "isDebugEnabled", "(", ")", ")", "logger", ".", "debug", "(", "\"List of beans to notify:\"", "+", "listeners", ")", ";", "return", "listeners", ";", "}" ]
Construct the list of all the beans we need to update. @param beanType Type of bean to locate @return List of all beans to udpate.
[ "Construct", "the", "list", "of", "all", "the", "beans", "we", "need", "to", "update", "." ]
6aad6e640b348cda8f3b0841f6e42025233f1eb8
https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/security/SecurityAwareConfigurer.java#L126-L147
11,940
lievendoclo/Valkyrie-RCP
valkyrie-rcp-core/src/main/java/org/valkyriercp/security/SecurityAwareConfigurer.java
SecurityAwareConfigurer.getNonSingletonListeners
protected List getNonSingletonListeners(Class beanType) { final List listeners = new ArrayList(); synchronized(nonSingletonListeners) { for( Iterator iter = nonSingletonListeners.iterator(); iter.hasNext(); ) { final Object bean = ((WeakReference) iter.next()).get(); if( bean == null ) { if( logger.isDebugEnabled() ) logger.debug( "REMOVED garbage collected AuthorizationAware non-singleton from list." ); iter.remove(); } else if( beanType.isAssignableFrom( bean.getClass() ) ) { listeners.add( bean ); } } } return listeners; }
java
protected List getNonSingletonListeners(Class beanType) { final List listeners = new ArrayList(); synchronized(nonSingletonListeners) { for( Iterator iter = nonSingletonListeners.iterator(); iter.hasNext(); ) { final Object bean = ((WeakReference) iter.next()).get(); if( bean == null ) { if( logger.isDebugEnabled() ) logger.debug( "REMOVED garbage collected AuthorizationAware non-singleton from list." ); iter.remove(); } else if( beanType.isAssignableFrom( bean.getClass() ) ) { listeners.add( bean ); } } } return listeners; }
[ "protected", "List", "getNonSingletonListeners", "(", "Class", "beanType", ")", "{", "final", "List", "listeners", "=", "new", "ArrayList", "(", ")", ";", "synchronized", "(", "nonSingletonListeners", ")", "{", "for", "(", "Iterator", "iter", "=", "nonSingletonListeners", ".", "iterator", "(", ")", ";", "iter", ".", "hasNext", "(", ")", ";", ")", "{", "final", "Object", "bean", "=", "(", "(", "WeakReference", ")", "iter", ".", "next", "(", ")", ")", ".", "get", "(", ")", ";", "if", "(", "bean", "==", "null", ")", "{", "if", "(", "logger", ".", "isDebugEnabled", "(", ")", ")", "logger", ".", "debug", "(", "\"REMOVED garbage collected AuthorizationAware non-singleton from list.\"", ")", ";", "iter", ".", "remove", "(", ")", ";", "}", "else", "if", "(", "beanType", ".", "isAssignableFrom", "(", "bean", ".", "getClass", "(", ")", ")", ")", "{", "listeners", ".", "add", "(", "bean", ")", ";", "}", "}", "}", "return", "listeners", ";", "}" ]
Get the list of non-singleton beans we have registered that still exist. Update our registration list if any have been GC'ed. Only return beans of the requested type. @param beanType Type of bean to locate @return list of extant non-singleton beans to notify
[ "Get", "the", "list", "of", "non", "-", "singleton", "beans", "we", "have", "registered", "that", "still", "exist", ".", "Update", "our", "registration", "list", "if", "any", "have", "been", "GC", "ed", ".", "Only", "return", "beans", "of", "the", "requested", "type", "." ]
6aad6e640b348cda8f3b0841f6e42025233f1eb8
https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/security/SecurityAwareConfigurer.java#L155-L172
11,941
lievendoclo/Valkyrie-RCP
valkyrie-rcp-core/src/main/java/org/valkyriercp/security/SecurityAwareConfigurer.java
SecurityAwareConfigurer.addToNonSingletonListeners
protected void addToNonSingletonListeners(final Object bean) { if( logger.isDebugEnabled() ) logger.debug( "Adding Authentication/LoginAware bean to list of non-singleton listeners: bean='" + bean ); nonSingletonListeners.add( new WeakReference( bean ) ); }
java
protected void addToNonSingletonListeners(final Object bean) { if( logger.isDebugEnabled() ) logger.debug( "Adding Authentication/LoginAware bean to list of non-singleton listeners: bean='" + bean ); nonSingletonListeners.add( new WeakReference( bean ) ); }
[ "protected", "void", "addToNonSingletonListeners", "(", "final", "Object", "bean", ")", "{", "if", "(", "logger", ".", "isDebugEnabled", "(", ")", ")", "logger", ".", "debug", "(", "\"Adding Authentication/LoginAware bean to list of non-singleton listeners: bean='\"", "+", "bean", ")", ";", "nonSingletonListeners", ".", "add", "(", "new", "WeakReference", "(", "bean", ")", ")", ";", "}" ]
Add a non-singleton bean instance to our list for later notification. @param bean
[ "Add", "a", "non", "-", "singleton", "bean", "instance", "to", "our", "list", "for", "later", "notification", "." ]
6aad6e640b348cda8f3b0841f6e42025233f1eb8
https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/security/SecurityAwareConfigurer.java#L178-L183
11,942
lievendoclo/Valkyrie-RCP
valkyrie-rcp-core/src/main/java/org/valkyriercp/dialog/CompositeDialogPage.java
CompositeDialogPage.addPage
public void addPage(DialogPage page) { pages.add(page); if (autoConfigureChildPages) { String id = getId() + "." + page.getId(); ValkyrieRepository.getInstance().getApplicationConfig().applicationObjectConfigurer().configure(page, id); } }
java
public void addPage(DialogPage page) { pages.add(page); if (autoConfigureChildPages) { String id = getId() + "." + page.getId(); ValkyrieRepository.getInstance().getApplicationConfig().applicationObjectConfigurer().configure(page, id); } }
[ "public", "void", "addPage", "(", "DialogPage", "page", ")", "{", "pages", ".", "add", "(", "page", ")", ";", "if", "(", "autoConfigureChildPages", ")", "{", "String", "id", "=", "getId", "(", ")", "+", "\".\"", "+", "page", ".", "getId", "(", ")", ";", "ValkyrieRepository", ".", "getInstance", "(", ")", ".", "getApplicationConfig", "(", ")", ".", "applicationObjectConfigurer", "(", ")", ".", "configure", "(", "page", ",", "id", ")", ";", "}", "}" ]
Adds a DialogPage to the list of pages managed by this CompositeDialogPage. @param page the page to add
[ "Adds", "a", "DialogPage", "to", "the", "list", "of", "pages", "managed", "by", "this", "CompositeDialogPage", "." ]
6aad6e640b348cda8f3b0841f6e42025233f1eb8
https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/dialog/CompositeDialogPage.java#L87-L93
11,943
lievendoclo/Valkyrie-RCP
valkyrie-rcp-core/src/main/java/org/valkyriercp/dialog/CompositeDialogPage.java
CompositeDialogPage.addForm
public DialogPage addForm(Form form) { DialogPage page = createDialogPage(form); addPage(page); return page; }
java
public DialogPage addForm(Form form) { DialogPage page = createDialogPage(form); addPage(page); return page; }
[ "public", "DialogPage", "addForm", "(", "Form", "form", ")", "{", "DialogPage", "page", "=", "createDialogPage", "(", "form", ")", ";", "addPage", "(", "page", ")", ";", "return", "page", ";", "}" ]
Adds a new page to the list of pages managed by this CompositeDialogPage. The page is created by wrapping the form page in a FormBackedDialogPage. @param form the form page to be insterted @return the DialogPage that wraps formPage
[ "Adds", "a", "new", "page", "to", "the", "list", "of", "pages", "managed", "by", "this", "CompositeDialogPage", ".", "The", "page", "is", "created", "by", "wrapping", "the", "form", "page", "in", "a", "FormBackedDialogPage", "." ]
6aad6e640b348cda8f3b0841f6e42025233f1eb8
https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/dialog/CompositeDialogPage.java#L102-L106
11,944
lievendoclo/Valkyrie-RCP
valkyrie-rcp-core/src/main/java/org/valkyriercp/dialog/CompositeDialogPage.java
CompositeDialogPage.addPages
public void addPages(DialogPage[] pages) { for (int i = 0; i < pages.length; i++) { addPage(pages[i]); } }
java
public void addPages(DialogPage[] pages) { for (int i = 0; i < pages.length; i++) { addPage(pages[i]); } }
[ "public", "void", "addPages", "(", "DialogPage", "[", "]", "pages", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "pages", ".", "length", ";", "i", "++", ")", "{", "addPage", "(", "pages", "[", "i", "]", ")", ";", "}", "}" ]
Adds an array DialogPage to the list of pages managed by this CompositeDialogPage. @param pages the pages to add
[ "Adds", "an", "array", "DialogPage", "to", "the", "list", "of", "pages", "managed", "by", "this", "CompositeDialogPage", "." ]
6aad6e640b348cda8f3b0841f6e42025233f1eb8
https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/dialog/CompositeDialogPage.java#L114-L118
11,945
lievendoclo/Valkyrie-RCP
valkyrie-rcp-core/src/main/java/org/valkyriercp/dialog/CompositeDialogPage.java
CompositeDialogPage.setActivePage
public void setActivePage(DialogPage activePage) { DialogPage oldPage = this.activePage; Assert.isTrue(activePage == null || pages.contains(activePage)); if (oldPage == activePage) { return; } this.activePage = activePage; updateMessage(); if (oldPage != null) { updatePageLabels(oldPage); } if (activePage != null) { updatePageLabels(activePage); } }
java
public void setActivePage(DialogPage activePage) { DialogPage oldPage = this.activePage; Assert.isTrue(activePage == null || pages.contains(activePage)); if (oldPage == activePage) { return; } this.activePage = activePage; updateMessage(); if (oldPage != null) { updatePageLabels(oldPage); } if (activePage != null) { updatePageLabels(activePage); } }
[ "public", "void", "setActivePage", "(", "DialogPage", "activePage", ")", "{", "DialogPage", "oldPage", "=", "this", ".", "activePage", ";", "Assert", ".", "isTrue", "(", "activePage", "==", "null", "||", "pages", ".", "contains", "(", "activePage", ")", ")", ";", "if", "(", "oldPage", "==", "activePage", ")", "{", "return", ";", "}", "this", ".", "activePage", "=", "activePage", ";", "updateMessage", "(", ")", ";", "if", "(", "oldPage", "!=", "null", ")", "{", "updatePageLabels", "(", "oldPage", ")", ";", "}", "if", "(", "activePage", "!=", "null", ")", "{", "updatePageLabels", "(", "activePage", ")", ";", "}", "}" ]
Sets the active page of this CompositeDialogPage. @param activePage the page to be made active. Must be one of the child pages.
[ "Sets", "the", "active", "page", "of", "this", "CompositeDialogPage", "." ]
6aad6e640b348cda8f3b0841f6e42025233f1eb8
https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/dialog/CompositeDialogPage.java#L138-L154
11,946
lievendoclo/Valkyrie-RCP
valkyrie-rcp-core/src/main/java/org/valkyriercp/dialog/CompositeDialogPage.java
CompositeDialogPage.prepareDialogPage
protected void prepareDialogPage(DialogPage page) { page.addPropertyChangeListener(childChangeHandler); JComponent c = page.getControl(); GuiStandardUtils.attachDialogBorder(c); Dimension size = c.getPreferredSize(); if (size.width > largestPageWidth) { largestPageWidth = size.width; } if (size.height > largestPageHeight) { largestPageHeight = size.height; } }
java
protected void prepareDialogPage(DialogPage page) { page.addPropertyChangeListener(childChangeHandler); JComponent c = page.getControl(); GuiStandardUtils.attachDialogBorder(c); Dimension size = c.getPreferredSize(); if (size.width > largestPageWidth) { largestPageWidth = size.width; } if (size.height > largestPageHeight) { largestPageHeight = size.height; } }
[ "protected", "void", "prepareDialogPage", "(", "DialogPage", "page", ")", "{", "page", ".", "addPropertyChangeListener", "(", "childChangeHandler", ")", ";", "JComponent", "c", "=", "page", ".", "getControl", "(", ")", ";", "GuiStandardUtils", ".", "attachDialogBorder", "(", "c", ")", ";", "Dimension", "size", "=", "c", ".", "getPreferredSize", "(", ")", ";", "if", "(", "size", ".", "width", ">", "largestPageWidth", ")", "{", "largestPageWidth", "=", "size", ".", "width", ";", "}", "if", "(", "size", ".", "height", ">", "largestPageHeight", ")", "{", "largestPageHeight", "=", "size", ".", "height", ";", "}", "}" ]
Prepare a dialog page - Add our property listeners and configure the control's look. @param page to process
[ "Prepare", "a", "dialog", "page", "-", "Add", "our", "property", "listeners", "and", "configure", "the", "control", "s", "look", "." ]
6aad6e640b348cda8f3b0841f6e42025233f1eb8
https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/dialog/CompositeDialogPage.java#L183-L194
11,947
lievendoclo/Valkyrie-RCP
valkyrie-rcp-core/src/main/java/org/valkyriercp/binding/form/support/AbstractFormModel.java
AbstractFormModel.prepareValueModel
protected void prepareValueModel(ValueModel valueModel) { if (valueModel instanceof BufferedValueModel) { ((BufferedValueModel) valueModel).setCommitTrigger(commitTrigger); } // If the value model that we were built on is "dirty trackable" then we // need to monitor it for changes in its dirty state if (valueModel instanceof DirtyTrackingValueModel) { ((DirtyTrackingValueModel) valueModel).addPropertyChangeListener(DIRTY_PROPERTY, childStateChangeHandler); } }
java
protected void prepareValueModel(ValueModel valueModel) { if (valueModel instanceof BufferedValueModel) { ((BufferedValueModel) valueModel).setCommitTrigger(commitTrigger); } // If the value model that we were built on is "dirty trackable" then we // need to monitor it for changes in its dirty state if (valueModel instanceof DirtyTrackingValueModel) { ((DirtyTrackingValueModel) valueModel).addPropertyChangeListener(DIRTY_PROPERTY, childStateChangeHandler); } }
[ "protected", "void", "prepareValueModel", "(", "ValueModel", "valueModel", ")", "{", "if", "(", "valueModel", "instanceof", "BufferedValueModel", ")", "{", "(", "(", "BufferedValueModel", ")", "valueModel", ")", ".", "setCommitTrigger", "(", "commitTrigger", ")", ";", "}", "// If the value model that we were built on is \"dirty trackable\" then we", "// need to monitor it for changes in its dirty state", "if", "(", "valueModel", "instanceof", "DirtyTrackingValueModel", ")", "{", "(", "(", "DirtyTrackingValueModel", ")", "valueModel", ")", ".", "addPropertyChangeListener", "(", "DIRTY_PROPERTY", ",", "childStateChangeHandler", ")", ";", "}", "}" ]
Prepare the provided value model for use in this form model. @param valueModel to prepare
[ "Prepare", "the", "provided", "value", "model", "for", "use", "in", "this", "form", "model", "." ]
6aad6e640b348cda8f3b0841f6e42025233f1eb8
https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/binding/form/support/AbstractFormModel.java#L143-L153
11,948
lievendoclo/Valkyrie-RCP
valkyrie-rcp-core/src/main/java/org/valkyriercp/binding/form/support/AbstractFormModel.java
AbstractFormModel.setDeliverValueChangeEvents
private void setDeliverValueChangeEvents(boolean enable) { formObjectHolder.setDeliverValueChangeEvents(enable); for (Object o : mediatingValueModels.values()) { FormModelMediatingValueModel valueModel = (FormModelMediatingValueModel) o; valueModel.setDeliverValueChangeEvents(enable); } }
java
private void setDeliverValueChangeEvents(boolean enable) { formObjectHolder.setDeliverValueChangeEvents(enable); for (Object o : mediatingValueModels.values()) { FormModelMediatingValueModel valueModel = (FormModelMediatingValueModel) o; valueModel.setDeliverValueChangeEvents(enable); } }
[ "private", "void", "setDeliverValueChangeEvents", "(", "boolean", "enable", ")", "{", "formObjectHolder", ".", "setDeliverValueChangeEvents", "(", "enable", ")", ";", "for", "(", "Object", "o", ":", "mediatingValueModels", ".", "values", "(", ")", ")", "{", "FormModelMediatingValueModel", "valueModel", "=", "(", "FormModelMediatingValueModel", ")", "o", ";", "valueModel", ".", "setDeliverValueChangeEvents", "(", "enable", ")", ";", "}", "}" ]
Disconnect view from data in MediatingValueModels @param enable <code>true</code> if events should be delivered.
[ "Disconnect", "view", "from", "data", "in", "MediatingValueModels" ]
6aad6e640b348cda8f3b0841f6e42025233f1eb8
https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/binding/form/support/AbstractFormModel.java#L189-L195
11,949
lievendoclo/Valkyrie-RCP
valkyrie-rcp-core/src/main/java/org/valkyriercp/binding/form/support/AbstractFormModel.java
AbstractFormModel.addChild
public void addChild(HierarchicalFormModel child) { Assert.notNull(child, "child"); if (child.getParent() == this) return; Assert.isTrue(child.getParent() == null, "Child form model '" + child + "' already has a parent"); child.setParent(this); children.add(child); child.addPropertyChangeListener(DIRTY_PROPERTY, childStateChangeHandler); child.addPropertyChangeListener(COMMITTABLE_PROPERTY, childStateChangeHandler); if (child.isDirty()) { dirtyValueAndFormModels.add(child); dirtyUpdated(); } }
java
public void addChild(HierarchicalFormModel child) { Assert.notNull(child, "child"); if (child.getParent() == this) return; Assert.isTrue(child.getParent() == null, "Child form model '" + child + "' already has a parent"); child.setParent(this); children.add(child); child.addPropertyChangeListener(DIRTY_PROPERTY, childStateChangeHandler); child.addPropertyChangeListener(COMMITTABLE_PROPERTY, childStateChangeHandler); if (child.isDirty()) { dirtyValueAndFormModels.add(child); dirtyUpdated(); } }
[ "public", "void", "addChild", "(", "HierarchicalFormModel", "child", ")", "{", "Assert", ".", "notNull", "(", "child", ",", "\"child\"", ")", ";", "if", "(", "child", ".", "getParent", "(", ")", "==", "this", ")", "return", ";", "Assert", ".", "isTrue", "(", "child", ".", "getParent", "(", ")", "==", "null", ",", "\"Child form model '\"", "+", "child", "+", "\"' already has a parent\"", ")", ";", "child", ".", "setParent", "(", "this", ")", ";", "children", ".", "add", "(", "child", ")", ";", "child", ".", "addPropertyChangeListener", "(", "DIRTY_PROPERTY", ",", "childStateChangeHandler", ")", ";", "child", ".", "addPropertyChangeListener", "(", "COMMITTABLE_PROPERTY", ",", "childStateChangeHandler", ")", ";", "if", "(", "child", ".", "isDirty", "(", ")", ")", "{", "dirtyValueAndFormModels", ".", "add", "(", "child", ")", ";", "dirtyUpdated", "(", ")", ";", "}", "}" ]
Add child to this FormModel. Dirty and committable changes are forwarded to parent model. @param child FormModel to add as child.
[ "Add", "child", "to", "this", "FormModel", ".", "Dirty", "and", "committable", "changes", "are", "forwarded", "to", "parent", "model", "." ]
6aad6e640b348cda8f3b0841f6e42025233f1eb8
https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/binding/form/support/AbstractFormModel.java#L278-L292
11,950
lievendoclo/Valkyrie-RCP
valkyrie-rcp-core/src/main/java/org/valkyriercp/binding/form/support/AbstractFormModel.java
AbstractFormModel.removeChild
public void removeChild(HierarchicalFormModel child) { Assert.notNull(child, "child"); child.removeParent(); children.remove(child); child.removePropertyChangeListener(DIRTY_PROPERTY, childStateChangeHandler); child.removePropertyChangeListener(COMMITTABLE_PROPERTY, childStateChangeHandler); // when dynamically adding/removing childModels take care of // dirtymessages: // removing child that was dirty: remove from dirty map and update dirty // state if (dirtyValueAndFormModels.remove(child)) dirtyUpdated(); }
java
public void removeChild(HierarchicalFormModel child) { Assert.notNull(child, "child"); child.removeParent(); children.remove(child); child.removePropertyChangeListener(DIRTY_PROPERTY, childStateChangeHandler); child.removePropertyChangeListener(COMMITTABLE_PROPERTY, childStateChangeHandler); // when dynamically adding/removing childModels take care of // dirtymessages: // removing child that was dirty: remove from dirty map and update dirty // state if (dirtyValueAndFormModels.remove(child)) dirtyUpdated(); }
[ "public", "void", "removeChild", "(", "HierarchicalFormModel", "child", ")", "{", "Assert", ".", "notNull", "(", "child", ",", "\"child\"", ")", ";", "child", ".", "removeParent", "(", ")", ";", "children", ".", "remove", "(", "child", ")", ";", "child", ".", "removePropertyChangeListener", "(", "DIRTY_PROPERTY", ",", "childStateChangeHandler", ")", ";", "child", ".", "removePropertyChangeListener", "(", "COMMITTABLE_PROPERTY", ",", "childStateChangeHandler", ")", ";", "// when dynamically adding/removing childModels take care of", "// dirtymessages:", "// removing child that was dirty: remove from dirty map and update dirty", "// state", "if", "(", "dirtyValueAndFormModels", ".", "remove", "(", "child", ")", ")", "dirtyUpdated", "(", ")", ";", "}" ]
Remove a child FormModel. Dirty and committable listeners are removed. When child was dirty, remove the formModel from the dirty list and update the dirty state. @param child FormModel to remove from childlist.
[ "Remove", "a", "child", "FormModel", ".", "Dirty", "and", "committable", "listeners", "are", "removed", ".", "When", "child", "was", "dirty", "remove", "the", "formModel", "from", "the", "dirty", "list", "and", "update", "the", "dirty", "state", "." ]
6aad6e640b348cda8f3b0841f6e42025233f1eb8
https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/binding/form/support/AbstractFormModel.java#L300-L312
11,951
lievendoclo/Valkyrie-RCP
valkyrie-rcp-core/src/main/java/org/valkyriercp/binding/form/support/AbstractFormModel.java
AbstractFormModel.createValueModel
protected ValueModel createValueModel(String formProperty) { Assert.notNull(formProperty, "formProperty"); if (logger.isDebugEnabled()) { logger.debug("Creating " + (buffered ? "buffered" : "") + " value model for form property '" + formProperty + "'."); } return buffered ? new BufferedValueModel(propertyAccessStrategy.getPropertyValueModel(formProperty)) : propertyAccessStrategy.getPropertyValueModel(formProperty); }
java
protected ValueModel createValueModel(String formProperty) { Assert.notNull(formProperty, "formProperty"); if (logger.isDebugEnabled()) { logger.debug("Creating " + (buffered ? "buffered" : "") + " value model for form property '" + formProperty + "'."); } return buffered ? new BufferedValueModel(propertyAccessStrategy.getPropertyValueModel(formProperty)) : propertyAccessStrategy.getPropertyValueModel(formProperty); }
[ "protected", "ValueModel", "createValueModel", "(", "String", "formProperty", ")", "{", "Assert", ".", "notNull", "(", "formProperty", ",", "\"formProperty\"", ")", ";", "if", "(", "logger", ".", "isDebugEnabled", "(", ")", ")", "{", "logger", ".", "debug", "(", "\"Creating \"", "+", "(", "buffered", "?", "\"buffered\"", ":", "\"\"", ")", "+", "\" value model for form property '\"", "+", "formProperty", "+", "\"'.\"", ")", ";", "}", "return", "buffered", "?", "new", "BufferedValueModel", "(", "propertyAccessStrategy", ".", "getPropertyValueModel", "(", "formProperty", ")", ")", ":", "propertyAccessStrategy", ".", "getPropertyValueModel", "(", "formProperty", ")", ";", "}" ]
Creates a new value mode for the the given property. Usually delegates to the underlying property access strategy but subclasses may provide alternative value model creation strategies.
[ "Creates", "a", "new", "value", "mode", "for", "the", "the", "given", "property", ".", "Usually", "delegates", "to", "the", "underlying", "property", "access", "strategy", "but", "subclasses", "may", "provide", "alternative", "value", "model", "creation", "strategies", "." ]
6aad6e640b348cda8f3b0841f6e42025233f1eb8
https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/binding/form/support/AbstractFormModel.java#L341-L349
11,952
lievendoclo/Valkyrie-RCP
valkyrie-rcp-core/src/main/java/org/valkyriercp/binding/form/support/AbstractFormModel.java
AbstractFormModel.registerPropertyConverter
public void registerPropertyConverter(String propertyName, Converter toConverter, Converter fromConverter) { DefaultConversionService propertyConversionService = (DefaultConversionService) propertyConversionServices .get(propertyName); propertyConversionService.addConverter(toConverter); propertyConversionService.addConverter(fromConverter); }
java
public void registerPropertyConverter(String propertyName, Converter toConverter, Converter fromConverter) { DefaultConversionService propertyConversionService = (DefaultConversionService) propertyConversionServices .get(propertyName); propertyConversionService.addConverter(toConverter); propertyConversionService.addConverter(fromConverter); }
[ "public", "void", "registerPropertyConverter", "(", "String", "propertyName", ",", "Converter", "toConverter", ",", "Converter", "fromConverter", ")", "{", "DefaultConversionService", "propertyConversionService", "=", "(", "DefaultConversionService", ")", "propertyConversionServices", ".", "get", "(", "propertyName", ")", ";", "propertyConversionService", ".", "addConverter", "(", "toConverter", ")", ";", "propertyConversionService", ".", "addConverter", "(", "fromConverter", ")", ";", "}" ]
Register converters for a given property name. @param propertyName name of property on which to register converters @param toConverter Convert from source to target type @param fromConverter Convert from target to source type
[ "Register", "converters", "for", "a", "given", "property", "name", "." ]
6aad6e640b348cda8f3b0841f6e42025233f1eb8
https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/binding/form/support/AbstractFormModel.java#L406-L411
11,953
lievendoclo/Valkyrie-RCP
valkyrie-rcp-core/src/main/java/org/valkyriercp/binding/form/support/AbstractFormModel.java
AbstractFormModel.dirtyUpdated
protected void dirtyUpdated() { boolean dirty = isDirty(); if (hasChanged(oldDirty, dirty)) { oldDirty = dirty; firePropertyChange(DIRTY_PROPERTY, !dirty, dirty); } }
java
protected void dirtyUpdated() { boolean dirty = isDirty(); if (hasChanged(oldDirty, dirty)) { oldDirty = dirty; firePropertyChange(DIRTY_PROPERTY, !dirty, dirty); } }
[ "protected", "void", "dirtyUpdated", "(", ")", "{", "boolean", "dirty", "=", "isDirty", "(", ")", ";", "if", "(", "hasChanged", "(", "oldDirty", ",", "dirty", ")", ")", "{", "oldDirty", "=", "dirty", ";", "firePropertyChange", "(", "DIRTY_PROPERTY", ",", "!", "dirty", ",", "dirty", ")", ";", "}", "}" ]
Fires the necessary property change event for changes to the dirty property. Must be called whenever the value of dirty is changed.
[ "Fires", "the", "necessary", "property", "change", "event", "for", "changes", "to", "the", "dirty", "property", ".", "Must", "be", "called", "whenever", "the", "value", "of", "dirty", "is", "changed", "." ]
6aad6e640b348cda8f3b0841f6e42025233f1eb8
https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/binding/form/support/AbstractFormModel.java#L633-L639
11,954
lievendoclo/Valkyrie-RCP
valkyrie-rcp-core/src/main/java/org/valkyriercp/binding/form/support/AbstractFormModel.java
AbstractFormModel.readOnlyUpdated
protected void readOnlyUpdated() { boolean localReadOnly = isReadOnly(); if (hasChanged(oldReadOnly, localReadOnly)) { oldReadOnly = localReadOnly; firePropertyChange(READONLY_PROPERTY, !localReadOnly, localReadOnly); } }
java
protected void readOnlyUpdated() { boolean localReadOnly = isReadOnly(); if (hasChanged(oldReadOnly, localReadOnly)) { oldReadOnly = localReadOnly; firePropertyChange(READONLY_PROPERTY, !localReadOnly, localReadOnly); } }
[ "protected", "void", "readOnlyUpdated", "(", ")", "{", "boolean", "localReadOnly", "=", "isReadOnly", "(", ")", ";", "if", "(", "hasChanged", "(", "oldReadOnly", ",", "localReadOnly", ")", ")", "{", "oldReadOnly", "=", "localReadOnly", ";", "firePropertyChange", "(", "READONLY_PROPERTY", ",", "!", "localReadOnly", ",", "localReadOnly", ")", ";", "}", "}" ]
Fires the necessary property change event for changes to the readOnly property. Must be called whenever the value of readOnly is changed.
[ "Fires", "the", "necessary", "property", "change", "event", "for", "changes", "to", "the", "readOnly", "property", ".", "Must", "be", "called", "whenever", "the", "value", "of", "readOnly", "is", "changed", "." ]
6aad6e640b348cda8f3b0841f6e42025233f1eb8
https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/binding/form/support/AbstractFormModel.java#L673-L679
11,955
lievendoclo/Valkyrie-RCP
valkyrie-rcp-core/src/main/java/org/valkyriercp/binding/form/support/AbstractFormModel.java
AbstractFormModel.enabledUpdated
protected void enabledUpdated() { boolean enabled = isEnabled(); if (hasChanged(oldEnabled, enabled)) { oldEnabled = enabled; firePropertyChange(ENABLED_PROPERTY, !enabled, enabled); } }
java
protected void enabledUpdated() { boolean enabled = isEnabled(); if (hasChanged(oldEnabled, enabled)) { oldEnabled = enabled; firePropertyChange(ENABLED_PROPERTY, !enabled, enabled); } }
[ "protected", "void", "enabledUpdated", "(", ")", "{", "boolean", "enabled", "=", "isEnabled", "(", ")", ";", "if", "(", "hasChanged", "(", "oldEnabled", ",", "enabled", ")", ")", "{", "oldEnabled", "=", "enabled", ";", "firePropertyChange", "(", "ENABLED_PROPERTY", ",", "!", "enabled", ",", "enabled", ")", ";", "}", "}" ]
Fires the necessary property change event for changes to the enabled property. Must be called whenever the value of enabled is changed.
[ "Fires", "the", "necessary", "property", "change", "event", "for", "changes", "to", "the", "enabled", "property", ".", "Must", "be", "called", "whenever", "the", "value", "of", "enabled", "is", "changed", "." ]
6aad6e640b348cda8f3b0841f6e42025233f1eb8
https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/binding/form/support/AbstractFormModel.java#L694-L700
11,956
lievendoclo/Valkyrie-RCP
valkyrie-rcp-core/src/main/java/org/valkyriercp/binding/form/support/AbstractFormModel.java
AbstractFormModel.committableUpdated
protected void committableUpdated() { boolean committable = isCommittable(); if (hasChanged(oldCommittable, committable)) { oldCommittable = committable; firePropertyChange(COMMITTABLE_PROPERTY, !committable, committable); } }
java
protected void committableUpdated() { boolean committable = isCommittable(); if (hasChanged(oldCommittable, committable)) { oldCommittable = committable; firePropertyChange(COMMITTABLE_PROPERTY, !committable, committable); } }
[ "protected", "void", "committableUpdated", "(", ")", "{", "boolean", "committable", "=", "isCommittable", "(", ")", ";", "if", "(", "hasChanged", "(", "oldCommittable", ",", "committable", ")", ")", "{", "oldCommittable", "=", "committable", ";", "firePropertyChange", "(", "COMMITTABLE_PROPERTY", ",", "!", "committable", ",", "committable", ")", ";", "}", "}" ]
Fires the necessary property change event for changes to the committable property. Must be called whenever the value of committable is changed.
[ "Fires", "the", "necessary", "property", "change", "event", "for", "changes", "to", "the", "committable", "property", ".", "Must", "be", "called", "whenever", "the", "value", "of", "committable", "is", "changed", "." ]
6aad6e640b348cda8f3b0841f6e42025233f1eb8
https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/binding/form/support/AbstractFormModel.java#L716-L722
11,957
lievendoclo/Valkyrie-RCP
valkyrie-rcp-core/src/main/java/org/valkyriercp/form/binding/swing/SwingBindingFactory.java
SwingBindingFactory.createBoundListModel
public ObservableList createBoundListModel(String formProperty) { final ConfigurableFormModel formModel = ((ConfigurableFormModel)getFormModel()); ValueModel valueModel = formModel.getValueModel(formProperty); if (!(valueModel instanceof BufferedCollectionValueModel)) { // XXX: HACK! valueModel = new BufferedCollectionValueModel((((DefaultFormModel) formModel).getFormObjectPropertyAccessStrategy()).getPropertyValueModel( formProperty), formModel.getFieldMetadata(formProperty).getPropertyType()); formModel.add(formProperty, valueModel); } return (ObservableList)valueModel.getValue(); }
java
public ObservableList createBoundListModel(String formProperty) { final ConfigurableFormModel formModel = ((ConfigurableFormModel)getFormModel()); ValueModel valueModel = formModel.getValueModel(formProperty); if (!(valueModel instanceof BufferedCollectionValueModel)) { // XXX: HACK! valueModel = new BufferedCollectionValueModel((((DefaultFormModel) formModel).getFormObjectPropertyAccessStrategy()).getPropertyValueModel( formProperty), formModel.getFieldMetadata(formProperty).getPropertyType()); formModel.add(formProperty, valueModel); } return (ObservableList)valueModel.getValue(); }
[ "public", "ObservableList", "createBoundListModel", "(", "String", "formProperty", ")", "{", "final", "ConfigurableFormModel", "formModel", "=", "(", "(", "ConfigurableFormModel", ")", "getFormModel", "(", ")", ")", ";", "ValueModel", "valueModel", "=", "formModel", ".", "getValueModel", "(", "formProperty", ")", ";", "if", "(", "!", "(", "valueModel", "instanceof", "BufferedCollectionValueModel", ")", ")", "{", "// XXX: HACK!", "valueModel", "=", "new", "BufferedCollectionValueModel", "(", "(", "(", "(", "DefaultFormModel", ")", "formModel", ")", ".", "getFormObjectPropertyAccessStrategy", "(", ")", ")", ".", "getPropertyValueModel", "(", "formProperty", ")", ",", "formModel", ".", "getFieldMetadata", "(", "formProperty", ")", ".", "getPropertyType", "(", ")", ")", ";", "formModel", ".", "add", "(", "formProperty", ",", "valueModel", ")", ";", "}", "return", "(", "ObservableList", ")", "valueModel", ".", "getValue", "(", ")", ";", "}" ]
This method will most likely move over to FormModel @deprecated
[ "This", "method", "will", "most", "likely", "move", "over", "to", "FormModel" ]
6aad6e640b348cda8f3b0841f6e42025233f1eb8
https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/form/binding/swing/SwingBindingFactory.java#L133-L143
11,958
lievendoclo/Valkyrie-RCP
valkyrie-rcp-core/src/main/java/org/valkyriercp/form/binding/swing/SwingBindingFactory.java
SwingBindingFactory.createBinding
public Binding createBinding(String propertyPath, String binderId, Map context) { Assert.notNull(context, "Context must not be null"); Binder binder = ((SwingBinderSelectionStrategy)getBinderSelectionStrategy()).getIdBoundBinder(binderId); Binding binding = binder.bind(getFormModel(), propertyPath, context); interceptBinding(binding); return binding; }
java
public Binding createBinding(String propertyPath, String binderId, Map context) { Assert.notNull(context, "Context must not be null"); Binder binder = ((SwingBinderSelectionStrategy)getBinderSelectionStrategy()).getIdBoundBinder(binderId); Binding binding = binder.bind(getFormModel(), propertyPath, context); interceptBinding(binding); return binding; }
[ "public", "Binding", "createBinding", "(", "String", "propertyPath", ",", "String", "binderId", ",", "Map", "context", ")", "{", "Assert", ".", "notNull", "(", "context", ",", "\"Context must not be null\"", ")", ";", "Binder", "binder", "=", "(", "(", "SwingBinderSelectionStrategy", ")", "getBinderSelectionStrategy", "(", ")", ")", ".", "getIdBoundBinder", "(", "binderId", ")", ";", "Binding", "binding", "=", "binder", ".", "bind", "(", "getFormModel", "(", ")", ",", "propertyPath", ",", "context", ")", ";", "interceptBinding", "(", "binding", ")", ";", "return", "binding", ";", "}" ]
Create a binding based on a specific binder id. @param propertyPath Path to property @param binderId Id of the binder @param context Context data (can be empty map) @return Specific binding
[ "Create", "a", "binding", "based", "on", "a", "specific", "binder", "id", "." ]
6aad6e640b348cda8f3b0841f6e42025233f1eb8
https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/form/binding/swing/SwingBindingFactory.java#L434-L441
11,959
stanfy/goro
goro/src/main/java/com/stanfy/enroscar/goro/Goro.java
Goro.from
public static Goro from(final IBinder binder) { if (binder instanceof GoroService.GoroBinder) { return ((GoroService.GoroBinder) binder).goro(); } throw new IllegalArgumentException("Cannot get Goro from " + binder); }
java
public static Goro from(final IBinder binder) { if (binder instanceof GoroService.GoroBinder) { return ((GoroService.GoroBinder) binder).goro(); } throw new IllegalArgumentException("Cannot get Goro from " + binder); }
[ "public", "static", "Goro", "from", "(", "final", "IBinder", "binder", ")", "{", "if", "(", "binder", "instanceof", "GoroService", ".", "GoroBinder", ")", "{", "return", "(", "(", "GoroService", ".", "GoroBinder", ")", "binder", ")", ".", "goro", "(", ")", ";", "}", "throw", "new", "IllegalArgumentException", "(", "\"Cannot get Goro from \"", "+", "binder", ")", ";", "}" ]
Gives access to Goro instance that is provided by a service. @param binder Goro service binder @return Goro instance provided by the service
[ "Gives", "access", "to", "Goro", "instance", "that", "is", "provided", "by", "a", "service", "." ]
6618e63a926833d61f492ec611ee77668d756820
https://github.com/stanfy/goro/blob/6618e63a926833d61f492ec611ee77668d756820/goro/src/main/java/com/stanfy/enroscar/goro/Goro.java#L24-L29
11,960
stanfy/goro
goro/src/main/java/com/stanfy/enroscar/goro/Goro.java
Goro.createWithDelegate
public static Goro createWithDelegate(final Executor delegateExecutor) { GoroImpl goro = new GoroImpl(); goro.queues.setDelegateExecutor(delegateExecutor); return goro; }
java
public static Goro createWithDelegate(final Executor delegateExecutor) { GoroImpl goro = new GoroImpl(); goro.queues.setDelegateExecutor(delegateExecutor); return goro; }
[ "public", "static", "Goro", "createWithDelegate", "(", "final", "Executor", "delegateExecutor", ")", "{", "GoroImpl", "goro", "=", "new", "GoroImpl", "(", ")", ";", "goro", ".", "queues", ".", "setDelegateExecutor", "(", "delegateExecutor", ")", ";", "return", "goro", ";", "}" ]
Creates a new Goro instance which uses the specified executor to delegate tasks. @param delegateExecutor executor Goro delegates tasks to @return instance of Goro
[ "Creates", "a", "new", "Goro", "instance", "which", "uses", "the", "specified", "executor", "to", "delegate", "tasks", "." ]
6618e63a926833d61f492ec611ee77668d756820
https://github.com/stanfy/goro/blob/6618e63a926833d61f492ec611ee77668d756820/goro/src/main/java/com/stanfy/enroscar/goro/Goro.java#L46-L50
11,961
lievendoclo/Valkyrie-RCP
valkyrie-rcp-core/src/main/java/org/valkyriercp/command/support/ButtonStackGroupContainerPopulator.java
ButtonStackGroupContainerPopulator.addCustomGridded
private void addCustomGridded(AbstractButton button) { builder.getLayout().appendRow(this.rowSpec); builder.getLayout().addGroupedRow(builder.getRow()); button.putClientProperty("jgoodies.isNarrow", Boolean.TRUE); builder.add(button); builder.nextRow(); }
java
private void addCustomGridded(AbstractButton button) { builder.getLayout().appendRow(this.rowSpec); builder.getLayout().addGroupedRow(builder.getRow()); button.putClientProperty("jgoodies.isNarrow", Boolean.TRUE); builder.add(button); builder.nextRow(); }
[ "private", "void", "addCustomGridded", "(", "AbstractButton", "button", ")", "{", "builder", ".", "getLayout", "(", ")", ".", "appendRow", "(", "this", ".", "rowSpec", ")", ";", "builder", ".", "getLayout", "(", ")", ".", "addGroupedRow", "(", "builder", ".", "getRow", "(", ")", ")", ";", "button", ".", "putClientProperty", "(", "\"jgoodies.isNarrow\"", ",", "Boolean", ".", "TRUE", ")", ";", "builder", ".", "add", "(", "button", ")", ";", "builder", ".", "nextRow", "(", ")", ";", "}" ]
Handle the custom RowSpec. @param button
[ "Handle", "the", "custom", "RowSpec", "." ]
6aad6e640b348cda8f3b0841f6e42025233f1eb8
https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/command/support/ButtonStackGroupContainerPopulator.java#L137-L143
11,962
lievendoclo/Valkyrie-RCP
valkyrie-rcp-samples/valkyrie-rcp-simple-sample/src/main/java/org/valkyriercp/sample/simple/domain/ContactDataStore.java
ContactDataStore.loadData
private void loadData() { contacts.add(makeContact("Larry", "Streepy", "123 Some St.", "Apt. #26C", "New York", "NY", "10010", ContactType.BUSINESS, "Lorem ipsum...")); contacts.add(makeContact("Keith", "Donald", "456 WebFlow Rd.", "2", "Cooltown", "NY", "10001", ContactType.BUSINESS, "Lorem ipsum...")); contacts.add(makeContact("Steve", "Brothers", "10921 The Other Street", "", "Denver", "CO", "81234-2121", ContactType.PERSONAL, "Lorem ipsum...")); contacts.add(makeContact("Carlos", "Mencia", "4321 Comedy Central", "", "Hollywood", "CA", "91020", ContactType.PERSONAL, "Lorem ipsum...")); contacts.add(makeContact("Jim", "Jones", "1001 Another Place", "", "Dallas", "TX", "71212", ContactType.PERSONAL, "Lorem ipsum...")); contacts.add(makeContact("Jenny", "Jones", "1001 Another Place", "", "Dallas", "TX", "75201", ContactType.PERSONAL, "Lorem ipsum...")); contacts.add(makeContact("Greg", "Jones", "9 Some Other Place", "Apt. 12D", "Chicago", "IL", "60601", ContactType.PERSONAL, "Lorem ipsum...")); }
java
private void loadData() { contacts.add(makeContact("Larry", "Streepy", "123 Some St.", "Apt. #26C", "New York", "NY", "10010", ContactType.BUSINESS, "Lorem ipsum...")); contacts.add(makeContact("Keith", "Donald", "456 WebFlow Rd.", "2", "Cooltown", "NY", "10001", ContactType.BUSINESS, "Lorem ipsum...")); contacts.add(makeContact("Steve", "Brothers", "10921 The Other Street", "", "Denver", "CO", "81234-2121", ContactType.PERSONAL, "Lorem ipsum...")); contacts.add(makeContact("Carlos", "Mencia", "4321 Comedy Central", "", "Hollywood", "CA", "91020", ContactType.PERSONAL, "Lorem ipsum...")); contacts.add(makeContact("Jim", "Jones", "1001 Another Place", "", "Dallas", "TX", "71212", ContactType.PERSONAL, "Lorem ipsum...")); contacts.add(makeContact("Jenny", "Jones", "1001 Another Place", "", "Dallas", "TX", "75201", ContactType.PERSONAL, "Lorem ipsum...")); contacts.add(makeContact("Greg", "Jones", "9 Some Other Place", "Apt. 12D", "Chicago", "IL", "60601", ContactType.PERSONAL, "Lorem ipsum...")); }
[ "private", "void", "loadData", "(", ")", "{", "contacts", ".", "add", "(", "makeContact", "(", "\"Larry\"", ",", "\"Streepy\"", ",", "\"123 Some St.\"", ",", "\"Apt. #26C\"", ",", "\"New York\"", ",", "\"NY\"", ",", "\"10010\"", ",", "ContactType", ".", "BUSINESS", ",", "\"Lorem ipsum...\"", ")", ")", ";", "contacts", ".", "add", "(", "makeContact", "(", "\"Keith\"", ",", "\"Donald\"", ",", "\"456 WebFlow Rd.\"", ",", "\"2\"", ",", "\"Cooltown\"", ",", "\"NY\"", ",", "\"10001\"", ",", "ContactType", ".", "BUSINESS", ",", "\"Lorem ipsum...\"", ")", ")", ";", "contacts", ".", "add", "(", "makeContact", "(", "\"Steve\"", ",", "\"Brothers\"", ",", "\"10921 The Other Street\"", ",", "\"\"", ",", "\"Denver\"", ",", "\"CO\"", ",", "\"81234-2121\"", ",", "ContactType", ".", "PERSONAL", ",", "\"Lorem ipsum...\"", ")", ")", ";", "contacts", ".", "add", "(", "makeContact", "(", "\"Carlos\"", ",", "\"Mencia\"", ",", "\"4321 Comedy Central\"", ",", "\"\"", ",", "\"Hollywood\"", ",", "\"CA\"", ",", "\"91020\"", ",", "ContactType", ".", "PERSONAL", ",", "\"Lorem ipsum...\"", ")", ")", ";", "contacts", ".", "add", "(", "makeContact", "(", "\"Jim\"", ",", "\"Jones\"", ",", "\"1001 Another Place\"", ",", "\"\"", ",", "\"Dallas\"", ",", "\"TX\"", ",", "\"71212\"", ",", "ContactType", ".", "PERSONAL", ",", "\"Lorem ipsum...\"", ")", ")", ";", "contacts", ".", "add", "(", "makeContact", "(", "\"Jenny\"", ",", "\"Jones\"", ",", "\"1001 Another Place\"", ",", "\"\"", ",", "\"Dallas\"", ",", "\"TX\"", ",", "\"75201\"", ",", "ContactType", ".", "PERSONAL", ",", "\"Lorem ipsum...\"", ")", ")", ";", "contacts", ".", "add", "(", "makeContact", "(", "\"Greg\"", ",", "\"Jones\"", ",", "\"9 Some Other Place\"", ",", "\"Apt. 12D\"", ",", "\"Chicago\"", ",", "\"IL\"", ",", "\"60601\"", ",", "ContactType", ".", "PERSONAL", ",", "\"Lorem ipsum...\"", ")", ")", ";", "}" ]
Load our initial data.
[ "Load", "our", "initial", "data", "." ]
6aad6e640b348cda8f3b0841f6e42025233f1eb8
https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-samples/valkyrie-rcp-simple-sample/src/main/java/org/valkyriercp/sample/simple/domain/ContactDataStore.java#L76-L91
11,963
lievendoclo/Valkyrie-RCP
valkyrie-rcp-samples/valkyrie-rcp-simple-sample/src/main/java/org/valkyriercp/sample/simple/domain/ContactDataStore.java
ContactDataStore.makeContact
private Contact makeContact(String first, String last, String address1, String address2, String city, String state, String zip, ContactType contactType, String memo) { Contact contact = new Contact(); contact.setId(nextId++); contact.setContactType(contactType); contact.setFirstName(first); contact.setLastName(last); contact.setMemo(memo); Address address = contact.getAddress(); address.setAddress1(address1); address.setAddress2(address2); address.setCity(city); address.setState(state); address.setZip(zip); contact.setTodoItems(getTodoItemList()); return contact; }
java
private Contact makeContact(String first, String last, String address1, String address2, String city, String state, String zip, ContactType contactType, String memo) { Contact contact = new Contact(); contact.setId(nextId++); contact.setContactType(contactType); contact.setFirstName(first); contact.setLastName(last); contact.setMemo(memo); Address address = contact.getAddress(); address.setAddress1(address1); address.setAddress2(address2); address.setCity(city); address.setState(state); address.setZip(zip); contact.setTodoItems(getTodoItemList()); return contact; }
[ "private", "Contact", "makeContact", "(", "String", "first", ",", "String", "last", ",", "String", "address1", ",", "String", "address2", ",", "String", "city", ",", "String", "state", ",", "String", "zip", ",", "ContactType", "contactType", ",", "String", "memo", ")", "{", "Contact", "contact", "=", "new", "Contact", "(", ")", ";", "contact", ".", "setId", "(", "nextId", "++", ")", ";", "contact", ".", "setContactType", "(", "contactType", ")", ";", "contact", ".", "setFirstName", "(", "first", ")", ";", "contact", ".", "setLastName", "(", "last", ")", ";", "contact", ".", "setMemo", "(", "memo", ")", ";", "Address", "address", "=", "contact", ".", "getAddress", "(", ")", ";", "address", ".", "setAddress1", "(", "address1", ")", ";", "address", ".", "setAddress2", "(", "address2", ")", ";", "address", ".", "setCity", "(", "city", ")", ";", "address", ".", "setState", "(", "state", ")", ";", "address", ".", "setZip", "(", "zip", ")", ";", "contact", ".", "setTodoItems", "(", "getTodoItemList", "(", ")", ")", ";", "return", "contact", ";", "}" ]
Make a Contact object with the given data. @return Contact object
[ "Make", "a", "Contact", "object", "with", "the", "given", "data", "." ]
6aad6e640b348cda8f3b0841f6e42025233f1eb8
https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-samples/valkyrie-rcp-simple-sample/src/main/java/org/valkyriercp/sample/simple/domain/ContactDataStore.java#L104-L123
11,964
lievendoclo/Valkyrie-RCP
valkyrie-rcp-core/src/main/java/org/valkyriercp/command/support/CommandGroup.java
CommandGroup.execute
public void execute() { Iterator it = memberList.iterator(); while (it.hasNext()) { GroupMember member = (GroupMember) it.next(); member.getCommand().execute(); } }
java
public void execute() { Iterator it = memberList.iterator(); while (it.hasNext()) { GroupMember member = (GroupMember) it.next(); member.getCommand().execute(); } }
[ "public", "void", "execute", "(", ")", "{", "Iterator", "it", "=", "memberList", ".", "iterator", "(", ")", ";", "while", "(", "it", ".", "hasNext", "(", ")", ")", "{", "GroupMember", "member", "=", "(", "GroupMember", ")", "it", ".", "next", "(", ")", ";", "member", ".", "getCommand", "(", ")", ".", "execute", "(", ")", ";", "}", "}" ]
Executes all the members of this group.
[ "Executes", "all", "the", "members", "of", "this", "group", "." ]
6aad6e640b348cda8f3b0841f6e42025233f1eb8
https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/command/support/CommandGroup.java#L320-L326
11,965
lievendoclo/Valkyrie-RCP
valkyrie-rcp-core/src/main/java/org/valkyriercp/command/support/CommandGroup.java
CommandGroup.createButtonBar
public JComponent createButtonBar(Size minimumButtonSize) { return createButtonBar(minimumButtonSize, GuiStandardUtils.createTopAndBottomBorder(UIConstants.TWO_SPACES)); }
java
public JComponent createButtonBar(Size minimumButtonSize) { return createButtonBar(minimumButtonSize, GuiStandardUtils.createTopAndBottomBorder(UIConstants.TWO_SPACES)); }
[ "public", "JComponent", "createButtonBar", "(", "Size", "minimumButtonSize", ")", "{", "return", "createButtonBar", "(", "minimumButtonSize", ",", "GuiStandardUtils", ".", "createTopAndBottomBorder", "(", "UIConstants", ".", "TWO_SPACES", ")", ")", ";", "}" ]
Create a button bar with buttons for all the commands in this group. Adds a border top and bottom of 2 spaces. @param minimumButtonSize if null, then there is no minimum size @return never null
[ "Create", "a", "button", "bar", "with", "buttons", "for", "all", "the", "commands", "in", "this", "group", ".", "Adds", "a", "border", "top", "and", "bottom", "of", "2", "spaces", "." ]
6aad6e640b348cda8f3b0841f6e42025233f1eb8
https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/command/support/CommandGroup.java#L434-L436
11,966
lievendoclo/Valkyrie-RCP
valkyrie-rcp-core/src/main/java/org/valkyriercp/command/support/CommandGroup.java
CommandGroup.createButtonStack
public JComponent createButtonStack(final Size minimumButtonSize) { return createButtonStack(minimumButtonSize, GuiStandardUtils.createLeftAndRightBorder(UIConstants.TWO_SPACES)); }
java
public JComponent createButtonStack(final Size minimumButtonSize) { return createButtonStack(minimumButtonSize, GuiStandardUtils.createLeftAndRightBorder(UIConstants.TWO_SPACES)); }
[ "public", "JComponent", "createButtonStack", "(", "final", "Size", "minimumButtonSize", ")", "{", "return", "createButtonStack", "(", "minimumButtonSize", ",", "GuiStandardUtils", ".", "createLeftAndRightBorder", "(", "UIConstants", ".", "TWO_SPACES", ")", ")", ";", "}" ]
Create a button stack with buttons for all the commands. Adds a border left and right of 2 spaces. @param minimumButtonSize Minimum size of the buttons (can be null) @return never null
[ "Create", "a", "button", "stack", "with", "buttons", "for", "all", "the", "commands", ".", "Adds", "a", "border", "left", "and", "right", "of", "2", "spaces", "." ]
6aad6e640b348cda8f3b0841f6e42025233f1eb8
https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/command/support/CommandGroup.java#L496-L498
11,967
lievendoclo/Valkyrie-RCP
valkyrie-rcp-core/src/main/java/org/valkyriercp/command/support/CommandGroup.java
CommandGroup.addCommandsToGroupContainer
protected void addCommandsToGroupContainer(final GroupContainerPopulator groupContainerPopulator) { final Iterator members = getMemberList().iterator(); while (members.hasNext()) { final GroupMember member = (GroupMember) members.next(); if (member.getCommand() instanceof CommandGroup) { member.fill(groupContainerPopulator, getButtonFactory(), getPullDownMenuButtonConfigurer(), Collections.EMPTY_LIST); } else { member.fill(groupContainerPopulator, getButtonFactory(), getDefaultButtonConfigurer(), Collections.EMPTY_LIST); } } groupContainerPopulator.onPopulated(); }
java
protected void addCommandsToGroupContainer(final GroupContainerPopulator groupContainerPopulator) { final Iterator members = getMemberList().iterator(); while (members.hasNext()) { final GroupMember member = (GroupMember) members.next(); if (member.getCommand() instanceof CommandGroup) { member.fill(groupContainerPopulator, getButtonFactory(), getPullDownMenuButtonConfigurer(), Collections.EMPTY_LIST); } else { member.fill(groupContainerPopulator, getButtonFactory(), getDefaultButtonConfigurer(), Collections.EMPTY_LIST); } } groupContainerPopulator.onPopulated(); }
[ "protected", "void", "addCommandsToGroupContainer", "(", "final", "GroupContainerPopulator", "groupContainerPopulator", ")", "{", "final", "Iterator", "members", "=", "getMemberList", "(", ")", ".", "iterator", "(", ")", ";", "while", "(", "members", ".", "hasNext", "(", ")", ")", "{", "final", "GroupMember", "member", "=", "(", "GroupMember", ")", "members", ".", "next", "(", ")", ";", "if", "(", "member", ".", "getCommand", "(", ")", "instanceof", "CommandGroup", ")", "{", "member", ".", "fill", "(", "groupContainerPopulator", ",", "getButtonFactory", "(", ")", ",", "getPullDownMenuButtonConfigurer", "(", ")", ",", "Collections", ".", "EMPTY_LIST", ")", ";", "}", "else", "{", "member", ".", "fill", "(", "groupContainerPopulator", ",", "getButtonFactory", "(", ")", ",", "getDefaultButtonConfigurer", "(", ")", ",", "Collections", ".", "EMPTY_LIST", ")", ";", "}", "}", "groupContainerPopulator", ".", "onPopulated", "(", ")", ";", "}" ]
Create a container with the given GroupContainerPopulator which will hold the members of this group. @param groupContainerPopulator
[ "Create", "a", "container", "with", "the", "given", "GroupContainerPopulator", "which", "will", "hold", "the", "members", "of", "this", "group", "." ]
6aad6e640b348cda8f3b0841f6e42025233f1eb8
https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/command/support/CommandGroup.java#L549-L564
11,968
lievendoclo/Valkyrie-RCP
valkyrie-rcp-core/src/main/java/org/valkyriercp/security/support/DefaultSecurityControllerManager.java
DefaultSecurityControllerManager.getSecurityController
public SecurityController getSecurityController(String id) { SecurityController sc = (SecurityController) securityControllerMap.get( id ); if( sc == null ) { // Try for a named bean try { sc = applicationContext.getBean( id, SecurityController.class ); } catch( NoSuchBeanDefinitionException e ) { // Try for a fallback sc = getFallbackSecurityController(); } } return sc; }
java
public SecurityController getSecurityController(String id) { SecurityController sc = (SecurityController) securityControllerMap.get( id ); if( sc == null ) { // Try for a named bean try { sc = applicationContext.getBean( id, SecurityController.class ); } catch( NoSuchBeanDefinitionException e ) { // Try for a fallback sc = getFallbackSecurityController(); } } return sc; }
[ "public", "SecurityController", "getSecurityController", "(", "String", "id", ")", "{", "SecurityController", "sc", "=", "(", "SecurityController", ")", "securityControllerMap", ".", "get", "(", "id", ")", ";", "if", "(", "sc", "==", "null", ")", "{", "// Try for a named bean", "try", "{", "sc", "=", "applicationContext", ".", "getBean", "(", "id", ",", "SecurityController", ".", "class", ")", ";", "}", "catch", "(", "NoSuchBeanDefinitionException", "e", ")", "{", "// Try for a fallback", "sc", "=", "getFallbackSecurityController", "(", ")", ";", "}", "}", "return", "sc", ";", "}" ]
Get the security controller for the given id. If the id is registered in our map, then return the registered controller. If not, then try to obtain a bean with the given id if it implements the SecurityController interface. @param id of controller to retrieve @return controller, null if not found
[ "Get", "the", "security", "controller", "for", "the", "given", "id", ".", "If", "the", "id", "is", "registered", "in", "our", "map", "then", "return", "the", "registered", "controller", ".", "If", "not", "then", "try", "to", "obtain", "a", "bean", "with", "the", "given", "id", "if", "it", "implements", "the", "SecurityController", "interface", "." ]
6aad6e640b348cda8f3b0841f6e42025233f1eb8
https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/security/support/DefaultSecurityControllerManager.java#L55-L68
11,969
lievendoclo/Valkyrie-RCP
valkyrie-rcp-core/src/main/java/org/valkyriercp/rules/closure/support/Minimum.java
Minimum.call
public Object call(Object comparable1, Object comparable2) { int result = COMPARATOR.compare(comparable1, comparable2); if (result < 0) { return comparable1; } else if (result > 0) { return comparable2; } return comparable1; }
java
public Object call(Object comparable1, Object comparable2) { int result = COMPARATOR.compare(comparable1, comparable2); if (result < 0) { return comparable1; } else if (result > 0) { return comparable2; } return comparable1; }
[ "public", "Object", "call", "(", "Object", "comparable1", ",", "Object", "comparable2", ")", "{", "int", "result", "=", "COMPARATOR", ".", "compare", "(", "comparable1", ",", "comparable2", ")", ";", "if", "(", "result", "<", "0", ")", "{", "return", "comparable1", ";", "}", "else", "if", "(", "result", ">", "0", ")", "{", "return", "comparable2", ";", "}", "return", "comparable1", ";", "}" ]
Return the minimum of two Comparable objects. @param comparable1 the first comparable @param comparable2 the second comparable @return the minimum
[ "Return", "the", "minimum", "of", "two", "Comparable", "objects", "." ]
6aad6e640b348cda8f3b0841f6e42025233f1eb8
https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/rules/closure/support/Minimum.java#L53-L63
11,970
lievendoclo/Valkyrie-RCP
valkyrie-rcp-core/src/main/java/org/valkyriercp/form/builder/AbstractFormComponentInterceptor.java
AbstractFormComponentInterceptor.getInnerComponent
protected JComponent getInnerComponent(JComponent component) { if (component instanceof JScrollPane) { return getInnerComponent((JComponent) ((JScrollPane) component).getViewport().getView()); } if (component instanceof HasInnerComponent) { return getInnerComponent(((HasInnerComponent) component).getInnerComponent()); } return component; }
java
protected JComponent getInnerComponent(JComponent component) { if (component instanceof JScrollPane) { return getInnerComponent((JComponent) ((JScrollPane) component).getViewport().getView()); } if (component instanceof HasInnerComponent) { return getInnerComponent(((HasInnerComponent) component).getInnerComponent()); } return component; }
[ "protected", "JComponent", "getInnerComponent", "(", "JComponent", "component", ")", "{", "if", "(", "component", "instanceof", "JScrollPane", ")", "{", "return", "getInnerComponent", "(", "(", "JComponent", ")", "(", "(", "JScrollPane", ")", "component", ")", ".", "getViewport", "(", ")", ".", "getView", "(", ")", ")", ";", "}", "if", "(", "component", "instanceof", "HasInnerComponent", ")", "{", "return", "getInnerComponent", "(", "(", "(", "HasInnerComponent", ")", "component", ")", ".", "getInnerComponent", "(", ")", ")", ";", "}", "return", "component", ";", "}" ]
Check for JScrollPane. @param component @return the component itself, or the inner component if it was a JScrollPane.
[ "Check", "for", "JScrollPane", "." ]
6aad6e640b348cda8f3b0841f6e42025233f1eb8
https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/form/builder/AbstractFormComponentInterceptor.java#L63-L70
11,971
lievendoclo/Valkyrie-RCP
valkyrie-rcp-core/src/main/java/org/valkyriercp/widget/table/PropertyColumn.java
PropertyColumn.getHeader
public String getHeader() { if (this.header == null) { if (this.headerKeys == null) { this.headerKeys = new String[2]; this.headerKeys[0] = getPropertyName() + ".header"; this.headerKeys[1] = getPropertyName(); } this.header = ValkyrieRepository.getInstance().getApplicationConfig().messageResolver().getMessage(new DefaultMessageSourceResolvable(this.headerKeys, null, this.headerKeys[this.headerKeys.length - 1])); } // JTableHeader has a reusable defaultHeaderRenderer on which the default height must be correct. // when painting, the columns headers are processed in order and height is being calculated, // if label is null or empty string header height is 4 and thus leaves us with a very small // table-header, fix this by returning a space (-> font-size is incorporated) return "".equals(this.header) ? " " : this.header; }
java
public String getHeader() { if (this.header == null) { if (this.headerKeys == null) { this.headerKeys = new String[2]; this.headerKeys[0] = getPropertyName() + ".header"; this.headerKeys[1] = getPropertyName(); } this.header = ValkyrieRepository.getInstance().getApplicationConfig().messageResolver().getMessage(new DefaultMessageSourceResolvable(this.headerKeys, null, this.headerKeys[this.headerKeys.length - 1])); } // JTableHeader has a reusable defaultHeaderRenderer on which the default height must be correct. // when painting, the columns headers are processed in order and height is being calculated, // if label is null or empty string header height is 4 and thus leaves us with a very small // table-header, fix this by returning a space (-> font-size is incorporated) return "".equals(this.header) ? " " : this.header; }
[ "public", "String", "getHeader", "(", ")", "{", "if", "(", "this", ".", "header", "==", "null", ")", "{", "if", "(", "this", ".", "headerKeys", "==", "null", ")", "{", "this", ".", "headerKeys", "=", "new", "String", "[", "2", "]", ";", "this", ".", "headerKeys", "[", "0", "]", "=", "getPropertyName", "(", ")", "+", "\".header\"", ";", "this", ".", "headerKeys", "[", "1", "]", "=", "getPropertyName", "(", ")", ";", "}", "this", ".", "header", "=", "ValkyrieRepository", ".", "getInstance", "(", ")", ".", "getApplicationConfig", "(", ")", ".", "messageResolver", "(", ")", ".", "getMessage", "(", "new", "DefaultMessageSourceResolvable", "(", "this", ".", "headerKeys", ",", "null", ",", "this", ".", "headerKeys", "[", "this", ".", "headerKeys", ".", "length", "-", "1", "]", ")", ")", ";", "}", "// JTableHeader has a reusable defaultHeaderRenderer on which the default height must be correct.", "// when painting, the columns headers are processed in order and height is being calculated, ", "// if label is null or empty string header height is 4 and thus leaves us with a very small", "// table-header, fix this by returning a space (-> font-size is incorporated)", "return", "\"\"", ".", "equals", "(", "this", ".", "header", ")", "?", "\" \"", ":", "this", ".", "header", ";", "}" ]
Returns the header to be used as column title. If no explicit header was set, the headerKeys are used to fetch a message from the available resources.
[ "Returns", "the", "header", "to", "be", "used", "as", "column", "title", ".", "If", "no", "explicit", "header", "was", "set", "the", "headerKeys", "are", "used", "to", "fetch", "a", "message", "from", "the", "available", "resources", "." ]
6aad6e640b348cda8f3b0841f6e42025233f1eb8
https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/widget/table/PropertyColumn.java#L150-L168
11,972
lievendoclo/Valkyrie-RCP
valkyrie-rcp-core/src/main/java/org/valkyriercp/command/support/SeparatorGroupMember.java
SeparatorGroupMember.fill
protected void fill(GroupContainerPopulator container, Object factory, CommandButtonConfigurer configurer, List previousButtons) { container.addSeparator(); }
java
protected void fill(GroupContainerPopulator container, Object factory, CommandButtonConfigurer configurer, List previousButtons) { container.addSeparator(); }
[ "protected", "void", "fill", "(", "GroupContainerPopulator", "container", ",", "Object", "factory", ",", "CommandButtonConfigurer", "configurer", ",", "List", "previousButtons", ")", "{", "container", ".", "addSeparator", "(", ")", ";", "}" ]
Asks the given container populator to add a separator to its underlying container.
[ "Asks", "the", "given", "container", "populator", "to", "add", "a", "separator", "to", "its", "underlying", "container", "." ]
6aad6e640b348cda8f3b0841f6e42025233f1eb8
https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/command/support/SeparatorGroupMember.java#L38-L43
11,973
stanfy/goro
goro/src/main/java/com/stanfy/enroscar/goro/GoroService.java
GoroService.taskIntent
public static <T extends Callable<?> & Parcelable> Intent taskIntent(final Context context, final T task) { return taskIntent(context, Goro.DEFAULT_QUEUE, task); }
java
public static <T extends Callable<?> & Parcelable> Intent taskIntent(final Context context, final T task) { return taskIntent(context, Goro.DEFAULT_QUEUE, task); }
[ "public", "static", "<", "T", "extends", "Callable", "<", "?", ">", "&", "Parcelable", ">", "Intent", "taskIntent", "(", "final", "Context", "context", ",", "final", "T", "task", ")", "{", "return", "taskIntent", "(", "context", ",", "Goro", ".", "DEFAULT_QUEUE", ",", "task", ")", ";", "}" ]
Create an intent that contains a task that should be scheduled on a default queue. @param context context instance @param task task instance @param <T> task type @see #taskIntent(android.content.Context, String, java.util.concurrent.Callable)
[ "Create", "an", "intent", "that", "contains", "a", "task", "that", "should", "be", "scheduled", "on", "a", "default", "queue", "." ]
6618e63a926833d61f492ec611ee77668d756820
https://github.com/stanfy/goro/blob/6618e63a926833d61f492ec611ee77668d756820/goro/src/main/java/com/stanfy/enroscar/goro/GoroService.java#L197-L200
11,974
stanfy/goro
goro/src/main/java/com/stanfy/enroscar/goro/GoroService.java
GoroService.bind
public static void bind(final Context context, final ServiceConnection connection) { Intent serviceIntent = new Intent(context, GoroService.class); if (context.startService(serviceIntent) == null) { throw new GoroException("Service " + GoroService.class + " does not seem to be included to your manifest file"); } boolean bound = context.bindService(serviceIntent, connection, 0); if (!bound) { throw new GoroException("Cannot bind to GoroService though this component seems to " + "be registered in the app manifest"); } }
java
public static void bind(final Context context, final ServiceConnection connection) { Intent serviceIntent = new Intent(context, GoroService.class); if (context.startService(serviceIntent) == null) { throw new GoroException("Service " + GoroService.class + " does not seem to be included to your manifest file"); } boolean bound = context.bindService(serviceIntent, connection, 0); if (!bound) { throw new GoroException("Cannot bind to GoroService though this component seems to " + "be registered in the app manifest"); } }
[ "public", "static", "void", "bind", "(", "final", "Context", "context", ",", "final", "ServiceConnection", "connection", ")", "{", "Intent", "serviceIntent", "=", "new", "Intent", "(", "context", ",", "GoroService", ".", "class", ")", ";", "if", "(", "context", ".", "startService", "(", "serviceIntent", ")", "==", "null", ")", "{", "throw", "new", "GoroException", "(", "\"Service \"", "+", "GoroService", ".", "class", "+", "\" does not seem to be included to your manifest file\"", ")", ";", "}", "boolean", "bound", "=", "context", ".", "bindService", "(", "serviceIntent", ",", "connection", ",", "0", ")", ";", "if", "(", "!", "bound", ")", "{", "throw", "new", "GoroException", "(", "\"Cannot bind to GoroService though this component seems to \"", "+", "\"be registered in the app manifest\"", ")", ";", "}", "}" ]
Bind to Goro service. This method will start the service and then bind to it. @param context context that is binding to the service @param connection service connection callbacks @throws GoroException when service is not declared in the application manifest
[ "Bind", "to", "Goro", "service", ".", "This", "method", "will", "start", "the", "service", "and", "then", "bind", "to", "it", "." ]
6618e63a926833d61f492ec611ee77668d756820
https://github.com/stanfy/goro/blob/6618e63a926833d61f492ec611ee77668d756820/goro/src/main/java/com/stanfy/enroscar/goro/GoroService.java#L208-L219
11,975
lievendoclo/Valkyrie-RCP
valkyrie-rcp-core/src/main/java/org/valkyriercp/application/config/support/DefaultApplicationObjectConfigurer.java
DefaultApplicationObjectConfigurer.configure
public void configure(Object object, String objectName) { if (object == null) { logger.debug("object to be configured is null"); return; } Assert.notNull(objectName, "objectName"); if (object instanceof TitleConfigurable) { configureTitle((TitleConfigurable) object, objectName); } if (object instanceof LabelConfigurable) { configureLabel((LabelConfigurable) object, objectName); } if (object instanceof ColorConfigurable) { configureColor((ColorConfigurable)object, objectName); } if (object instanceof CommandLabelConfigurable) { configureCommandLabel((CommandLabelConfigurable) object, objectName); } if (object instanceof DescriptionConfigurable) { configureDescription((DescriptionConfigurable) object, objectName); } if (object instanceof ImageConfigurable) { configureImage((ImageConfigurable) object, objectName); } if (object instanceof IconConfigurable) { configureIcon((IconConfigurable) object, objectName); } if (object instanceof CommandIconConfigurable) { configureCommandIcons((CommandIconConfigurable) object, objectName); } if (object instanceof Secured) { configureSecurityController((Secured) object, objectName); } }
java
public void configure(Object object, String objectName) { if (object == null) { logger.debug("object to be configured is null"); return; } Assert.notNull(objectName, "objectName"); if (object instanceof TitleConfigurable) { configureTitle((TitleConfigurable) object, objectName); } if (object instanceof LabelConfigurable) { configureLabel((LabelConfigurable) object, objectName); } if (object instanceof ColorConfigurable) { configureColor((ColorConfigurable)object, objectName); } if (object instanceof CommandLabelConfigurable) { configureCommandLabel((CommandLabelConfigurable) object, objectName); } if (object instanceof DescriptionConfigurable) { configureDescription((DescriptionConfigurable) object, objectName); } if (object instanceof ImageConfigurable) { configureImage((ImageConfigurable) object, objectName); } if (object instanceof IconConfigurable) { configureIcon((IconConfigurable) object, objectName); } if (object instanceof CommandIconConfigurable) { configureCommandIcons((CommandIconConfigurable) object, objectName); } if (object instanceof Secured) { configureSecurityController((Secured) object, objectName); } }
[ "public", "void", "configure", "(", "Object", "object", ",", "String", "objectName", ")", "{", "if", "(", "object", "==", "null", ")", "{", "logger", ".", "debug", "(", "\"object to be configured is null\"", ")", ";", "return", ";", "}", "Assert", ".", "notNull", "(", "objectName", ",", "\"objectName\"", ")", ";", "if", "(", "object", "instanceof", "TitleConfigurable", ")", "{", "configureTitle", "(", "(", "TitleConfigurable", ")", "object", ",", "objectName", ")", ";", "}", "if", "(", "object", "instanceof", "LabelConfigurable", ")", "{", "configureLabel", "(", "(", "LabelConfigurable", ")", "object", ",", "objectName", ")", ";", "}", "if", "(", "object", "instanceof", "ColorConfigurable", ")", "{", "configureColor", "(", "(", "ColorConfigurable", ")", "object", ",", "objectName", ")", ";", "}", "if", "(", "object", "instanceof", "CommandLabelConfigurable", ")", "{", "configureCommandLabel", "(", "(", "CommandLabelConfigurable", ")", "object", ",", "objectName", ")", ";", "}", "if", "(", "object", "instanceof", "DescriptionConfigurable", ")", "{", "configureDescription", "(", "(", "DescriptionConfigurable", ")", "object", ",", "objectName", ")", ";", "}", "if", "(", "object", "instanceof", "ImageConfigurable", ")", "{", "configureImage", "(", "(", "ImageConfigurable", ")", "object", ",", "objectName", ")", ";", "}", "if", "(", "object", "instanceof", "IconConfigurable", ")", "{", "configureIcon", "(", "(", "IconConfigurable", ")", "object", ",", "objectName", ")", ";", "}", "if", "(", "object", "instanceof", "CommandIconConfigurable", ")", "{", "configureCommandIcons", "(", "(", "CommandIconConfigurable", ")", "object", ",", "objectName", ")", ";", "}", "if", "(", "object", "instanceof", "Secured", ")", "{", "configureSecurityController", "(", "(", "Secured", ")", "object", ",", "objectName", ")", ";", "}", "}" ]
Configures the given object according to the interfaces that it implements. <p> This implementation forwards the object to the following overridable methods in the order listed. Subclasses can use these methods as hooks to modify the default configuration behaviour without having to override this method entirely. <ul> <li>{@link #configureTitle(TitleConfigurable, String)}</li> <li>{@link #configureLabel(LabelConfigurable, String)}</li> <li>{@link #configureCommandLabel(CommandLabelConfigurable, String)}</li> <li>{@link #configureDescription(DescriptionConfigurable, String)}</li> <li>{@link #configureImage(ImageConfigurable, String)}</li> <li>{@link #configureIcon(IconConfigurable, String)}</li> <li>{@link #configureCommandIcons(CommandIconConfigurable, String)}</li> <li>{@link #configureSecurityController(Secured, String)}</li> </ul> </p> @param object The object to be configured. May be null. @param objectName The name for the object, expected to be unique within the application. If {@code object} is not null, then {@code objectName} must also be non-null. @throws IllegalArgumentException if {@code object} is not null, but {@code objectName} is null.
[ "Configures", "the", "given", "object", "according", "to", "the", "interfaces", "that", "it", "implements", "." ]
6aad6e640b348cda8f3b0841f6e42025233f1eb8
https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/application/config/support/DefaultApplicationObjectConfigurer.java#L285-L330
11,976
lievendoclo/Valkyrie-RCP
valkyrie-rcp-core/src/main/java/org/valkyriercp/application/config/support/DefaultApplicationObjectConfigurer.java
DefaultApplicationObjectConfigurer.configureCommandIcons
protected void configureCommandIcons(CommandIconConfigurable configurable, String objectName) { Assert.notNull(configurable, "configurable"); Assert.notNull(objectName, "objectName"); setIconInfo(configurable, objectName, false); setIconInfo(configurable, objectName, true); }
java
protected void configureCommandIcons(CommandIconConfigurable configurable, String objectName) { Assert.notNull(configurable, "configurable"); Assert.notNull(objectName, "objectName"); setIconInfo(configurable, objectName, false); setIconInfo(configurable, objectName, true); }
[ "protected", "void", "configureCommandIcons", "(", "CommandIconConfigurable", "configurable", ",", "String", "objectName", ")", "{", "Assert", ".", "notNull", "(", "configurable", ",", "\"configurable\"", ")", ";", "Assert", ".", "notNull", "(", "objectName", ",", "\"objectName\"", ")", ";", "setIconInfo", "(", "configurable", ",", "objectName", ",", "false", ")", ";", "setIconInfo", "(", "configurable", ",", "objectName", ",", "true", ")", ";", "}" ]
Sets the icons of the given object. <p> The icons are loaded from this instance's {@link IconSource}. using a key in the format </p> <pre> &lt;objectName&gt;.someIconType </pre> <p> The keys used to retrieve large icons from the icon source are created by concatenating the given {@code objectName} with a dot (.), the text 'large' and then an icon type like so: </p> <pre> &lt;myObjectName&gt;.large.someIconType </pre> <p> If the icon source cannot find an icon under that key, the object's icon will be set to null. </p> <p> If the {@code loadOptionalIcons} flag is set to true (it is by default) all the following icon types will be used. If the flag is false, only the first will be used: </p> <ul> <li>{@value #ICON_KEY}</li> <li>{@value #SELECTED_ICON_KEY}</li> <li>{@value #ROLLOVER_ICON_KEY}</li> <li>{@value #DISABLED_ICON_KEY}</li> <li>{@value #PRESSED_ICON_KEY}</li> </ul> @param configurable The object to be configured. Must not be null. @param objectName The name of the configurable object, unique within the application. Must not be null. @throws IllegalArgumentException if either argument is null.
[ "Sets", "the", "icons", "of", "the", "given", "object", "." ]
6aad6e640b348cda8f3b0841f6e42025233f1eb8
https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/application/config/support/DefaultApplicationObjectConfigurer.java#L583-L588
11,977
lievendoclo/Valkyrie-RCP
valkyrie-rcp-core/src/main/java/org/valkyriercp/security/LoginForm.java
LoginForm.getAuthentication
public Authentication getAuthentication() { String username = getValueModel(LoginDetails.PROPERTY_USERNAME, String.class).getValue(); String password = getValueModel(LoginDetails.PROPERTY_PASSWORD, String.class).getValue(); return new UsernamePasswordAuthenticationToken( username, password ); }
java
public Authentication getAuthentication() { String username = getValueModel(LoginDetails.PROPERTY_USERNAME, String.class).getValue(); String password = getValueModel(LoginDetails.PROPERTY_PASSWORD, String.class).getValue(); return new UsernamePasswordAuthenticationToken( username, password ); }
[ "public", "Authentication", "getAuthentication", "(", ")", "{", "String", "username", "=", "getValueModel", "(", "LoginDetails", ".", "PROPERTY_USERNAME", ",", "String", ".", "class", ")", ".", "getValue", "(", ")", ";", "String", "password", "=", "getValueModel", "(", "LoginDetails", ".", "PROPERTY_PASSWORD", ",", "String", ".", "class", ")", ".", "getValue", "(", ")", ";", "return", "new", "UsernamePasswordAuthenticationToken", "(", "username", ",", "password", ")", ";", "}" ]
Get an Authentication token that contains the current username and password. @return authentication token
[ "Get", "an", "Authentication", "token", "that", "contains", "the", "current", "username", "and", "password", "." ]
6aad6e640b348cda8f3b0841f6e42025233f1eb8
https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/security/LoginForm.java#L58-L62
11,978
lievendoclo/Valkyrie-RCP
valkyrie-rcp-core/src/main/java/org/valkyriercp/security/LoginForm.java
LoginForm.createFormControl
protected JComponent createFormControl() { TableFormBuilder formBuilder = new TableFormBuilder( getBindingFactory() ); usernameField = formBuilder.add( LoginDetails.PROPERTY_USERNAME )[1]; formBuilder.row(); passwordField = formBuilder.addPasswordField( LoginDetails.PROPERTY_PASSWORD )[1]; return formBuilder.getForm(); }
java
protected JComponent createFormControl() { TableFormBuilder formBuilder = new TableFormBuilder( getBindingFactory() ); usernameField = formBuilder.add( LoginDetails.PROPERTY_USERNAME )[1]; formBuilder.row(); passwordField = formBuilder.addPasswordField( LoginDetails.PROPERTY_PASSWORD )[1]; return formBuilder.getForm(); }
[ "protected", "JComponent", "createFormControl", "(", ")", "{", "TableFormBuilder", "formBuilder", "=", "new", "TableFormBuilder", "(", "getBindingFactory", "(", ")", ")", ";", "usernameField", "=", "formBuilder", ".", "add", "(", "LoginDetails", ".", "PROPERTY_USERNAME", ")", "[", "1", "]", ";", "formBuilder", ".", "row", "(", ")", ";", "passwordField", "=", "formBuilder", ".", "addPasswordField", "(", "LoginDetails", ".", "PROPERTY_PASSWORD", ")", "[", "1", "]", ";", "return", "formBuilder", ".", "getForm", "(", ")", ";", "}" ]
Construct the form with the username and password fields.
[ "Construct", "the", "form", "with", "the", "username", "and", "password", "fields", "." ]
6aad6e640b348cda8f3b0841f6e42025233f1eb8
https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/security/LoginForm.java#L72-L78
11,979
lievendoclo/Valkyrie-RCP
valkyrie-rcp-core/src/main/java/org/valkyriercp/dialog/TabbedDialogPage.java
TabbedDialogPage.setActivePage
public void setActivePage(DialogPage page) { if (settingSelection) { return; } try { settingSelection = true; super.setActivePage(page); if (page != null) { Tab tab = (Tab) page2tab.get(page); tabbedPaneView.selectTab(tab); } } finally { settingSelection = false; } }
java
public void setActivePage(DialogPage page) { if (settingSelection) { return; } try { settingSelection = true; super.setActivePage(page); if (page != null) { Tab tab = (Tab) page2tab.get(page); tabbedPaneView.selectTab(tab); } } finally { settingSelection = false; } }
[ "public", "void", "setActivePage", "(", "DialogPage", "page", ")", "{", "if", "(", "settingSelection", ")", "{", "return", ";", "}", "try", "{", "settingSelection", "=", "true", ";", "super", ".", "setActivePage", "(", "page", ")", ";", "if", "(", "page", "!=", "null", ")", "{", "Tab", "tab", "=", "(", "Tab", ")", "page2tab", ".", "get", "(", "page", ")", ";", "tabbedPaneView", ".", "selectTab", "(", "tab", ")", ";", "}", "}", "finally", "{", "settingSelection", "=", "false", ";", "}", "}" ]
Sets the active page of this TabbedDialogPage. This method will also select the tab wich displays the new active page.
[ "Sets", "the", "active", "page", "of", "this", "TabbedDialogPage", ".", "This", "method", "will", "also", "select", "the", "tab", "wich", "displays", "the", "new", "active", "page", "." ]
6aad6e640b348cda8f3b0841f6e42025233f1eb8
https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/dialog/TabbedDialogPage.java#L117-L134
11,980
lievendoclo/Valkyrie-RCP
valkyrie-rcp-core/src/main/java/org/valkyriercp/form/AbstractForm.java
AbstractForm.init
protected void init() { FormModel model = createFormModel(); if(getId() == null) formId = model.getId(); if (model instanceof ValidatingFormModel) { ValidatingFormModel validatingFormModel = (ValidatingFormModel) model; setFormModel(validatingFormModel); } else { throw new IllegalArgumentException("Unsupported form model implementation " + formModel); } getApplicationConfig().applicationObjectConfigurer().configure(this, getId()); }
java
protected void init() { FormModel model = createFormModel(); if(getId() == null) formId = model.getId(); if (model instanceof ValidatingFormModel) { ValidatingFormModel validatingFormModel = (ValidatingFormModel) model; setFormModel(validatingFormModel); } else { throw new IllegalArgumentException("Unsupported form model implementation " + formModel); } getApplicationConfig().applicationObjectConfigurer().configure(this, getId()); }
[ "protected", "void", "init", "(", ")", "{", "FormModel", "model", "=", "createFormModel", "(", ")", ";", "if", "(", "getId", "(", ")", "==", "null", ")", "formId", "=", "model", ".", "getId", "(", ")", ";", "if", "(", "model", "instanceof", "ValidatingFormModel", ")", "{", "ValidatingFormModel", "validatingFormModel", "=", "(", "ValidatingFormModel", ")", "model", ";", "setFormModel", "(", "validatingFormModel", ")", ";", "}", "else", "{", "throw", "new", "IllegalArgumentException", "(", "\"Unsupported form model implementation \"", "+", "formModel", ")", ";", "}", "getApplicationConfig", "(", ")", ".", "applicationObjectConfigurer", "(", ")", ".", "configure", "(", "this", ",", "getId", "(", ")", ")", ";", "}" ]
Hook called when constructing the Form.
[ "Hook", "called", "when", "constructing", "the", "Form", "." ]
6aad6e640b348cda8f3b0841f6e42025233f1eb8
https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/form/AbstractForm.java#L122-L133
11,981
lievendoclo/Valkyrie-RCP
valkyrie-rcp-core/src/main/java/org/valkyriercp/rules/Rules.java
Rules.putPropertyConstraint
private void putPropertyConstraint(PropertyConstraint constraint) { And and = new And(); and.add(constraint); if (logger.isDebugEnabled()) { logger.debug("Putting constraint for property '" + constraint.getPropertyName() + "', constraint -> [" + constraint + "]"); } PropertyConstraint compoundConstraint = new CompoundPropertyConstraint(and); propertiesConstraints.put(constraint.getPropertyName(), compoundConstraint); orderedConstraints.add( compoundConstraint ); }
java
private void putPropertyConstraint(PropertyConstraint constraint) { And and = new And(); and.add(constraint); if (logger.isDebugEnabled()) { logger.debug("Putting constraint for property '" + constraint.getPropertyName() + "', constraint -> [" + constraint + "]"); } PropertyConstraint compoundConstraint = new CompoundPropertyConstraint(and); propertiesConstraints.put(constraint.getPropertyName(), compoundConstraint); orderedConstraints.add( compoundConstraint ); }
[ "private", "void", "putPropertyConstraint", "(", "PropertyConstraint", "constraint", ")", "{", "And", "and", "=", "new", "And", "(", ")", ";", "and", ".", "add", "(", "constraint", ")", ";", "if", "(", "logger", ".", "isDebugEnabled", "(", ")", ")", "{", "logger", ".", "debug", "(", "\"Putting constraint for property '\"", "+", "constraint", ".", "getPropertyName", "(", ")", "+", "\"', constraint -> [\"", "+", "constraint", "+", "\"]\"", ")", ";", "}", "PropertyConstraint", "compoundConstraint", "=", "new", "CompoundPropertyConstraint", "(", "and", ")", ";", "propertiesConstraints", ".", "put", "(", "constraint", ".", "getPropertyName", "(", ")", ",", "compoundConstraint", ")", ";", "orderedConstraints", ".", "add", "(", "compoundConstraint", ")", ";", "}" ]
Put a constraint into the collection. Store it in the map under the property name and add it to the ordered list. @param constraint to add
[ "Put", "a", "constraint", "into", "the", "collection", ".", "Store", "it", "in", "the", "map", "under", "the", "property", "name", "and", "add", "it", "to", "the", "ordered", "list", "." ]
6aad6e640b348cda8f3b0841f6e42025233f1eb8
https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/rules/Rules.java#L104-L114
11,982
lievendoclo/Valkyrie-RCP
valkyrie-rcp-core/src/main/java/org/valkyriercp/rules/Rules.java
Rules.add
public void add(String propertyName, Constraint[] valueConstraints) { add(new PropertyValueConstraint(propertyName, all(valueConstraints))); }
java
public void add(String propertyName, Constraint[] valueConstraints) { add(new PropertyValueConstraint(propertyName, all(valueConstraints))); }
[ "public", "void", "add", "(", "String", "propertyName", ",", "Constraint", "[", "]", "valueConstraints", ")", "{", "add", "(", "new", "PropertyValueConstraint", "(", "propertyName", ",", "all", "(", "valueConstraints", ")", ")", ")", ";", "}" ]
Adds a value constraint for the specified property. @param propertyName The property name. @param valueConstraints The value constraint.
[ "Adds", "a", "value", "constraint", "for", "the", "specified", "property", "." ]
6aad6e640b348cda8f3b0841f6e42025233f1eb8
https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/rules/Rules.java#L170-L172
11,983
lievendoclo/Valkyrie-RCP
valkyrie-rcp-core/src/main/java/org/valkyriercp/form/builder/TableFormBuilder.java
TableFormBuilder.add
public JComponent[] add(Binding binding, String attributes) { return addBinding(binding, attributes, getLabelAttributes()); }
java
public JComponent[] add(Binding binding, String attributes) { return addBinding(binding, attributes, getLabelAttributes()); }
[ "public", "JComponent", "[", "]", "add", "(", "Binding", "binding", ",", "String", "attributes", ")", "{", "return", "addBinding", "(", "binding", ",", "attributes", ",", "getLabelAttributes", "(", ")", ")", ";", "}" ]
Adds the field binding to the form. @param binding the field binding to add @param attributes optional layout attributes for the component. See {@link TableLayoutBuilder} for syntax details @return an array containing the label and the component which where added to the form
[ "Adds", "the", "field", "binding", "to", "the", "form", "." ]
6aad6e640b348cda8f3b0841f6e42025233f1eb8
https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/form/builder/TableFormBuilder.java#L115-L117
11,984
lievendoclo/Valkyrie-RCP
valkyrie-rcp-core/src/main/java/org/valkyriercp/form/builder/TableFormBuilder.java
TableFormBuilder.addSelector
public JComponent[] addSelector(String fieldName, Constraint filter, String attributes) { Map context = new HashMap(); context.put(ComboBoxBinder.FILTER_KEY, filter); return addBinding(getBindingFactory().createBinding(JComboBox.class, fieldName), attributes, getLabelAttributes()); }
java
public JComponent[] addSelector(String fieldName, Constraint filter, String attributes) { Map context = new HashMap(); context.put(ComboBoxBinder.FILTER_KEY, filter); return addBinding(getBindingFactory().createBinding(JComboBox.class, fieldName), attributes, getLabelAttributes()); }
[ "public", "JComponent", "[", "]", "addSelector", "(", "String", "fieldName", ",", "Constraint", "filter", ",", "String", "attributes", ")", "{", "Map", "context", "=", "new", "HashMap", "(", ")", ";", "context", ".", "put", "(", "ComboBoxBinder", ".", "FILTER_KEY", ",", "filter", ")", ";", "return", "addBinding", "(", "getBindingFactory", "(", ")", ".", "createBinding", "(", "JComboBox", ".", "class", ",", "fieldName", ")", ",", "attributes", ",", "getLabelAttributes", "(", ")", ")", ";", "}" ]
Adds the field to the form by using a selector component. @param fieldName the name of the field to add @param filter optional filter constraint for the items of the selector @param attributes optional layout attributes for the selector component. See {@link TableLayoutBuilder} for syntax details @return an array containing the label and the selector component which where added to the form
[ "Adds", "the", "field", "to", "the", "form", "by", "using", "a", "selector", "component", "." ]
6aad6e640b348cda8f3b0841f6e42025233f1eb8
https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/form/builder/TableFormBuilder.java#L176-L181
11,985
lievendoclo/Valkyrie-RCP
valkyrie-rcp-core/src/main/java/org/valkyriercp/form/builder/TableFormBuilder.java
TableFormBuilder.addInScrollPane
public JComponent[] addInScrollPane(String fieldName, String attributes) { return addInScrollPane(createDefaultBinding(fieldName), attributes); }
java
public JComponent[] addInScrollPane(String fieldName, String attributes) { return addInScrollPane(createDefaultBinding(fieldName), attributes); }
[ "public", "JComponent", "[", "]", "addInScrollPane", "(", "String", "fieldName", ",", "String", "attributes", ")", "{", "return", "addInScrollPane", "(", "createDefaultBinding", "(", "fieldName", ")", ",", "attributes", ")", ";", "}" ]
Adds the field to the form by using the default binding. The component will be placed inside a scrollpane. @param fieldName the name of the field to add @param attributes optional layout attributes for the scrollpane. See {@link TableLayoutBuilder} for syntax details @return an array containing the label, the component of the field binding and the scrollpane binding which where added to the form @see #createScrollPane(String, JComponent)
[ "Adds", "the", "field", "to", "the", "form", "by", "using", "the", "default", "binding", ".", "The", "component", "will", "be", "placed", "inside", "a", "scrollpane", "." ]
6aad6e640b348cda8f3b0841f6e42025233f1eb8
https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/form/builder/TableFormBuilder.java#L280-L282
11,986
lievendoclo/Valkyrie-RCP
valkyrie-rcp-core/src/main/java/org/valkyriercp/form/builder/TableFormBuilder.java
TableFormBuilder.addSeparator
public JComponent addSeparator(String text, String attributes) { JComponent separator = getComponentFactory().createLabeledSeparator(text); getLayoutBuilder().cell(separator, attributes); return separator; }
java
public JComponent addSeparator(String text, String attributes) { JComponent separator = getComponentFactory().createLabeledSeparator(text); getLayoutBuilder().cell(separator, attributes); return separator; }
[ "public", "JComponent", "addSeparator", "(", "String", "text", ",", "String", "attributes", ")", "{", "JComponent", "separator", "=", "getComponentFactory", "(", ")", ".", "createLabeledSeparator", "(", "text", ")", ";", "getLayoutBuilder", "(", ")", ".", "cell", "(", "separator", ",", "attributes", ")", ";", "return", "separator", ";", "}" ]
Adds a labeled separator to the form @param text the key for the label. Must not be null @param attributes optional attributes. See {@link TableLayoutBuilder} for syntax details
[ "Adds", "a", "labeled", "separator", "to", "the", "form" ]
6aad6e640b348cda8f3b0841f6e42025233f1eb8
https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/form/builder/TableFormBuilder.java#L335-L339
11,987
lievendoclo/Valkyrie-RCP
valkyrie-rcp-core/src/main/java/org/valkyriercp/binding/value/support/AbstractDerivedValueModel.java
AbstractDerivedValueModel.getSourceValues
protected Object[] getSourceValues() { Object[] values = new Object[sourceValueModels.length]; for (int i = 0; i < values.length; i++) { values[i] = sourceValueModels[i].getValue(); } return values; }
java
protected Object[] getSourceValues() { Object[] values = new Object[sourceValueModels.length]; for (int i = 0; i < values.length; i++) { values[i] = sourceValueModels[i].getValue(); } return values; }
[ "protected", "Object", "[", "]", "getSourceValues", "(", ")", "{", "Object", "[", "]", "values", "=", "new", "Object", "[", "sourceValueModels", ".", "length", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "values", ".", "length", ";", "i", "++", ")", "{", "values", "[", "i", "]", "=", "sourceValueModels", "[", "i", "]", ".", "getValue", "(", ")", ";", "}", "return", "values", ";", "}" ]
Convenience method to extract values from all sourceValueModels that influence the derived value. @return an <code>Array</code> containing the source values in the same order as the source valueModels were defined.
[ "Convenience", "method", "to", "extract", "values", "from", "all", "sourceValueModels", "that", "influence", "the", "derived", "value", "." ]
6aad6e640b348cda8f3b0841f6e42025233f1eb8
https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/binding/value/support/AbstractDerivedValueModel.java#L69-L75
11,988
lievendoclo/Valkyrie-RCP
valkyrie-rcp-core/src/main/java/org/valkyriercp/component/SimpleInternalFrame.java
SimpleInternalFrame.setFrameIcon
public void setFrameIcon(Icon newIcon) { Icon oldIcon = getFrameIcon(); titleLabel.setIcon(newIcon); firePropertyChange("frameIcon", oldIcon, newIcon); }
java
public void setFrameIcon(Icon newIcon) { Icon oldIcon = getFrameIcon(); titleLabel.setIcon(newIcon); firePropertyChange("frameIcon", oldIcon, newIcon); }
[ "public", "void", "setFrameIcon", "(", "Icon", "newIcon", ")", "{", "Icon", "oldIcon", "=", "getFrameIcon", "(", ")", ";", "titleLabel", ".", "setIcon", "(", "newIcon", ")", ";", "firePropertyChange", "(", "\"frameIcon\"", ",", "oldIcon", ",", "newIcon", ")", ";", "}" ]
Sets a new frame icon. @param newIcon the icon to be set
[ "Sets", "a", "new", "frame", "icon", "." ]
6aad6e640b348cda8f3b0841f6e42025233f1eb8
https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/component/SimpleInternalFrame.java#L150-L154
11,989
lievendoclo/Valkyrie-RCP
valkyrie-rcp-core/src/main/java/org/valkyriercp/component/SimpleInternalFrame.java
SimpleInternalFrame.setTitle
public void setTitle(String newText) { String oldText = getTitle(); titleLabel.setText(newText); firePropertyChange("title", oldText, newText); }
java
public void setTitle(String newText) { String oldText = getTitle(); titleLabel.setText(newText); firePropertyChange("title", oldText, newText); }
[ "public", "void", "setTitle", "(", "String", "newText", ")", "{", "String", "oldText", "=", "getTitle", "(", ")", ";", "titleLabel", ".", "setText", "(", "newText", ")", ";", "firePropertyChange", "(", "\"title\"", ",", "oldText", ",", "newText", ")", ";", "}" ]
Sets a new title text. @param newText the title text tp be set
[ "Sets", "a", "new", "title", "text", "." ]
6aad6e640b348cda8f3b0841f6e42025233f1eb8
https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/component/SimpleInternalFrame.java#L171-L175
11,990
lievendoclo/Valkyrie-RCP
valkyrie-rcp-core/src/main/java/org/valkyriercp/component/SimpleInternalFrame.java
SimpleInternalFrame.setToolBar
public void setToolBar(JToolBar newToolBar) { JToolBar oldToolBar = getToolBar(); if (oldToolBar == newToolBar) { return; } if (oldToolBar != null) { headerPanel.remove(oldToolBar); } if (newToolBar != null) { newToolBar.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); headerPanel.add(newToolBar, BorderLayout.EAST); } updateHeader(); firePropertyChange("toolBar", oldToolBar, newToolBar); }
java
public void setToolBar(JToolBar newToolBar) { JToolBar oldToolBar = getToolBar(); if (oldToolBar == newToolBar) { return; } if (oldToolBar != null) { headerPanel.remove(oldToolBar); } if (newToolBar != null) { newToolBar.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); headerPanel.add(newToolBar, BorderLayout.EAST); } updateHeader(); firePropertyChange("toolBar", oldToolBar, newToolBar); }
[ "public", "void", "setToolBar", "(", "JToolBar", "newToolBar", ")", "{", "JToolBar", "oldToolBar", "=", "getToolBar", "(", ")", ";", "if", "(", "oldToolBar", "==", "newToolBar", ")", "{", "return", ";", "}", "if", "(", "oldToolBar", "!=", "null", ")", "{", "headerPanel", ".", "remove", "(", "oldToolBar", ")", ";", "}", "if", "(", "newToolBar", "!=", "null", ")", "{", "newToolBar", ".", "setBorder", "(", "BorderFactory", ".", "createEmptyBorder", "(", "0", ",", "0", ",", "0", ",", "0", ")", ")", ";", "headerPanel", ".", "add", "(", "newToolBar", ",", "BorderLayout", ".", "EAST", ")", ";", "}", "updateHeader", "(", ")", ";", "firePropertyChange", "(", "\"toolBar\"", ",", "oldToolBar", ",", "newToolBar", ")", ";", "}" ]
Sets a new tool bar in the header. @param newToolBar the tool bar to be set in the header
[ "Sets", "a", "new", "tool", "bar", "in", "the", "header", "." ]
6aad6e640b348cda8f3b0841f6e42025233f1eb8
https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/component/SimpleInternalFrame.java#L192-L206
11,991
lievendoclo/Valkyrie-RCP
valkyrie-rcp-core/src/main/java/org/valkyriercp/component/SimpleInternalFrame.java
SimpleInternalFrame.setContent
public void setContent(Component newContent) { Component oldContent = getContent(); if (hasContent()) { remove(oldContent); } add(newContent, BorderLayout.CENTER); firePropertyChange("content", oldContent, newContent); }
java
public void setContent(Component newContent) { Component oldContent = getContent(); if (hasContent()) { remove(oldContent); } add(newContent, BorderLayout.CENTER); firePropertyChange("content", oldContent, newContent); }
[ "public", "void", "setContent", "(", "Component", "newContent", ")", "{", "Component", "oldContent", "=", "getContent", "(", ")", ";", "if", "(", "hasContent", "(", ")", ")", "{", "remove", "(", "oldContent", ")", ";", "}", "add", "(", "newContent", ",", "BorderLayout", ".", "CENTER", ")", ";", "firePropertyChange", "(", "\"content\"", ",", "oldContent", ",", "newContent", ")", ";", "}" ]
Sets a new panel content; replaces any existing content, if existing. @param newContent the panel's new content
[ "Sets", "a", "new", "panel", "content", ";", "replaces", "any", "existing", "content", "if", "existing", "." ]
6aad6e640b348cda8f3b0841f6e42025233f1eb8
https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/component/SimpleInternalFrame.java#L223-L230
11,992
lievendoclo/Valkyrie-RCP
valkyrie-rcp-core/src/main/java/org/valkyriercp/component/SimpleInternalFrame.java
SimpleInternalFrame.setSelected
public void setSelected(boolean newValue) { boolean oldValue = isSelected(); isSelected = newValue; updateHeader(); firePropertyChange("selected", oldValue, newValue); }
java
public void setSelected(boolean newValue) { boolean oldValue = isSelected(); isSelected = newValue; updateHeader(); firePropertyChange("selected", oldValue, newValue); }
[ "public", "void", "setSelected", "(", "boolean", "newValue", ")", "{", "boolean", "oldValue", "=", "isSelected", "(", ")", ";", "isSelected", "=", "newValue", ";", "updateHeader", "(", ")", ";", "firePropertyChange", "(", "\"selected\"", ",", "oldValue", ",", "newValue", ")", ";", "}" ]
This panel draws its title bar differently if it is selected, which may be used to indicate to the user that this panel has the focus, or should get more attention than other simple internal frames. @param newValue a boolean, where true means the frame is selected (currently active) and false means it is not
[ "This", "panel", "draws", "its", "title", "bar", "differently", "if", "it", "is", "selected", "which", "may", "be", "used", "to", "indicate", "to", "the", "user", "that", "this", "panel", "has", "the", "focus", "or", "should", "get", "more", "attention", "than", "other", "simple", "internal", "frames", "." ]
6aad6e640b348cda8f3b0841f6e42025233f1eb8
https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/component/SimpleInternalFrame.java#L253-L258
11,993
lievendoclo/Valkyrie-RCP
valkyrie-rcp-core/src/main/java/org/valkyriercp/component/SimpleInternalFrame.java
SimpleInternalFrame.updateHeader
private void updateHeader() { gradientPanel.setBackground(getHeaderBackground()); gradientPanel.setOpaque(isSelected()); titleLabel.setForeground(getTextForeground(isSelected())); headerPanel.repaint(); }
java
private void updateHeader() { gradientPanel.setBackground(getHeaderBackground()); gradientPanel.setOpaque(isSelected()); titleLabel.setForeground(getTextForeground(isSelected())); headerPanel.repaint(); }
[ "private", "void", "updateHeader", "(", ")", "{", "gradientPanel", ".", "setBackground", "(", "getHeaderBackground", "(", ")", ")", ";", "gradientPanel", ".", "setOpaque", "(", "isSelected", "(", ")", ")", ";", "titleLabel", ".", "setForeground", "(", "getTextForeground", "(", "isSelected", "(", ")", ")", ")", ";", "headerPanel", ".", "repaint", "(", ")", ";", "}" ]
Updates the header.
[ "Updates", "the", "header", "." ]
6aad6e640b348cda8f3b0841f6e42025233f1eb8
https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/component/SimpleInternalFrame.java#L290-L295
11,994
lievendoclo/Valkyrie-RCP
valkyrie-rcp-core/src/main/java/org/valkyriercp/component/SimpleInternalFrame.java
SimpleInternalFrame.getTextForeground
protected Color getTextForeground(boolean selected) { Color c = UIManager.getColor(selected ? "SimpleInternalFrame.activeTitleForeground" : "SimpleInternalFrame.inactiveTitleForeground"); if (c != null) { return c; } return UIManager.getColor(selected ? "InternalFrame.activeTitleForeground" : "Label.foreground"); }
java
protected Color getTextForeground(boolean selected) { Color c = UIManager.getColor(selected ? "SimpleInternalFrame.activeTitleForeground" : "SimpleInternalFrame.inactiveTitleForeground"); if (c != null) { return c; } return UIManager.getColor(selected ? "InternalFrame.activeTitleForeground" : "Label.foreground"); }
[ "protected", "Color", "getTextForeground", "(", "boolean", "selected", ")", "{", "Color", "c", "=", "UIManager", ".", "getColor", "(", "selected", "?", "\"SimpleInternalFrame.activeTitleForeground\"", ":", "\"SimpleInternalFrame.inactiveTitleForeground\"", ")", ";", "if", "(", "c", "!=", "null", ")", "{", "return", "c", ";", "}", "return", "UIManager", ".", "getColor", "(", "selected", "?", "\"InternalFrame.activeTitleForeground\"", ":", "\"Label.foreground\"", ")", ";", "}" ]
Determines and answers the header's text foreground color. Tries to lookup a special color from the L&amp;F. In case it is absent, it uses the standard internal frame forground. @param selected true to lookup the active color, false for the inactive @return the color of the foreground text
[ "Determines", "and", "answers", "the", "header", "s", "text", "foreground", "color", ".", "Tries", "to", "lookup", "a", "special", "color", "from", "the", "L&amp", ";", "F", ".", "In", "case", "it", "is", "absent", "it", "uses", "the", "standard", "internal", "frame", "forground", "." ]
6aad6e640b348cda8f3b0841f6e42025233f1eb8
https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/component/SimpleInternalFrame.java#L328-L336
11,995
lievendoclo/Valkyrie-RCP
valkyrie-rcp-core/src/main/java/org/valkyriercp/component/SimpleInternalFrame.java
SimpleInternalFrame.getHeaderBackground
protected Color getHeaderBackground() { Color c = UIManager.getColor("SimpleInternalFrame.activeTitleBackground"); return c != null ? c : UIManager.getColor("InternalFrame.activeTitleBackground"); }
java
protected Color getHeaderBackground() { Color c = UIManager.getColor("SimpleInternalFrame.activeTitleBackground"); return c != null ? c : UIManager.getColor("InternalFrame.activeTitleBackground"); }
[ "protected", "Color", "getHeaderBackground", "(", ")", "{", "Color", "c", "=", "UIManager", ".", "getColor", "(", "\"SimpleInternalFrame.activeTitleBackground\"", ")", ";", "return", "c", "!=", "null", "?", "c", ":", "UIManager", ".", "getColor", "(", "\"InternalFrame.activeTitleBackground\"", ")", ";", "}" ]
Determines and answers the header's background color. Tries to lookup a special color from the L&amp;F. In case it is absent, it uses the standard internal frame background. @return the color of the header's background
[ "Determines", "and", "answers", "the", "header", "s", "background", "color", ".", "Tries", "to", "lookup", "a", "special", "color", "from", "the", "L&amp", ";", "F", ".", "In", "case", "it", "is", "absent", "it", "uses", "the", "standard", "internal", "frame", "background", "." ]
6aad6e640b348cda8f3b0841f6e42025233f1eb8
https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/component/SimpleInternalFrame.java#L345-L349
11,996
lievendoclo/Valkyrie-RCP
valkyrie-rcp-core/src/main/java/org/valkyriercp/binding/support/AbstractPropertyAccessStrategy.java
AbstractPropertyAccessStrategy.getFullPropertyPath
protected String getFullPropertyPath(String propertyPath) { if (basePropertyPath.equals("")) { return propertyPath; } else if (propertyPath.equals("")) { return basePropertyPath; } else { return basePropertyPath + '.' + propertyPath; } }
java
protected String getFullPropertyPath(String propertyPath) { if (basePropertyPath.equals("")) { return propertyPath; } else if (propertyPath.equals("")) { return basePropertyPath; } else { return basePropertyPath + '.' + propertyPath; } }
[ "protected", "String", "getFullPropertyPath", "(", "String", "propertyPath", ")", "{", "if", "(", "basePropertyPath", ".", "equals", "(", "\"\"", ")", ")", "{", "return", "propertyPath", ";", "}", "else", "if", "(", "propertyPath", ".", "equals", "(", "\"\"", ")", ")", "{", "return", "basePropertyPath", ";", "}", "else", "{", "return", "basePropertyPath", "+", "'", "'", "+", "propertyPath", ";", "}", "}" ]
Returns a property path that includes the base property path of the class.
[ "Returns", "a", "property", "path", "that", "includes", "the", "base", "property", "path", "of", "the", "class", "." ]
6aad6e640b348cda8f3b0841f6e42025233f1eb8
https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/binding/support/AbstractPropertyAccessStrategy.java#L142-L152
11,997
lievendoclo/Valkyrie-RCP
valkyrie-rcp-core/src/main/java/org/valkyriercp/binding/support/AbstractPropertyAccessStrategy.java
AbstractPropertyAccessStrategy.getPropertyName
protected String getPropertyName(String propertyPath) { int lastSeparator = getLastPropertySeparatorIndex(propertyPath); if (lastSeparator == -1) { return propertyPath; } if (propertyPath.charAt(lastSeparator) == PropertyAccessor.NESTED_PROPERTY_SEPARATOR_CHAR) return propertyPath.substring(lastSeparator + 1); return propertyPath.substring(lastSeparator); }
java
protected String getPropertyName(String propertyPath) { int lastSeparator = getLastPropertySeparatorIndex(propertyPath); if (lastSeparator == -1) { return propertyPath; } if (propertyPath.charAt(lastSeparator) == PropertyAccessor.NESTED_PROPERTY_SEPARATOR_CHAR) return propertyPath.substring(lastSeparator + 1); return propertyPath.substring(lastSeparator); }
[ "protected", "String", "getPropertyName", "(", "String", "propertyPath", ")", "{", "int", "lastSeparator", "=", "getLastPropertySeparatorIndex", "(", "propertyPath", ")", ";", "if", "(", "lastSeparator", "==", "-", "1", ")", "{", "return", "propertyPath", ";", "}", "if", "(", "propertyPath", ".", "charAt", "(", "lastSeparator", ")", "==", "PropertyAccessor", ".", "NESTED_PROPERTY_SEPARATOR_CHAR", ")", "return", "propertyPath", ".", "substring", "(", "lastSeparator", "+", "1", ")", ";", "return", "propertyPath", ".", "substring", "(", "lastSeparator", ")", ";", "}" ]
Extracts the property name from a propertyPath.
[ "Extracts", "the", "property", "name", "from", "a", "propertyPath", "." ]
6aad6e640b348cda8f3b0841f6e42025233f1eb8
https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/binding/support/AbstractPropertyAccessStrategy.java#L157-L166
11,998
lievendoclo/Valkyrie-RCP
valkyrie-rcp-core/src/main/java/org/valkyriercp/binding/support/AbstractPropertyAccessStrategy.java
AbstractPropertyAccessStrategy.getParentPropertyPath
protected String getParentPropertyPath(String propertyPath) { int lastSeparator = getLastPropertySeparatorIndex(propertyPath); return lastSeparator == -1 ? "" : propertyPath.substring(0, lastSeparator); }
java
protected String getParentPropertyPath(String propertyPath) { int lastSeparator = getLastPropertySeparatorIndex(propertyPath); return lastSeparator == -1 ? "" : propertyPath.substring(0, lastSeparator); }
[ "protected", "String", "getParentPropertyPath", "(", "String", "propertyPath", ")", "{", "int", "lastSeparator", "=", "getLastPropertySeparatorIndex", "(", "propertyPath", ")", ";", "return", "lastSeparator", "==", "-", "1", "?", "\"\"", ":", "propertyPath", ".", "substring", "(", "0", ",", "lastSeparator", ")", ";", "}" ]
Returns the property name component of the provided property path.
[ "Returns", "the", "property", "name", "component", "of", "the", "provided", "property", "path", "." ]
6aad6e640b348cda8f3b0841f6e42025233f1eb8
https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/binding/support/AbstractPropertyAccessStrategy.java#L171-L174
11,999
lievendoclo/Valkyrie-RCP
valkyrie-rcp-core/src/main/java/org/valkyriercp/command/support/AbstractCommand.java
AbstractCommand.setId
protected void setId(String id) { if (!StringUtils.hasText(id)) { id = null; } this.id = id; }
java
protected void setId(String id) { if (!StringUtils.hasText(id)) { id = null; } this.id = id; }
[ "protected", "void", "setId", "(", "String", "id", ")", "{", "if", "(", "!", "StringUtils", ".", "hasText", "(", "id", ")", ")", "{", "id", "=", "null", ";", "}", "this", ".", "id", "=", "id", ";", "}" ]
Set the id. In most cases, this is provided by the constructor or through the beanId provided in the applicationContext. @param id
[ "Set", "the", "id", ".", "In", "most", "cases", "this", "is", "provided", "by", "the", "constructor", "or", "through", "the", "beanId", "provided", "in", "the", "applicationContext", "." ]
6aad6e640b348cda8f3b0841f6e42025233f1eb8
https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/command/support/AbstractCommand.java#L188-L193