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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
12,000 | lievendoclo/Valkyrie-RCP | valkyrie-rcp-core/src/main/java/org/valkyriercp/command/support/AbstractCommand.java | AbstractCommand.getOrCreateFaceDescriptor | private CommandFaceDescriptor getOrCreateFaceDescriptor() {
if (!isFaceConfigured()) {
if (logger.isInfoEnabled()) {
logger.info("Lazily instantiating default face descriptor on behalf of caller to prevent npe; "
+ "command is being configured manually, right?");
}
if(ValkyrieRepository.isCurrently... | java | private CommandFaceDescriptor getOrCreateFaceDescriptor() {
if (!isFaceConfigured()) {
if (logger.isInfoEnabled()) {
logger.info("Lazily instantiating default face descriptor on behalf of caller to prevent npe; "
+ "command is being configured manually, right?");
}
if(ValkyrieRepository.isCurrently... | [
"private",
"CommandFaceDescriptor",
"getOrCreateFaceDescriptor",
"(",
")",
"{",
"if",
"(",
"!",
"isFaceConfigured",
"(",
")",
")",
"{",
"if",
"(",
"logger",
".",
"isInfoEnabled",
"(",
")",
")",
"{",
"logger",
".",
"info",
"(",
"\"Lazily instantiating default fac... | Returns the defaultFaceDescriptor. Creates one if needed. | [
"Returns",
"the",
"defaultFaceDescriptor",
".",
"Creates",
"one",
"if",
"needed",
"."
] | 6aad6e640b348cda8f3b0841f6e42025233f1eb8 | https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/command/support/AbstractCommand.java#L350-L363 |
12,001 | lievendoclo/Valkyrie-RCP | valkyrie-rcp-core/src/main/java/org/valkyriercp/command/support/AbstractCommand.java | AbstractCommand.createButton | public final AbstractButton createButton(String faceDescriptorId, ButtonFactory buttonFactory) {
return createButton(faceDescriptorId, buttonFactory, getDefaultButtonConfigurer());
} | java | public final AbstractButton createButton(String faceDescriptorId, ButtonFactory buttonFactory) {
return createButton(faceDescriptorId, buttonFactory, getDefaultButtonConfigurer());
} | [
"public",
"final",
"AbstractButton",
"createButton",
"(",
"String",
"faceDescriptorId",
",",
"ButtonFactory",
"buttonFactory",
")",
"{",
"return",
"createButton",
"(",
"faceDescriptorId",
",",
"buttonFactory",
",",
"getDefaultButtonConfigurer",
"(",
")",
")",
";",
"}"... | Create a button using the default buttonConfigurer.
@see #createButton(String, ButtonFactory, CommandButtonConfigurer) | [
"Create",
"a",
"button",
"using",
"the",
"default",
"buttonConfigurer",
"."
] | 6aad6e640b348cda8f3b0841f6e42025233f1eb8 | https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/command/support/AbstractCommand.java#L757-L759 |
12,002 | lievendoclo/Valkyrie-RCP | valkyrie-rcp-core/src/main/java/org/valkyriercp/command/support/AbstractCommand.java | AbstractCommand.createButton | public final AbstractButton createButton(ButtonFactory buttonFactory, CommandButtonConfigurer buttonConfigurer) {
return createButton(getDefaultFaceDescriptorId(), buttonFactory, buttonConfigurer);
} | java | public final AbstractButton createButton(ButtonFactory buttonFactory, CommandButtonConfigurer buttonConfigurer) {
return createButton(getDefaultFaceDescriptorId(), buttonFactory, buttonConfigurer);
} | [
"public",
"final",
"AbstractButton",
"createButton",
"(",
"ButtonFactory",
"buttonFactory",
",",
"CommandButtonConfigurer",
"buttonConfigurer",
")",
"{",
"return",
"createButton",
"(",
"getDefaultFaceDescriptorId",
"(",
")",
",",
"buttonFactory",
",",
"buttonConfigurer",
... | Create a button using the default buttonFactory.
@see #createButton(String, ButtonFactory, CommandButtonConfigurer) | [
"Create",
"a",
"button",
"using",
"the",
"default",
"buttonFactory",
"."
] | 6aad6e640b348cda8f3b0841f6e42025233f1eb8 | https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/command/support/AbstractCommand.java#L766-L768 |
12,003 | lievendoclo/Valkyrie-RCP | valkyrie-rcp-core/src/main/java/org/valkyriercp/command/support/AbstractCommand.java | AbstractCommand.createButton | public AbstractButton createButton(String faceDescriptorId, ButtonFactory buttonFactory,
CommandButtonConfigurer buttonConfigurer) {
AbstractButton button = buttonFactory.createButton();
attach(button, faceDescriptorId, buttonConfigurer);
return button;
} | java | public AbstractButton createButton(String faceDescriptorId, ButtonFactory buttonFactory,
CommandButtonConfigurer buttonConfigurer) {
AbstractButton button = buttonFactory.createButton();
attach(button, faceDescriptorId, buttonConfigurer);
return button;
} | [
"public",
"AbstractButton",
"createButton",
"(",
"String",
"faceDescriptorId",
",",
"ButtonFactory",
"buttonFactory",
",",
"CommandButtonConfigurer",
"buttonConfigurer",
")",
"{",
"AbstractButton",
"button",
"=",
"buttonFactory",
".",
"createButton",
"(",
")",
";",
"att... | Creates a button using the provided id, factory and configurer.
@param faceDescriptorId id of the faceDescriptor used to configure the
button.
@param buttonFactory factory that delivers the button.
@param buttonConfigurer configurer mapping the faceDescriptor on the
button.
@return a button attached to this command. | [
"Creates",
"a",
"button",
"using",
"the",
"provided",
"id",
"factory",
"and",
"configurer",
"."
] | 6aad6e640b348cda8f3b0841f6e42025233f1eb8 | https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/command/support/AbstractCommand.java#L780-L785 |
12,004 | lievendoclo/Valkyrie-RCP | valkyrie-rcp-core/src/main/java/org/valkyriercp/command/support/AbstractCommand.java | AbstractCommand.createMenuItem | public final JMenuItem createMenuItem(String faceDescriptorId, MenuFactory menuFactory) {
return createMenuItem(faceDescriptorId, menuFactory, getMenuItemButtonConfigurer());
} | java | public final JMenuItem createMenuItem(String faceDescriptorId, MenuFactory menuFactory) {
return createMenuItem(faceDescriptorId, menuFactory, getMenuItemButtonConfigurer());
} | [
"public",
"final",
"JMenuItem",
"createMenuItem",
"(",
"String",
"faceDescriptorId",
",",
"MenuFactory",
"menuFactory",
")",
"{",
"return",
"createMenuItem",
"(",
"faceDescriptorId",
",",
"menuFactory",
",",
"getMenuItemButtonConfigurer",
"(",
")",
")",
";",
"}"
] | Create a menuItem using the default and menuItemButtonConfigurer.
@see #createMenuItem(String, MenuFactory, CommandButtonConfigurer) | [
"Create",
"a",
"menuItem",
"using",
"the",
"default",
"and",
"menuItemButtonConfigurer",
"."
] | 6aad6e640b348cda8f3b0841f6e42025233f1eb8 | https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/command/support/AbstractCommand.java#L822-L824 |
12,005 | lievendoclo/Valkyrie-RCP | valkyrie-rcp-core/src/main/java/org/valkyriercp/command/support/AbstractCommand.java | AbstractCommand.createMenuItem | public final JMenuItem createMenuItem(MenuFactory menuFactory, CommandButtonConfigurer buttonConfigurer) {
return createMenuItem(getDefaultFaceDescriptorId(), menuFactory, buttonConfigurer);
} | java | public final JMenuItem createMenuItem(MenuFactory menuFactory, CommandButtonConfigurer buttonConfigurer) {
return createMenuItem(getDefaultFaceDescriptorId(), menuFactory, buttonConfigurer);
} | [
"public",
"final",
"JMenuItem",
"createMenuItem",
"(",
"MenuFactory",
"menuFactory",
",",
"CommandButtonConfigurer",
"buttonConfigurer",
")",
"{",
"return",
"createMenuItem",
"(",
"getDefaultFaceDescriptorId",
"(",
")",
",",
"menuFactory",
",",
"buttonConfigurer",
")",
... | Create a menuItem using the default faceDescriptorId.
@see #createMenuItem(String, MenuFactory, CommandButtonConfigurer) | [
"Create",
"a",
"menuItem",
"using",
"the",
"default",
"faceDescriptorId",
"."
] | 6aad6e640b348cda8f3b0841f6e42025233f1eb8 | https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/command/support/AbstractCommand.java#L831-L833 |
12,006 | lievendoclo/Valkyrie-RCP | valkyrie-rcp-core/src/main/java/org/valkyriercp/command/support/AbstractCommand.java | AbstractCommand.createMenuItem | public JMenuItem createMenuItem(String faceDescriptorId, MenuFactory menuFactory,
CommandButtonConfigurer buttonConfigurer) {
JMenuItem menuItem = menuFactory.createMenuItem();
attach(menuItem, faceDescriptorId, buttonConfigurer);
return menuItem;
} | java | public JMenuItem createMenuItem(String faceDescriptorId, MenuFactory menuFactory,
CommandButtonConfigurer buttonConfigurer) {
JMenuItem menuItem = menuFactory.createMenuItem();
attach(menuItem, faceDescriptorId, buttonConfigurer);
return menuItem;
} | [
"public",
"JMenuItem",
"createMenuItem",
"(",
"String",
"faceDescriptorId",
",",
"MenuFactory",
"menuFactory",
",",
"CommandButtonConfigurer",
"buttonConfigurer",
")",
"{",
"JMenuItem",
"menuItem",
"=",
"menuFactory",
".",
"createMenuItem",
"(",
")",
";",
"attach",
"(... | Create a menuItem using the provided id, factory and configurer.
@param faceDescriptorId id of the faceDescriptor used to configure the
button.
@param menuFactory factory that delivers the menuItem.
@param buttonConfigurer configurer mapping the faceDescriptor on the
button.
@return a menuItem attached to this command... | [
"Create",
"a",
"menuItem",
"using",
"the",
"provided",
"id",
"factory",
"and",
"configurer",
"."
] | 6aad6e640b348cda8f3b0841f6e42025233f1eb8 | https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/command/support/AbstractCommand.java#L845-L850 |
12,007 | lievendoclo/Valkyrie-RCP | valkyrie-rcp-core/src/main/java/org/valkyriercp/command/support/AbstractCommand.java | AbstractCommand.attach | public void attach(AbstractButton button, String faceDescriptorId, CommandButtonConfigurer configurer) {
getButtonManager(faceDescriptorId).attachAndConfigure(button, configurer);
onButtonAttached(button);
} | java | public void attach(AbstractButton button, String faceDescriptorId, CommandButtonConfigurer configurer) {
getButtonManager(faceDescriptorId).attachAndConfigure(button, configurer);
onButtonAttached(button);
} | [
"public",
"void",
"attach",
"(",
"AbstractButton",
"button",
",",
"String",
"faceDescriptorId",
",",
"CommandButtonConfigurer",
"configurer",
")",
"{",
"getButtonManager",
"(",
"faceDescriptorId",
")",
".",
"attachAndConfigure",
"(",
"button",
",",
"configurer",
")",
... | Attach and configure the button to the faceDescriptorId using the configurer.
@param button the button to attach and configure.
@param faceDescriptorId the id of the faceDescriptor.
@param configurer that maps the faceDescriptor on the button. | [
"Attach",
"and",
"configure",
"the",
"button",
"to",
"the",
"faceDescriptorId",
"using",
"the",
"configurer",
"."
] | 6aad6e640b348cda8f3b0841f6e42025233f1eb8 | https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/command/support/AbstractCommand.java#L879-L882 |
12,008 | lievendoclo/Valkyrie-RCP | valkyrie-rcp-core/src/main/java/org/valkyriercp/command/support/AbstractCommand.java | AbstractCommand.onButtonAttached | protected void onButtonAttached(AbstractButton button) {
if (logger.isDebugEnabled()) {
logger.debug("Configuring newly attached button for command '" + getId() + "' enabled=" + isEnabled()
+ ", visible=" + isVisible());
}
button.setEnabled(isEnabled());
button.setVisible(isVisible());
} | java | protected void onButtonAttached(AbstractButton button) {
if (logger.isDebugEnabled()) {
logger.debug("Configuring newly attached button for command '" + getId() + "' enabled=" + isEnabled()
+ ", visible=" + isVisible());
}
button.setEnabled(isEnabled());
button.setVisible(isVisible());
} | [
"protected",
"void",
"onButtonAttached",
"(",
"AbstractButton",
"button",
")",
"{",
"if",
"(",
"logger",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"logger",
".",
"debug",
"(",
"\"Configuring newly attached button for command '\"",
"+",
"getId",
"(",
")",
"+",
"... | Additional code to execute when attaching a button.
@param button the button that has been attached. | [
"Additional",
"code",
"to",
"execute",
"when",
"attaching",
"a",
"button",
"."
] | 6aad6e640b348cda8f3b0841f6e42025233f1eb8 | https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/command/support/AbstractCommand.java#L889-L896 |
12,009 | lievendoclo/Valkyrie-RCP | valkyrie-rcp-core/src/main/java/org/valkyriercp/command/support/AbstractCommand.java | AbstractCommand.requestFocusIn | public boolean requestFocusIn(Container container) {
AbstractButton button = getButtonIn(container);
if (button != null) {
return button.requestFocusInWindow();
}
return false;
} | java | public boolean requestFocusIn(Container container) {
AbstractButton button = getButtonIn(container);
if (button != null) {
return button.requestFocusInWindow();
}
return false;
} | [
"public",
"boolean",
"requestFocusIn",
"(",
"Container",
"container",
")",
"{",
"AbstractButton",
"button",
"=",
"getButtonIn",
"(",
"container",
")",
";",
"if",
"(",
"button",
"!=",
"null",
")",
"{",
"return",
"button",
".",
"requestFocusInWindow",
"(",
")",
... | Search for a button representing this command in the provided container
and let it request the focus.
@param container the container which holds the command button.
@return <code>true</code> if the focus request is likely to succeed.
@see #getButtonIn(Container)
@see JComponent#requestFocusInWindow() | [
"Search",
"for",
"a",
"button",
"representing",
"this",
"command",
"in",
"the",
"provided",
"container",
"and",
"let",
"it",
"request",
"the",
"focus",
"."
] | 6aad6e640b348cda8f3b0841f6e42025233f1eb8 | https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/command/support/AbstractCommand.java#L1016-L1022 |
12,010 | lievendoclo/Valkyrie-RCP | valkyrie-rcp-core/src/main/java/org/valkyriercp/command/support/AbstractCommand.java | AbstractCommand.getButtonIn | public AbstractButton getButtonIn(Container container) {
Iterator it = buttonIterator();
while (it.hasNext()) {
AbstractButton button = (AbstractButton) it.next();
if (SwingUtilities.isDescendingFrom(button, container)) {
return button;
}
}
return null;
} | java | public AbstractButton getButtonIn(Container container) {
Iterator it = buttonIterator();
while (it.hasNext()) {
AbstractButton button = (AbstractButton) it.next();
if (SwingUtilities.isDescendingFrom(button, container)) {
return button;
}
}
return null;
} | [
"public",
"AbstractButton",
"getButtonIn",
"(",
"Container",
"container",
")",
"{",
"Iterator",
"it",
"=",
"buttonIterator",
"(",
")",
";",
"while",
"(",
"it",
".",
"hasNext",
"(",
")",
")",
"{",
"AbstractButton",
"button",
"=",
"(",
"AbstractButton",
")",
... | Search for the first button of this command that is a child component of
the given container.
@param container the container to be searched.
@return the {@link AbstractButton} representing this command that is
embedded in the container or <code>null</code> if none was found. | [
"Search",
"for",
"the",
"first",
"button",
"of",
"this",
"command",
"that",
"is",
"a",
"child",
"component",
"of",
"the",
"given",
"container",
"."
] | 6aad6e640b348cda8f3b0841f6e42025233f1eb8 | https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/command/support/AbstractCommand.java#L1032-L1041 |
12,011 | lievendoclo/Valkyrie-RCP | valkyrie-rcp-core/src/main/java/org/valkyriercp/util/ClassUtils.java | ClassUtils.initializeClass | public static void initializeClass(Class clazz) {
try {
Class.forName(clazz.getName(), true, Thread.currentThread().getContextClassLoader());
}
catch (ClassNotFoundException e) {
throw new RuntimeException(e);
}
} | java | public static void initializeClass(Class clazz) {
try {
Class.forName(clazz.getName(), true, Thread.currentThread().getContextClassLoader());
}
catch (ClassNotFoundException e) {
throw new RuntimeException(e);
}
} | [
"public",
"static",
"void",
"initializeClass",
"(",
"Class",
"clazz",
")",
"{",
"try",
"{",
"Class",
".",
"forName",
"(",
"clazz",
".",
"getName",
"(",
")",
",",
"true",
",",
"Thread",
".",
"currentThread",
"(",
")",
".",
"getContextClassLoader",
"(",
")... | Intializes the specified class if not initialized already.
This is required for EnumUtils if the enum class has not yet been loaded. | [
"Intializes",
"the",
"specified",
"class",
"if",
"not",
"initialized",
"already",
"."
] | 6aad6e640b348cda8f3b0841f6e42025233f1eb8 | https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/util/ClassUtils.java#L68-L75 |
12,012 | lievendoclo/Valkyrie-RCP | valkyrie-rcp-core/src/main/java/org/valkyriercp/util/ClassUtils.java | ClassUtils.getFieldValue | public static Object getFieldValue(String qualifiedFieldName) {
Class clazz;
try {
clazz = classForName(ClassUtils.qualifier(qualifiedFieldName));
}
catch (ClassNotFoundException cnfe) {
return null;
}
try {
return clazz.getField(ClassUtils.unqualify(qualifiedFieldName)).get(null);
}
catch (Exc... | java | public static Object getFieldValue(String qualifiedFieldName) {
Class clazz;
try {
clazz = classForName(ClassUtils.qualifier(qualifiedFieldName));
}
catch (ClassNotFoundException cnfe) {
return null;
}
try {
return clazz.getField(ClassUtils.unqualify(qualifiedFieldName)).get(null);
}
catch (Exc... | [
"public",
"static",
"Object",
"getFieldValue",
"(",
"String",
"qualifiedFieldName",
")",
"{",
"Class",
"clazz",
";",
"try",
"{",
"clazz",
"=",
"classForName",
"(",
"ClassUtils",
".",
"qualifier",
"(",
"qualifiedFieldName",
")",
")",
";",
"}",
"catch",
"(",
"... | Gets the field value for the specified qualified field name. | [
"Gets",
"the",
"field",
"value",
"for",
"the",
"specified",
"qualified",
"field",
"name",
"."
] | 6aad6e640b348cda8f3b0841f6e42025233f1eb8 | https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/util/ClassUtils.java#L104-L118 |
12,013 | lievendoclo/Valkyrie-RCP | valkyrie-rcp-core/src/main/java/org/valkyriercp/util/ClassUtils.java | ClassUtils.classForName | public static Class classForName(String name) throws ClassNotFoundException {
try {
return Thread.currentThread().getContextClassLoader().loadClass(name);
}
catch (Exception e) {
return Class.forName(name);
}
} | java | public static Class classForName(String name) throws ClassNotFoundException {
try {
return Thread.currentThread().getContextClassLoader().loadClass(name);
}
catch (Exception e) {
return Class.forName(name);
}
} | [
"public",
"static",
"Class",
"classForName",
"(",
"String",
"name",
")",
"throws",
"ClassNotFoundException",
"{",
"try",
"{",
"return",
"Thread",
".",
"currentThread",
"(",
")",
".",
"getContextClassLoader",
"(",
")",
".",
"loadClass",
"(",
"name",
")",
";",
... | Load the class with the specified name.
@param name
@return The loaded class.
@throws ClassNotFoundException | [
"Load",
"the",
"class",
"with",
"the",
"specified",
"name",
"."
] | 6aad6e640b348cda8f3b0841f6e42025233f1eb8 | https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/util/ClassUtils.java#L127-L134 |
12,014 | lievendoclo/Valkyrie-RCP | valkyrie-rcp-core/src/main/java/org/valkyriercp/util/ClassUtils.java | ClassUtils.qualifier | public static String qualifier(String qualifiedName) {
int loc = qualifiedName.lastIndexOf('.');
if (loc < 0)
return "";
return qualifiedName.substring(0, loc);
} | java | public static String qualifier(String qualifiedName) {
int loc = qualifiedName.lastIndexOf('.');
if (loc < 0)
return "";
return qualifiedName.substring(0, loc);
} | [
"public",
"static",
"String",
"qualifier",
"(",
"String",
"qualifiedName",
")",
"{",
"int",
"loc",
"=",
"qualifiedName",
".",
"lastIndexOf",
"(",
"'",
"'",
")",
";",
"if",
"(",
"loc",
"<",
"0",
")",
"return",
"\"\"",
";",
"return",
"qualifiedName",
".",
... | Returns the qualifier for a name separated by dots. The qualified part is
everything up to the last dot separator.
@param qualifiedName The qualified name.
@return The qualifier portion. | [
"Returns",
"the",
"qualifier",
"for",
"a",
"name",
"separated",
"by",
"dots",
".",
"The",
"qualified",
"part",
"is",
"everything",
"up",
"to",
"the",
"last",
"dot",
"separator",
"."
] | 6aad6e640b348cda8f3b0841f6e42025233f1eb8 | https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/util/ClassUtils.java#L170-L176 |
12,015 | lievendoclo/Valkyrie-RCP | valkyrie-rcp-core/src/main/java/org/valkyriercp/util/ClassUtils.java | ClassUtils.convertPrimitiveToWrapper | public static Class convertPrimitiveToWrapper(Class clazz) {
if (clazz == null || !clazz.isPrimitive())
return clazz;
return (Class) primativeToWrapperMap.get(clazz);
} | java | public static Class convertPrimitiveToWrapper(Class clazz) {
if (clazz == null || !clazz.isPrimitive())
return clazz;
return (Class) primativeToWrapperMap.get(clazz);
} | [
"public",
"static",
"Class",
"convertPrimitiveToWrapper",
"(",
"Class",
"clazz",
")",
"{",
"if",
"(",
"clazz",
"==",
"null",
"||",
"!",
"clazz",
".",
"isPrimitive",
"(",
")",
")",
"return",
"clazz",
";",
"return",
"(",
"Class",
")",
"primativeToWrapperMap",
... | Gets the equivalent class to convert to if the given clazz is a
primitive.
@param clazz Class to examin.
@return the class to convert to or the inputted clazz. | [
"Gets",
"the",
"equivalent",
"class",
"to",
"convert",
"to",
"if",
"the",
"given",
"clazz",
"is",
"a",
"primitive",
"."
] | 6aad6e640b348cda8f3b0841f6e42025233f1eb8 | https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/util/ClassUtils.java#L229-L234 |
12,016 | lievendoclo/Valkyrie-RCP | valkyrie-rcp-core/src/main/java/org/valkyriercp/binding/beans/AbstractMemberPropertyAccessor.java | AbstractMemberPropertyAccessor.setTargetClass | protected void setTargetClass(Class targetClass) {
this.targetClass = targetClass;
this.readAccessors.clear();
this.writeAccessors.clear();
introspectMethods(targetClass, new HashSet());
if (isFieldAccessEnabled()) {
introspectFields(targetClass, new HashSet());
}
} | java | protected void setTargetClass(Class targetClass) {
this.targetClass = targetClass;
this.readAccessors.clear();
this.writeAccessors.clear();
introspectMethods(targetClass, new HashSet());
if (isFieldAccessEnabled()) {
introspectFields(targetClass, new HashSet());
}
} | [
"protected",
"void",
"setTargetClass",
"(",
"Class",
"targetClass",
")",
"{",
"this",
".",
"targetClass",
"=",
"targetClass",
";",
"this",
".",
"readAccessors",
".",
"clear",
"(",
")",
";",
"this",
".",
"writeAccessors",
".",
"clear",
"(",
")",
";",
"intro... | Clears all cached members and introspect methods again. If fieldAccess is
enabled introspect fields as well.
@param targetClass the target class. | [
"Clears",
"all",
"cached",
"members",
"and",
"introspect",
"methods",
"again",
".",
"If",
"fieldAccess",
"is",
"enabled",
"introspect",
"fields",
"as",
"well",
"."
] | 6aad6e640b348cda8f3b0841f6e42025233f1eb8 | https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/binding/beans/AbstractMemberPropertyAccessor.java#L73-L81 |
12,017 | lievendoclo/Valkyrie-RCP | valkyrie-rcp-core/src/main/java/org/valkyriercp/binding/beans/AbstractMemberPropertyAccessor.java | AbstractMemberPropertyAccessor.introspectFields | private void introspectFields(Class type, Set introspectedClasses) {
if (type == null || Object.class.equals(type) || type.isInterface() || introspectedClasses.contains(type)) {
return;
}
introspectedClasses.add(type);
introspectFields(type.getSuperclass(), introspectedClasses);
Field[] fields = type.getDe... | java | private void introspectFields(Class type, Set introspectedClasses) {
if (type == null || Object.class.equals(type) || type.isInterface() || introspectedClasses.contains(type)) {
return;
}
introspectedClasses.add(type);
introspectFields(type.getSuperclass(), introspectedClasses);
Field[] fields = type.getDe... | [
"private",
"void",
"introspectFields",
"(",
"Class",
"type",
",",
"Set",
"introspectedClasses",
")",
"{",
"if",
"(",
"type",
"==",
"null",
"||",
"Object",
".",
"class",
".",
"equals",
"(",
"type",
")",
"||",
"type",
".",
"isInterface",
"(",
")",
"||",
... | Introspect fields of a class. This excludes static fields and handles
final fields as readOnly.
@param type the class to inspect.
@param introspectedClasses a set of already inspected classes. | [
"Introspect",
"fields",
"of",
"a",
"class",
".",
"This",
"excludes",
"static",
"fields",
"and",
"handles",
"final",
"fields",
"as",
"readOnly",
"."
] | 6aad6e640b348cda8f3b0841f6e42025233f1eb8 | https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/binding/beans/AbstractMemberPropertyAccessor.java#L90-L105 |
12,018 | lievendoclo/Valkyrie-RCP | valkyrie-rcp-core/src/main/java/org/valkyriercp/binding/beans/AbstractMemberPropertyAccessor.java | AbstractMemberPropertyAccessor.introspectMethods | private void introspectMethods(Class type, Set introspectedClasses) {
if (type == null || Object.class.equals(type) || introspectedClasses.contains(type)) {
return;
}
introspectedClasses.add(type);
Class[] interfaces = type.getInterfaces();
for (int i = 0; i < interfaces.length; i++) {
introspectMethods... | java | private void introspectMethods(Class type, Set introspectedClasses) {
if (type == null || Object.class.equals(type) || introspectedClasses.contains(type)) {
return;
}
introspectedClasses.add(type);
Class[] interfaces = type.getInterfaces();
for (int i = 0; i < interfaces.length; i++) {
introspectMethods... | [
"private",
"void",
"introspectMethods",
"(",
"Class",
"type",
",",
"Set",
"introspectedClasses",
")",
"{",
"if",
"(",
"type",
"==",
"null",
"||",
"Object",
".",
"class",
".",
"equals",
"(",
"type",
")",
"||",
"introspectedClasses",
".",
"contains",
"(",
"t... | Introspect class for accessor methods. This includes methods starting
with 'get', 'set' and 'is'.
@param type class to introspect.
@param introspectedClasses set of already inspected classes. | [
"Introspect",
"class",
"for",
"accessor",
"methods",
".",
"This",
"includes",
"methods",
"starting",
"with",
"get",
"set",
"and",
"is",
"."
] | 6aad6e640b348cda8f3b0841f6e42025233f1eb8 | https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/binding/beans/AbstractMemberPropertyAccessor.java#L114-L137 |
12,019 | lievendoclo/Valkyrie-RCP | valkyrie-rcp-core/src/main/java/org/valkyriercp/binding/beans/AbstractMemberPropertyAccessor.java | AbstractMemberPropertyAccessor.getPropertyAccessor | protected Member getPropertyAccessor(String propertyName) {
if (readAccessors.containsKey(propertyName)) {
return (Member) readAccessors.get(propertyName);
}
else {
return (Member) writeAccessors.get(propertyName);
}
} | java | protected Member getPropertyAccessor(String propertyName) {
if (readAccessors.containsKey(propertyName)) {
return (Member) readAccessors.get(propertyName);
}
else {
return (Member) writeAccessors.get(propertyName);
}
} | [
"protected",
"Member",
"getPropertyAccessor",
"(",
"String",
"propertyName",
")",
"{",
"if",
"(",
"readAccessors",
".",
"containsKey",
"(",
"propertyName",
")",
")",
"{",
"return",
"(",
"Member",
")",
"readAccessors",
".",
"get",
"(",
"propertyName",
")",
";",... | Return any accessor, be it read or write, for the given property.
@param propertyName name of the property.
@return an accessor for the property or <code>null</code> | [
"Return",
"any",
"accessor",
"be",
"it",
"read",
"or",
"write",
"for",
"the",
"given",
"property",
"."
] | 6aad6e640b348cda8f3b0841f6e42025233f1eb8 | https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/binding/beans/AbstractMemberPropertyAccessor.java#L179-L186 |
12,020 | lievendoclo/Valkyrie-RCP | valkyrie-rcp-core/src/main/java/org/valkyriercp/binding/beans/AbstractMemberPropertyAccessor.java | AbstractMemberPropertyAccessor.getPropertyName | protected String getPropertyName(String methodName, int prefixLength) {
return Character.toLowerCase(methodName.charAt(prefixLength)) + methodName.substring(prefixLength + 1);
} | java | protected String getPropertyName(String methodName, int prefixLength) {
return Character.toLowerCase(methodName.charAt(prefixLength)) + methodName.substring(prefixLength + 1);
} | [
"protected",
"String",
"getPropertyName",
"(",
"String",
"methodName",
",",
"int",
"prefixLength",
")",
"{",
"return",
"Character",
".",
"toLowerCase",
"(",
"methodName",
".",
"charAt",
"(",
"prefixLength",
")",
")",
"+",
"methodName",
".",
"substring",
"(",
"... | Returns the propertyName based on the methodName. Cuts of the prefix and
removes first capital.
@param methodName name of method to convert.
@param prefixLength length of prefix to cut of.
@return property name. | [
"Returns",
"the",
"propertyName",
"based",
"on",
"the",
"methodName",
".",
"Cuts",
"of",
"the",
"prefix",
"and",
"removes",
"first",
"capital",
"."
] | 6aad6e640b348cda8f3b0841f6e42025233f1eb8 | https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/binding/beans/AbstractMemberPropertyAccessor.java#L370-L372 |
12,021 | lievendoclo/Valkyrie-RCP | valkyrie-rcp-core/src/main/java/org/valkyriercp/binding/beans/AbstractMemberPropertyAccessor.java | AbstractMemberPropertyAccessor.getRootPropertyName | protected String getRootPropertyName(String propertyName) {
int location = propertyName.indexOf(PROPERTY_KEY_PREFIX);
return location == -1 ? propertyName : propertyName.substring(0, location);
} | java | protected String getRootPropertyName(String propertyName) {
int location = propertyName.indexOf(PROPERTY_KEY_PREFIX);
return location == -1 ? propertyName : propertyName.substring(0, location);
} | [
"protected",
"String",
"getRootPropertyName",
"(",
"String",
"propertyName",
")",
"{",
"int",
"location",
"=",
"propertyName",
".",
"indexOf",
"(",
"PROPERTY_KEY_PREFIX",
")",
";",
"return",
"location",
"==",
"-",
"1",
"?",
"propertyName",
":",
"propertyName",
"... | Returns the root property of an indexed property. The root property is
the property that contains no indices.
@param propertyName the name of the property.
@return the root property. | [
"Returns",
"the",
"root",
"property",
"of",
"an",
"indexed",
"property",
".",
"The",
"root",
"property",
"is",
"the",
"property",
"that",
"contains",
"no",
"indices",
"."
] | 6aad6e640b348cda8f3b0841f6e42025233f1eb8 | https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/binding/beans/AbstractMemberPropertyAccessor.java#L381-L384 |
12,022 | lievendoclo/Valkyrie-RCP | valkyrie-rcp-core/src/main/java/org/valkyriercp/binding/beans/AbstractMemberPropertyAccessor.java | AbstractMemberPropertyAccessor.getParentPropertyName | protected String getParentPropertyName(String propertyName) {
if (!PropertyAccessorUtils.isIndexedProperty(propertyName)) {
return "";
}
else {
return propertyName.substring(0, propertyName.lastIndexOf(PROPERTY_KEY_PREFIX_CHAR));
}
} | java | protected String getParentPropertyName(String propertyName) {
if (!PropertyAccessorUtils.isIndexedProperty(propertyName)) {
return "";
}
else {
return propertyName.substring(0, propertyName.lastIndexOf(PROPERTY_KEY_PREFIX_CHAR));
}
} | [
"protected",
"String",
"getParentPropertyName",
"(",
"String",
"propertyName",
")",
"{",
"if",
"(",
"!",
"PropertyAccessorUtils",
".",
"isIndexedProperty",
"(",
"propertyName",
")",
")",
"{",
"return",
"\"\"",
";",
"}",
"else",
"{",
"return",
"propertyName",
"."... | Return the parent property name of an indexed property or the empty string.
@param propertyName the name of the property.
@return the empty string or the parent property name if it was indexed. | [
"Return",
"the",
"parent",
"property",
"name",
"of",
"an",
"indexed",
"property",
"or",
"the",
"empty",
"string",
"."
] | 6aad6e640b348cda8f3b0841f6e42025233f1eb8 | https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/binding/beans/AbstractMemberPropertyAccessor.java#L392-L399 |
12,023 | lievendoclo/Valkyrie-RCP | valkyrie-rcp-core/src/main/java/org/valkyriercp/binding/beans/AbstractMemberPropertyAccessor.java | AbstractMemberPropertyAccessor.setAssemblageValue | protected Object setAssemblageValue(Class assemblageType, Object assemblage, Object index, Object value) {
if (assemblageType.isArray()) {
int i = ((Integer) index).intValue();
if (Array.getLength(assemblage) <= i) {
Object newAssemblage = Array.newInstance(assemblageType.getComponentType(), i + 1);
Sys... | java | protected Object setAssemblageValue(Class assemblageType, Object assemblage, Object index, Object value) {
if (assemblageType.isArray()) {
int i = ((Integer) index).intValue();
if (Array.getLength(assemblage) <= i) {
Object newAssemblage = Array.newInstance(assemblageType.getComponentType(), i + 1);
Sys... | [
"protected",
"Object",
"setAssemblageValue",
"(",
"Class",
"assemblageType",
",",
"Object",
"assemblage",
",",
"Object",
"index",
",",
"Object",
"value",
")",
"{",
"if",
"(",
"assemblageType",
".",
"isArray",
"(",
")",
")",
"{",
"int",
"i",
"=",
"(",
"(",
... | Helper method for subclasses to set values of indexed properties, like
map-values, collection-values or array-values.
@param assemblageType either map or collection or array
@param assemblage the assemblage to set the value on
@param index the index to set the value at
@param value the value to set
@return the assembl... | [
"Helper",
"method",
"for",
"subclasses",
"to",
"set",
"values",
"of",
"indexed",
"properties",
"like",
"map",
"-",
"values",
"collection",
"-",
"values",
"or",
"array",
"-",
"values",
"."
] | 6aad6e640b348cda8f3b0841f6e42025233f1eb8 | https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/binding/beans/AbstractMemberPropertyAccessor.java#L502-L535 |
12,024 | lievendoclo/Valkyrie-RCP | valkyrie-rcp-core/src/main/java/org/valkyriercp/form/builder/AbstractFormBuilder.java | AbstractFormBuilder.createBinding | protected Binding createBinding(String fieldName, JComponent component) {
return getBindingFactory().bindControl(component, fieldName);
} | java | protected Binding createBinding(String fieldName, JComponent component) {
return getBindingFactory().bindControl(component, fieldName);
} | [
"protected",
"Binding",
"createBinding",
"(",
"String",
"fieldName",
",",
"JComponent",
"component",
")",
"{",
"return",
"getBindingFactory",
"(",
")",
".",
"bindControl",
"(",
"component",
",",
"fieldName",
")",
";",
"}"
] | Create a binding that uses the given component instead of its default
component.
@param fieldName the name of the property to bind.
@param component the component to bind to the property.
@return the {@link Binding} that binds the component to the valuemodel of
the property. | [
"Create",
"a",
"binding",
"that",
"uses",
"the",
"given",
"component",
"instead",
"of",
"its",
"default",
"component",
"."
] | 6aad6e640b348cda8f3b0841f6e42025233f1eb8 | https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/form/builder/AbstractFormBuilder.java#L111-L113 |
12,025 | lievendoclo/Valkyrie-RCP | valkyrie-rcp-core/src/main/java/org/valkyriercp/form/builder/AbstractFormBuilder.java | AbstractFormBuilder.createLabelFor | protected JLabel createLabelFor(String fieldName, JComponent component) {
JLabel label = getComponentFactory().createLabel("");
getFormModel().getFieldFace(fieldName).configure(label);
label.setLabelFor(component);
FormComponentInterceptor interceptor = getFormComponentInterceptor();
if (interceptor != null)... | java | protected JLabel createLabelFor(String fieldName, JComponent component) {
JLabel label = getComponentFactory().createLabel("");
getFormModel().getFieldFace(fieldName).configure(label);
label.setLabelFor(component);
FormComponentInterceptor interceptor = getFormComponentInterceptor();
if (interceptor != null)... | [
"protected",
"JLabel",
"createLabelFor",
"(",
"String",
"fieldName",
",",
"JComponent",
"component",
")",
"{",
"JLabel",
"label",
"=",
"getComponentFactory",
"(",
")",
".",
"createLabel",
"(",
"\"\"",
")",
";",
"getFormModel",
"(",
")",
".",
"getFieldFace",
"(... | Create a label for the property.
@param fieldName the name of the property.
@param component the component of the property which is related to the
label.
@return a {@link JLabel} for the property. | [
"Create",
"a",
"label",
"for",
"the",
"property",
"."
] | 6aad6e640b348cda8f3b0841f6e42025233f1eb8 | https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/form/builder/AbstractFormBuilder.java#L184-L195 |
12,026 | lievendoclo/Valkyrie-RCP | valkyrie-rcp-core/src/main/java/org/valkyriercp/util/WindowUtils.java | WindowUtils.getCenteringPointOnScreen | public static Point getCenteringPointOnScreen(Dimension dimension) {
Dimension screen = Toolkit.getDefaultToolkit().getScreenSize();
if (dimension.width > screen.width) {
dimension.width = screen.width;
}
if (dimension.height > screen.height) {
dimension.height = screen.height;
}
return new Point((scr... | java | public static Point getCenteringPointOnScreen(Dimension dimension) {
Dimension screen = Toolkit.getDefaultToolkit().getScreenSize();
if (dimension.width > screen.width) {
dimension.width = screen.width;
}
if (dimension.height > screen.height) {
dimension.height = screen.height;
}
return new Point((scr... | [
"public",
"static",
"Point",
"getCenteringPointOnScreen",
"(",
"Dimension",
"dimension",
")",
"{",
"Dimension",
"screen",
"=",
"Toolkit",
".",
"getDefaultToolkit",
"(",
")",
".",
"getScreenSize",
"(",
")",
";",
"if",
"(",
"dimension",
".",
"width",
">",
"scree... | Return the centering point on the screen for the object with the
specified dimension.
@param dimension the dimension of an object
@return The centering point on the screen for that object. | [
"Return",
"the",
"centering",
"point",
"on",
"the",
"screen",
"for",
"the",
"object",
"with",
"the",
"specified",
"dimension",
"."
] | 6aad6e640b348cda8f3b0841f6e42025233f1eb8 | https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/util/WindowUtils.java#L43-L52 |
12,027 | lievendoclo/Valkyrie-RCP | valkyrie-rcp-core/src/main/java/org/valkyriercp/util/WindowUtils.java | WindowUtils.centerOnScreenAndSetVisible | public static void centerOnScreenAndSetVisible(Window window) {
window.pack();
centerOnScreen(window);
window.setVisible(true);
} | java | public static void centerOnScreenAndSetVisible(Window window) {
window.pack();
centerOnScreen(window);
window.setVisible(true);
} | [
"public",
"static",
"void",
"centerOnScreenAndSetVisible",
"(",
"Window",
"window",
")",
"{",
"window",
".",
"pack",
"(",
")",
";",
"centerOnScreen",
"(",
"window",
")",
";",
"window",
".",
"setVisible",
"(",
"true",
")",
";",
"}"
] | Pack the window, center it on the screen, and set the window visible.
@param window the window to center and show. | [
"Pack",
"the",
"window",
"center",
"it",
"on",
"the",
"screen",
"and",
"set",
"the",
"window",
"visible",
"."
] | 6aad6e640b348cda8f3b0841f6e42025233f1eb8 | https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/util/WindowUtils.java#L59-L63 |
12,028 | lievendoclo/Valkyrie-RCP | valkyrie-rcp-core/src/main/java/org/valkyriercp/util/WindowUtils.java | WindowUtils.centerOnParentAndSetVisible | public static void centerOnParentAndSetVisible(Window window) {
window.pack();
centerOnParent(window, window.getParent());
window.setVisible(true);
} | java | public static void centerOnParentAndSetVisible(Window window) {
window.pack();
centerOnParent(window, window.getParent());
window.setVisible(true);
} | [
"public",
"static",
"void",
"centerOnParentAndSetVisible",
"(",
"Window",
"window",
")",
"{",
"window",
".",
"pack",
"(",
")",
";",
"centerOnParent",
"(",
"window",
",",
"window",
".",
"getParent",
"(",
")",
")",
";",
"window",
".",
"setVisible",
"(",
"tru... | Pack the window, center it relative to it's parent, and set the window
visible.
@param window the window to center and show. | [
"Pack",
"the",
"window",
"center",
"it",
"relative",
"to",
"it",
"s",
"parent",
"and",
"set",
"the",
"window",
"visible",
"."
] | 6aad6e640b348cda8f3b0841f6e42025233f1eb8 | https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/util/WindowUtils.java#L101-L105 |
12,029 | lievendoclo/Valkyrie-RCP | valkyrie-rcp-core/src/main/java/org/valkyriercp/util/WindowUtils.java | WindowUtils.centerOnParent | public static void centerOnParent(Window window, Component parent) {
if (parent == null || !parent.isShowing()) {
// call our own centerOnScreen so we work around bug in
// setLocationRelativeTo(null)
centerOnScreen(window);
}
else {
window.setLocationRelativeTo(parent);
}
} | java | public static void centerOnParent(Window window, Component parent) {
if (parent == null || !parent.isShowing()) {
// call our own centerOnScreen so we work around bug in
// setLocationRelativeTo(null)
centerOnScreen(window);
}
else {
window.setLocationRelativeTo(parent);
}
} | [
"public",
"static",
"void",
"centerOnParent",
"(",
"Window",
"window",
",",
"Component",
"parent",
")",
"{",
"if",
"(",
"parent",
"==",
"null",
"||",
"!",
"parent",
".",
"isShowing",
"(",
")",
")",
"{",
"// call our own centerOnScreen so we work around bug in",
... | Center the window relative to it's parent. If the parent is null, or not showing,
the window will be centered on the screen
@param window the window to center
@param parent the parent | [
"Center",
"the",
"window",
"relative",
"to",
"it",
"s",
"parent",
".",
"If",
"the",
"parent",
"is",
"null",
"or",
"not",
"showing",
"the",
"window",
"will",
"be",
"centered",
"on",
"the",
"screen"
] | 6aad6e640b348cda8f3b0841f6e42025233f1eb8 | https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/util/WindowUtils.java#L114-L123 |
12,030 | lievendoclo/Valkyrie-RCP | valkyrie-rcp-core/src/main/java/org/valkyriercp/security/remoting/BasicAuthCommonsHttpInvokerProxyFactoryBean.java | BasicAuthCommonsHttpInvokerProxyFactoryBean.setAuthenticationToken | public void setAuthenticationToken(Authentication authentication) {
if( logger.isDebugEnabled() ) {
logger.debug("New authentication token: " + authentication);
}
HttpComponentsHttpInvokerRequestExecutor executor
= (HttpComponentsHttpInvokerRequestExecutor) getHttpIn... | java | public void setAuthenticationToken(Authentication authentication) {
if( logger.isDebugEnabled() ) {
logger.debug("New authentication token: " + authentication);
}
HttpComponentsHttpInvokerRequestExecutor executor
= (HttpComponentsHttpInvokerRequestExecutor) getHttpIn... | [
"public",
"void",
"setAuthenticationToken",
"(",
"Authentication",
"authentication",
")",
"{",
"if",
"(",
"logger",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"logger",
".",
"debug",
"(",
"\"New authentication token: \"",
"+",
"authentication",
")",
";",
"}",
"H... | Handle a change in the current authentication token.
This method will fail fast if the executor isn't a CommonsHttpInvokerRequestExecutor.
@see org.valkyriercp.security.AuthenticationAware#setAuthenticationToken(org.springframework.security.core.Authentication) | [
"Handle",
"a",
"change",
"in",
"the",
"current",
"authentication",
"token",
".",
"This",
"method",
"will",
"fail",
"fast",
"if",
"the",
"executor",
"isn",
"t",
"a",
"CommonsHttpInvokerRequestExecutor",
"."
] | 6aad6e640b348cda8f3b0841f6e42025233f1eb8 | https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/security/remoting/BasicAuthCommonsHttpInvokerProxyFactoryBean.java#L81-L100 |
12,031 | lievendoclo/Valkyrie-RCP | valkyrie-rcp-core/src/main/java/org/valkyriercp/command/support/ShowPageCommand.java | ShowPageCommand.setPageDescriptor | public final void setPageDescriptor(PageDescriptor pageDescriptor) {
Assert.notNull(pageDescriptor, "pageDescriptor");
setId(pageDescriptor.getId());
setLabel(pageDescriptor.getShowPageCommandLabel());
setIcon(pageDescriptor.getIcon());
setCaption(pageDescriptor.getCaption());
... | java | public final void setPageDescriptor(PageDescriptor pageDescriptor) {
Assert.notNull(pageDescriptor, "pageDescriptor");
setId(pageDescriptor.getId());
setLabel(pageDescriptor.getShowPageCommandLabel());
setIcon(pageDescriptor.getIcon());
setCaption(pageDescriptor.getCaption());
... | [
"public",
"final",
"void",
"setPageDescriptor",
"(",
"PageDescriptor",
"pageDescriptor",
")",
"{",
"Assert",
".",
"notNull",
"(",
"pageDescriptor",
",",
"\"pageDescriptor\"",
")",
";",
"setId",
"(",
"pageDescriptor",
".",
"getId",
"(",
")",
")",
";",
"setLabel",... | Sets the descriptor for the page that is to be opened by this command object. This
command object will be assigned the id, label, icon, and caption from the given page
descriptor.
@param pageDescriptor The page descriptor, cannot be null.
@throws IllegalArgumentException if {@code pageDescriptor} is null. | [
"Sets",
"the",
"descriptor",
"for",
"the",
"page",
"that",
"is",
"to",
"be",
"opened",
"by",
"this",
"command",
"object",
".",
"This",
"command",
"object",
"will",
"be",
"assigned",
"the",
"id",
"label",
"icon",
"and",
"caption",
"from",
"the",
"given",
... | 6aad6e640b348cda8f3b0841f6e42025233f1eb8 | https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/command/support/ShowPageCommand.java#L74-L81 |
12,032 | lievendoclo/Valkyrie-RCP | valkyrie-rcp-core/src/main/java/org/valkyriercp/application/splash/ProgressSplashScreen.java | ProgressSplashScreen.createContentPane | protected Component createContentPane() {
JPanel content = new JPanel(new BorderLayout());
Component component = super.createContentPane();
if(component != null)
content.add(component);
JProgressBar progressBar = getProgressBar();
progressBar.setIndeterminate(isIndet... | java | protected Component createContentPane() {
JPanel content = new JPanel(new BorderLayout());
Component component = super.createContentPane();
if(component != null)
content.add(component);
JProgressBar progressBar = getProgressBar();
progressBar.setIndeterminate(isIndet... | [
"protected",
"Component",
"createContentPane",
"(",
")",
"{",
"JPanel",
"content",
"=",
"new",
"JPanel",
"(",
"new",
"BorderLayout",
"(",
")",
")",
";",
"Component",
"component",
"=",
"super",
".",
"createContentPane",
"(",
")",
";",
"if",
"(",
"component",
... | Returns a component that displays an image above a progress bar.
@return A splash screen containing an image and a progress bar, never null. | [
"Returns",
"a",
"component",
"that",
"displays",
"an",
"image",
"above",
"a",
"progress",
"bar",
"."
] | 6aad6e640b348cda8f3b0841f6e42025233f1eb8 | https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/application/splash/ProgressSplashScreen.java#L75-L88 |
12,033 | lievendoclo/Valkyrie-RCP | valkyrie-rcp-core/src/main/java/org/valkyriercp/application/splash/ProgressSplashScreen.java | ProgressSplashScreen.getProgressBar | protected JProgressBar getProgressBar() {
if (progressBar == null) {
progressBar = createProgressBar();
Assert.notNull(progressBar, "createProgressBar should not return null");
}
return progressBar;
} | java | protected JProgressBar getProgressBar() {
if (progressBar == null) {
progressBar = createProgressBar();
Assert.notNull(progressBar, "createProgressBar should not return null");
}
return progressBar;
} | [
"protected",
"JProgressBar",
"getProgressBar",
"(",
")",
"{",
"if",
"(",
"progressBar",
"==",
"null",
")",
"{",
"progressBar",
"=",
"createProgressBar",
"(",
")",
";",
"Assert",
".",
"notNull",
"(",
"progressBar",
",",
"\"createProgressBar should not return null\"",... | Returns the progress bar.
@return not null | [
"Returns",
"the",
"progress",
"bar",
"."
] | 6aad6e640b348cda8f3b0841f6e42025233f1eb8 | https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/application/splash/ProgressSplashScreen.java#L112-L118 |
12,034 | lievendoclo/Valkyrie-RCP | valkyrie-rcp-core/src/main/java/org/valkyriercp/application/exceptionhandling/DelegatingExceptionHandler.java | DelegatingExceptionHandler.uncaughtException | public void uncaughtException(Thread thread, Throwable throwable) {
if (exceptionPurger != null) {
throwable = exceptionPurger.purge(throwable);
}
for (ExceptionHandlerDelegate delegate : delegateList) {
if (delegate.hasAppropriateHandler(throwable)) {
del... | java | public void uncaughtException(Thread thread, Throwable throwable) {
if (exceptionPurger != null) {
throwable = exceptionPurger.purge(throwable);
}
for (ExceptionHandlerDelegate delegate : delegateList) {
if (delegate.hasAppropriateHandler(throwable)) {
del... | [
"public",
"void",
"uncaughtException",
"(",
"Thread",
"thread",
",",
"Throwable",
"throwable",
")",
"{",
"if",
"(",
"exceptionPurger",
"!=",
"null",
")",
"{",
"throwable",
"=",
"exceptionPurger",
".",
"purge",
"(",
"throwable",
")",
";",
"}",
"for",
"(",
"... | Delegates the throwable to the appropriate delegate exception handler.
@param thread the thread in which the throwable occurred
@param throwable the thrown throwable | [
"Delegates",
"the",
"throwable",
"to",
"the",
"appropriate",
"delegate",
"exception",
"handler",
"."
] | 6aad6e640b348cda8f3b0841f6e42025233f1eb8 | https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/application/exceptionhandling/DelegatingExceptionHandler.java#L96-L108 |
12,035 | lievendoclo/Valkyrie-RCP | valkyrie-rcp-core/src/main/java/org/valkyriercp/list/ListSelectionValueModelAdapter.java | ListSelectionValueModelAdapter.setValue | public void setValue( Object newValue ) {
int[] newSelection = (int[]) newValue;
if( hasChanged(currentSelection, newSelection) ) {
int[] oldValue = currentSelection;
currentSelection = newSelection;
fireValueChange(oldValue, currentSelection);
if( !ski... | java | public void setValue( Object newValue ) {
int[] newSelection = (int[]) newValue;
if( hasChanged(currentSelection, newSelection) ) {
int[] oldValue = currentSelection;
currentSelection = newSelection;
fireValueChange(oldValue, currentSelection);
if( !ski... | [
"public",
"void",
"setValue",
"(",
"Object",
"newValue",
")",
"{",
"int",
"[",
"]",
"newSelection",
"=",
"(",
"int",
"[",
"]",
")",
"newValue",
";",
"if",
"(",
"hasChanged",
"(",
"currentSelection",
",",
"newSelection",
")",
")",
"{",
"int",
"[",
"]",
... | Set the selection value.
@param newValue must be an integer array (int[]) | [
"Set",
"the",
"selection",
"value",
"."
] | 6aad6e640b348cda8f3b0841f6e42025233f1eb8 | https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/list/ListSelectionValueModelAdapter.java#L79-L111 |
12,036 | lievendoclo/Valkyrie-RCP | valkyrie-rcp-core/src/main/java/org/valkyriercp/list/ListSelectionValueModelAdapter.java | ListSelectionValueModelAdapter.hasChanged | private boolean hasChanged( int[] oldValue, int[] newValue ) {
if( oldValue.length == newValue.length ) {
for( int i = 0; i < newValue.length; i++ ) {
if( oldValue[i] != newValue[i] ) {
return true;
}
}
return false;
... | java | private boolean hasChanged( int[] oldValue, int[] newValue ) {
if( oldValue.length == newValue.length ) {
for( int i = 0; i < newValue.length; i++ ) {
if( oldValue[i] != newValue[i] ) {
return true;
}
}
return false;
... | [
"private",
"boolean",
"hasChanged",
"(",
"int",
"[",
"]",
"oldValue",
",",
"int",
"[",
"]",
"newValue",
")",
"{",
"if",
"(",
"oldValue",
".",
"length",
"==",
"newValue",
".",
"length",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"n... | See if two arrays are different. | [
"See",
"if",
"two",
"arrays",
"are",
"different",
"."
] | 6aad6e640b348cda8f3b0841f6e42025233f1eb8 | https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/list/ListSelectionValueModelAdapter.java#L116-L126 |
12,037 | lievendoclo/Valkyrie-RCP | valkyrie-rcp-core/src/main/java/org/valkyriercp/list/ListSelectionValueModelAdapter.java | ListSelectionValueModelAdapter.getSelectedRows | private int[] getSelectedRows() {
int iMin = model.getMinSelectionIndex();
int iMax = model.getMaxSelectionIndex();
if( (iMin == -1) || (iMax == -1) ) {
return new int[0];
}
int[] rvTmp = new int[1 + (iMax - iMin)];
int n = 0;
for( int i = iMin; i <=... | java | private int[] getSelectedRows() {
int iMin = model.getMinSelectionIndex();
int iMax = model.getMaxSelectionIndex();
if( (iMin == -1) || (iMax == -1) ) {
return new int[0];
}
int[] rvTmp = new int[1 + (iMax - iMin)];
int n = 0;
for( int i = iMin; i <=... | [
"private",
"int",
"[",
"]",
"getSelectedRows",
"(",
")",
"{",
"int",
"iMin",
"=",
"model",
".",
"getMinSelectionIndex",
"(",
")",
";",
"int",
"iMax",
"=",
"model",
".",
"getMaxSelectionIndex",
"(",
")",
";",
"if",
"(",
"(",
"iMin",
"==",
"-",
"1",
")... | Returns the indices of all selected rows in the model.
@return an array of integers containing the indices of all selected rows,
or an empty array if no row is selected | [
"Returns",
"the",
"indices",
"of",
"all",
"selected",
"rows",
"in",
"the",
"model",
"."
] | 6aad6e640b348cda8f3b0841f6e42025233f1eb8 | https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/list/ListSelectionValueModelAdapter.java#L134-L152 |
12,038 | lievendoclo/Valkyrie-RCP | valkyrie-rcp-core/src/main/java/org/valkyriercp/application/support/BeanFactoryViewDescriptorRegistry.java | BeanFactoryViewDescriptorRegistry.getViewDescriptor | public ViewDescriptor getViewDescriptor(String viewName) {
Assert.notNull(viewName, "viewName");
try {
return (ViewDescriptor) applicationContext.getBean(viewName, ViewDescriptor.class);
}
catch (NoSuchBeanDefinitionException e) {
return null;
}
} | java | public ViewDescriptor getViewDescriptor(String viewName) {
Assert.notNull(viewName, "viewName");
try {
return (ViewDescriptor) applicationContext.getBean(viewName, ViewDescriptor.class);
}
catch (NoSuchBeanDefinitionException e) {
return null;
}
} | [
"public",
"ViewDescriptor",
"getViewDescriptor",
"(",
"String",
"viewName",
")",
"{",
"Assert",
".",
"notNull",
"(",
"viewName",
",",
"\"viewName\"",
")",
";",
"try",
"{",
"return",
"(",
"ViewDescriptor",
")",
"applicationContext",
".",
"getBean",
"(",
"viewName... | Returns the view descriptor with the given identifier, or null if no such bean definition
with the given name exists in the current application context.
@param viewName The bean name of the view descriptor that is to be retrieved from the
underlying application context. Must not be null.
@throws IllegalArgumentExcept... | [
"Returns",
"the",
"view",
"descriptor",
"with",
"the",
"given",
"identifier",
"or",
"null",
"if",
"no",
"such",
"bean",
"definition",
"with",
"the",
"given",
"name",
"exists",
"in",
"the",
"current",
"application",
"context",
"."
] | 6aad6e640b348cda8f3b0841f6e42025233f1eb8 | https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/application/support/BeanFactoryViewDescriptorRegistry.java#L66-L77 |
12,039 | lievendoclo/Valkyrie-RCP | valkyrie-rcp-core/src/main/java/org/valkyriercp/form/builder/FormLayoutFormBuilder.java | FormLayoutFormBuilder.setLayout | public void setLayout(FormLayout layout, JPanel panel)
{
this.panel = panel;
this.layout = layout;
panel.setLayout(layout);
cc = new CellConstraints();
row = -1;
} | java | public void setLayout(FormLayout layout, JPanel panel)
{
this.panel = panel;
this.layout = layout;
panel.setLayout(layout);
cc = new CellConstraints();
row = -1;
} | [
"public",
"void",
"setLayout",
"(",
"FormLayout",
"layout",
",",
"JPanel",
"panel",
")",
"{",
"this",
".",
"panel",
"=",
"panel",
";",
"this",
".",
"layout",
"=",
"layout",
";",
"panel",
".",
"setLayout",
"(",
"layout",
")",
";",
"cc",
"=",
"new",
"C... | Set a panel with the provided layout layout.
@param layout JGoodies FormLayout
@param panel JPanel on which the builder will place the components. | [
"Set",
"a",
"panel",
"with",
"the",
"provided",
"layout",
"layout",
"."
] | 6aad6e640b348cda8f3b0841f6e42025233f1eb8 | https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/form/builder/FormLayoutFormBuilder.java#L208-L215 |
12,040 | lievendoclo/Valkyrie-RCP | valkyrie-rcp-core/src/main/java/org/valkyriercp/form/builder/FormLayoutFormBuilder.java | FormLayoutFormBuilder.addBinding | public JComponent addBinding(Binding binding, int column, int row, int widthSpan, int heightSpan)
{
((SwingBindingFactory) getBindingFactory()).interceptBinding(binding);
JComponent component = binding.getControl();
addComponent(component, column, row, widthSpan, heightSpan);
return ... | java | public JComponent addBinding(Binding binding, int column, int row, int widthSpan, int heightSpan)
{
((SwingBindingFactory) getBindingFactory()).interceptBinding(binding);
JComponent component = binding.getControl();
addComponent(component, column, row, widthSpan, heightSpan);
return ... | [
"public",
"JComponent",
"addBinding",
"(",
"Binding",
"binding",
",",
"int",
"column",
",",
"int",
"row",
",",
"int",
"widthSpan",
",",
"int",
"heightSpan",
")",
"{",
"(",
"(",
"SwingBindingFactory",
")",
"getBindingFactory",
"(",
")",
")",
".",
"interceptBi... | Add a binder to a column and a row with width and height spanning. | [
"Add",
"a",
"binder",
"to",
"a",
"column",
"and",
"a",
"row",
"with",
"width",
"and",
"height",
"spanning",
"."
] | 6aad6e640b348cda8f3b0841f6e42025233f1eb8 | https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/form/builder/FormLayoutFormBuilder.java#L271-L277 |
12,041 | lievendoclo/Valkyrie-RCP | valkyrie-rcp-core/src/main/java/org/valkyriercp/util/PopupMenuMouseListener.java | PopupMenuMouseListener.showPopupMenu | protected void showPopupMenu(MouseEvent e) {
if (onAboutToShow(e)) {
JPopupMenu popupToShow = getPopupMenu(e);
if (popupToShow == null) {
return;
}
popupToShow.show(e.getComponent(), e.getX(), e.getY());
popupToShow.setVisible(true);
... | java | protected void showPopupMenu(MouseEvent e) {
if (onAboutToShow(e)) {
JPopupMenu popupToShow = getPopupMenu(e);
if (popupToShow == null) {
return;
}
popupToShow.show(e.getComponent(), e.getX(), e.getY());
popupToShow.setVisible(true);
... | [
"protected",
"void",
"showPopupMenu",
"(",
"MouseEvent",
"e",
")",
"{",
"if",
"(",
"onAboutToShow",
"(",
"e",
")",
")",
"{",
"JPopupMenu",
"popupToShow",
"=",
"getPopupMenu",
"(",
"e",
")",
";",
"if",
"(",
"popupToShow",
"==",
"null",
")",
"{",
"return",... | Called to display the popup menu. | [
"Called",
"to",
"display",
"the",
"popup",
"menu",
"."
] | 6aad6e640b348cda8f3b0841f6e42025233f1eb8 | https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/util/PopupMenuMouseListener.java#L64-L73 |
12,042 | lievendoclo/Valkyrie-RCP | valkyrie-rcp-integrations/valkyrie-rcp-jidedocking/src/main/java/org/valkyriercp/application/docking/editor/EditorComponentPane.java | EditorComponentPane.createViewToolBar | protected JComponent createViewToolBar() {
if(getPageComponent() instanceof AbstractEditor){
AbstractEditor editor = (AbstractEditor)getPageComponent();
return editor.getEditorToolBar();
}
return null;
} | java | protected JComponent createViewToolBar() {
if(getPageComponent() instanceof AbstractEditor){
AbstractEditor editor = (AbstractEditor)getPageComponent();
return editor.getEditorToolBar();
}
return null;
} | [
"protected",
"JComponent",
"createViewToolBar",
"(",
")",
"{",
"if",
"(",
"getPageComponent",
"(",
")",
"instanceof",
"AbstractEditor",
")",
"{",
"AbstractEditor",
"editor",
"=",
"(",
"AbstractEditor",
")",
"getPageComponent",
"(",
")",
";",
"return",
"editor",
... | Returns the view specific toolbar if the underlying view
implementation supports it. | [
"Returns",
"the",
"view",
"specific",
"toolbar",
"if",
"the",
"underlying",
"view",
"implementation",
"supports",
"it",
"."
] | 6aad6e640b348cda8f3b0841f6e42025233f1eb8 | https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-integrations/valkyrie-rcp-jidedocking/src/main/java/org/valkyriercp/application/docking/editor/EditorComponentPane.java#L77-L83 |
12,043 | lievendoclo/Valkyrie-RCP | valkyrie-rcp-integrations/valkyrie-rcp-jidedocking/src/main/java/org/valkyriercp/application/docking/editor/EditorComponentPane.java | EditorComponentPane.createViewMenuBar | protected JComponent createViewMenuBar() {
if(getPageComponent() instanceof AbstractEditor){
AbstractEditor editor = (AbstractEditor)getPageComponent();
return editor.getEditorMenuBar();
}
return null;
} | java | protected JComponent createViewMenuBar() {
if(getPageComponent() instanceof AbstractEditor){
AbstractEditor editor = (AbstractEditor)getPageComponent();
return editor.getEditorMenuBar();
}
return null;
} | [
"protected",
"JComponent",
"createViewMenuBar",
"(",
")",
"{",
"if",
"(",
"getPageComponent",
"(",
")",
"instanceof",
"AbstractEditor",
")",
"{",
"AbstractEditor",
"editor",
"=",
"(",
"AbstractEditor",
")",
"getPageComponent",
"(",
")",
";",
"return",
"editor",
... | Returns the view specific menubar if the underlying view
implementation supports it. | [
"Returns",
"the",
"view",
"specific",
"menubar",
"if",
"the",
"underlying",
"view",
"implementation",
"supports",
"it",
"."
] | 6aad6e640b348cda8f3b0841f6e42025233f1eb8 | https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-integrations/valkyrie-rcp-jidedocking/src/main/java/org/valkyriercp/application/docking/editor/EditorComponentPane.java#L89-L95 |
12,044 | lievendoclo/Valkyrie-RCP | valkyrie-rcp-core/src/main/java/org/valkyriercp/command/support/CommandGroupModelBuilder.java | CommandGroupModelBuilder.buildModel | public final Object buildModel(CommandGroup commandGroup)
{
Object model = buildRootModel(commandGroup);
recurse(commandGroup, model, 0);
return model;
} | java | public final Object buildModel(CommandGroup commandGroup)
{
Object model = buildRootModel(commandGroup);
recurse(commandGroup, model, 0);
return model;
} | [
"public",
"final",
"Object",
"buildModel",
"(",
"CommandGroup",
"commandGroup",
")",
"{",
"Object",
"model",
"=",
"buildRootModel",
"(",
"commandGroup",
")",
";",
"recurse",
"(",
"commandGroup",
",",
"model",
",",
"0",
")",
";",
"return",
"model",
";",
"}"
] | Main service method of this method to call.
This builds the complete mapping object-model by traversing the complete
passed in command-group structure by performing the appropriate callbacks
to the subclass implementations of {@link #buildRootModel(CommandGroup)},
{@link #buildChildModel(Object, AbstractCommand, int)}... | [
"Main",
"service",
"method",
"of",
"this",
"method",
"to",
"call",
"."
] | 6aad6e640b348cda8f3b0841f6e42025233f1eb8 | https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/command/support/CommandGroupModelBuilder.java#L133-L140 |
12,045 | lievendoclo/Valkyrie-RCP | valkyrie-rcp-core/src/main/java/org/valkyriercp/security/support/DefaultApplicationSecurityManager.java | DefaultApplicationSecurityManager.getAuthenticationManager | @Override
public AuthenticationManager getAuthenticationManager() {
if(ValkyrieRepository.getInstance().getApplicationConfig().applicationContext().getBeansOfType(AuthenticationManager.class).size() != 0)
return ValkyrieRepository.getInstance().getBean(AuthenticationManager.class);
else {
... | java | @Override
public AuthenticationManager getAuthenticationManager() {
if(ValkyrieRepository.getInstance().getApplicationConfig().applicationContext().getBeansOfType(AuthenticationManager.class).size() != 0)
return ValkyrieRepository.getInstance().getBean(AuthenticationManager.class);
else {
... | [
"@",
"Override",
"public",
"AuthenticationManager",
"getAuthenticationManager",
"(",
")",
"{",
"if",
"(",
"ValkyrieRepository",
".",
"getInstance",
"(",
")",
".",
"getApplicationConfig",
"(",
")",
".",
"applicationContext",
"(",
")",
".",
"getBeansOfType",
"(",
"A... | Get the authentication manager in use.
@return authenticationManager instance used for authentication requests | [
"Get",
"the",
"authentication",
"manager",
"in",
"use",
"."
] | 6aad6e640b348cda8f3b0841f6e42025233f1eb8 | https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/security/support/DefaultApplicationSecurityManager.java#L146-L154 |
12,046 | lievendoclo/Valkyrie-RCP | valkyrie-rcp-core/src/main/java/org/valkyriercp/security/support/DefaultApplicationSecurityManager.java | DefaultApplicationSecurityManager.isUserInRole | @Override
public boolean isUserInRole(String role) {
boolean inRole = false;
Authentication authentication = getAuthentication();
if (authentication != null) {
Collection<? extends GrantedAuthority> authorities = authentication
.getAuthorities();
for (GrantedAuthority authority : authorities) {
i... | java | @Override
public boolean isUserInRole(String role) {
boolean inRole = false;
Authentication authentication = getAuthentication();
if (authentication != null) {
Collection<? extends GrantedAuthority> authorities = authentication
.getAuthorities();
for (GrantedAuthority authority : authorities) {
i... | [
"@",
"Override",
"public",
"boolean",
"isUserInRole",
"(",
"String",
"role",
")",
"{",
"boolean",
"inRole",
"=",
"false",
";",
"Authentication",
"authentication",
"=",
"getAuthentication",
"(",
")",
";",
"if",
"(",
"authentication",
"!=",
"null",
")",
"{",
"... | Determine if the currently authenticated user has the role provided. Note
that role comparisons are case sensitive.
@param role
to check
@return true if the user has the role requested | [
"Determine",
"if",
"the",
"currently",
"authenticated",
"user",
"has",
"the",
"role",
"provided",
".",
"Note",
"that",
"role",
"comparisons",
"are",
"case",
"sensitive",
"."
] | 6aad6e640b348cda8f3b0841f6e42025233f1eb8 | https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/security/support/DefaultApplicationSecurityManager.java#L250-L266 |
12,047 | lievendoclo/Valkyrie-RCP | valkyrie-rcp-core/src/main/java/org/valkyriercp/security/support/DefaultApplicationSecurityManager.java | DefaultApplicationSecurityManager.tryToWire | protected <T> boolean tryToWire(Class<T> type) {
boolean success = false;
String className = type.getName();
Map<String, T> map = getApplicationConfig().applicationContext().getBeansOfType(type);
if (logger.isDebugEnabled()) {
logger.debug("Search for '" + className + "' found: " + map);
}
if (map.size(... | java | protected <T> boolean tryToWire(Class<T> type) {
boolean success = false;
String className = type.getName();
Map<String, T> map = getApplicationConfig().applicationContext().getBeansOfType(type);
if (logger.isDebugEnabled()) {
logger.debug("Search for '" + className + "' found: " + map);
}
if (map.size(... | [
"protected",
"<",
"T",
">",
"boolean",
"tryToWire",
"(",
"Class",
"<",
"T",
">",
"type",
")",
"{",
"boolean",
"success",
"=",
"false",
";",
"String",
"className",
"=",
"type",
".",
"getName",
"(",
")",
";",
"Map",
"<",
"String",
",",
"T",
">",
"map... | Try to locate and "wire in" a suitable authentication manager.
@param type
The type of bean to look for
@return true if we found and wired a suitable bean | [
"Try",
"to",
"locate",
"and",
"wire",
"in",
"a",
"suitable",
"authentication",
"manager",
"."
] | 6aad6e640b348cda8f3b0841f6e42025233f1eb8 | https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/security/support/DefaultApplicationSecurityManager.java#L325-L360 |
12,048 | lievendoclo/Valkyrie-RCP | valkyrie-rcp-core/src/main/java/org/valkyriercp/core/support/LabelInfo.java | LabelInfo.checkForValidEscapedCharacter | private static void checkForValidEscapedCharacter(int index, String labelDescriptor) {
if (index >= labelDescriptor.length()) {
throw new IllegalArgumentException(
"The label descriptor contains an invalid escape sequence. Backslash "
+ "characters (\\) must ... | java | private static void checkForValidEscapedCharacter(int index, String labelDescriptor) {
if (index >= labelDescriptor.length()) {
throw new IllegalArgumentException(
"The label descriptor contains an invalid escape sequence. Backslash "
+ "characters (\\) must ... | [
"private",
"static",
"void",
"checkForValidEscapedCharacter",
"(",
"int",
"index",
",",
"String",
"labelDescriptor",
")",
"{",
"if",
"(",
"index",
">=",
"labelDescriptor",
".",
"length",
"(",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"The... | Confirms that the character at the specified index within the given label descriptor is
a valid 'escapable' character. i.e. either an ampersand or backslash.
@param index The position within the label descriptor of the character to be checked.
@param labelDescriptor The label descriptor.
@throws NullPointerException ... | [
"Confirms",
"that",
"the",
"character",
"at",
"the",
"specified",
"index",
"within",
"the",
"given",
"label",
"descriptor",
"is",
"a",
"valid",
"escapable",
"character",
".",
"i",
".",
"e",
".",
"either",
"an",
"ampersand",
"or",
"backslash",
"."
] | 6aad6e640b348cda8f3b0841f6e42025233f1eb8 | https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/core/support/LabelInfo.java#L190-L210 |
12,049 | lievendoclo/Valkyrie-RCP | valkyrie-rcp-core/src/main/java/org/valkyriercp/core/support/LabelInfo.java | LabelInfo.configureLabel | public void configureLabel(JLabel label) {
Assert.notNull(label, "label");
label.setText(this.text);
label.setDisplayedMnemonic(getMnemonic());
if (getMnemonicIndex() >= -1) {
label.setDisplayedMnemonicIndex(getMnemonicIndex());
}
} | java | public void configureLabel(JLabel label) {
Assert.notNull(label, "label");
label.setText(this.text);
label.setDisplayedMnemonic(getMnemonic());
if (getMnemonicIndex() >= -1) {
label.setDisplayedMnemonicIndex(getMnemonicIndex());
}
} | [
"public",
"void",
"configureLabel",
"(",
"JLabel",
"label",
")",
"{",
"Assert",
".",
"notNull",
"(",
"label",
",",
"\"label\"",
")",
";",
"label",
".",
"setText",
"(",
"this",
".",
"text",
")",
";",
"label",
".",
"setDisplayedMnemonic",
"(",
"getMnemonic",... | Configures the given label with the parameters from this instance.
@param label The label that is to be configured.
@throws IllegalArgumentException if {@code label} is null. | [
"Configures",
"the",
"given",
"label",
"with",
"the",
"parameters",
"from",
"this",
"instance",
"."
] | 6aad6e640b348cda8f3b0841f6e42025233f1eb8 | https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/core/support/LabelInfo.java#L342-L353 |
12,050 | lievendoclo/Valkyrie-RCP | valkyrie-rcp-core/src/main/java/org/valkyriercp/core/support/LabelInfo.java | LabelInfo.configureLabelFor | public void configureLabelFor(JLabel label, JComponent component) {
Assert.notNull(label, "label");
Assert.notNull(component, "component");
configureLabel(label);
if (!(component instanceof JPanel)) {
String labelText = label.getText();
if (!labelText.endsWith... | java | public void configureLabelFor(JLabel label, JComponent component) {
Assert.notNull(label, "label");
Assert.notNull(component, "component");
configureLabel(label);
if (!(component instanceof JPanel)) {
String labelText = label.getText();
if (!labelText.endsWith... | [
"public",
"void",
"configureLabelFor",
"(",
"JLabel",
"label",
",",
"JComponent",
"component",
")",
"{",
"Assert",
".",
"notNull",
"(",
"label",
",",
"\"label\"",
")",
";",
"Assert",
".",
"notNull",
"(",
"component",
",",
"\"component\"",
")",
";",
"configur... | Configures the given label with the property values described by this instance and then sets
it as the label for the given component.
@param label The label to be configured.
@param component The component that the label is 'for'.
@throws IllegalArgumentException if either argument is null.
@see JLabel#setLabelFor(j... | [
"Configures",
"the",
"given",
"label",
"with",
"the",
"property",
"values",
"described",
"by",
"this",
"instance",
"and",
"then",
"sets",
"it",
"as",
"the",
"label",
"for",
"the",
"given",
"component",
"."
] | 6aad6e640b348cda8f3b0841f6e42025233f1eb8 | https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/core/support/LabelInfo.java#L366-L389 |
12,051 | lievendoclo/Valkyrie-RCP | valkyrie-rcp-core/src/main/java/org/valkyriercp/core/support/LabelInfo.java | LabelInfo.configureButton | public void configureButton(AbstractButton button) {
Assert.notNull(button);
button.setText(this.text);
button.setMnemonic(getMnemonic());
button.setDisplayedMnemonicIndex(getMnemonicIndex());
} | java | public void configureButton(AbstractButton button) {
Assert.notNull(button);
button.setText(this.text);
button.setMnemonic(getMnemonic());
button.setDisplayedMnemonicIndex(getMnemonicIndex());
} | [
"public",
"void",
"configureButton",
"(",
"AbstractButton",
"button",
")",
"{",
"Assert",
".",
"notNull",
"(",
"button",
")",
";",
"button",
".",
"setText",
"(",
"this",
".",
"text",
")",
";",
"button",
".",
"setMnemonic",
"(",
"getMnemonic",
"(",
")",
"... | Configures the given button with the properties held in this instance. Note that this
instance doesn't hold any keystroke accelerator information.
@param button The button to be configured.
@throws IllegalArgumentException if {@code button} is null. | [
"Configures",
"the",
"given",
"button",
"with",
"the",
"properties",
"held",
"in",
"this",
"instance",
".",
"Note",
"that",
"this",
"instance",
"doesn",
"t",
"hold",
"any",
"keystroke",
"accelerator",
"information",
"."
] | 6aad6e640b348cda8f3b0841f6e42025233f1eb8 | https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/core/support/LabelInfo.java#L399-L404 |
12,052 | lievendoclo/Valkyrie-RCP | valkyrie-rcp-core/src/main/java/org/valkyriercp/binding/validation/support/DefaultValidationResultsModel.java | DefaultValidationResultsModel.updateErrors | private void updateErrors() {
boolean oldErrors = hasErrors;
hasErrors = false;
if (validationResults.getHasErrors()) {
hasErrors = true;
}
else {
Iterator childIter = children.iterator();
while (childIter.hasNext()) {
ValidationResultsModel childModel = (ValidationResultsModel) childIter.next();... | java | private void updateErrors() {
boolean oldErrors = hasErrors;
hasErrors = false;
if (validationResults.getHasErrors()) {
hasErrors = true;
}
else {
Iterator childIter = children.iterator();
while (childIter.hasNext()) {
ValidationResultsModel childModel = (ValidationResultsModel) childIter.next();... | [
"private",
"void",
"updateErrors",
"(",
")",
"{",
"boolean",
"oldErrors",
"=",
"hasErrors",
";",
"hasErrors",
"=",
"false",
";",
"if",
"(",
"validationResults",
".",
"getHasErrors",
"(",
")",
")",
"{",
"hasErrors",
"=",
"true",
";",
"}",
"else",
"{",
"It... | Revaluate the hasErrors property and fire an event if things have
changed. | [
"Revaluate",
"the",
"hasErrors",
"property",
"and",
"fire",
"an",
"event",
"if",
"things",
"have",
"changed",
"."
] | 6aad6e640b348cda8f3b0841f6e42025233f1eb8 | https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/binding/validation/support/DefaultValidationResultsModel.java#L215-L232 |
12,053 | lievendoclo/Valkyrie-RCP | valkyrie-rcp-core/src/main/java/org/valkyriercp/binding/validation/support/DefaultValidationResultsModel.java | DefaultValidationResultsModel.updateInfo | private void updateInfo() {
boolean oldInfo = hasInfo;
hasInfo = false;
if (validationResults.getHasInfo()) {
hasInfo = true;
}
else {
Iterator childIter = children.iterator();
while (childIter.hasNext()) {
ValidationResultsModel childModel = (ValidationResultsModel) childIter.next();
if (chi... | java | private void updateInfo() {
boolean oldInfo = hasInfo;
hasInfo = false;
if (validationResults.getHasInfo()) {
hasInfo = true;
}
else {
Iterator childIter = children.iterator();
while (childIter.hasNext()) {
ValidationResultsModel childModel = (ValidationResultsModel) childIter.next();
if (chi... | [
"private",
"void",
"updateInfo",
"(",
")",
"{",
"boolean",
"oldInfo",
"=",
"hasInfo",
";",
"hasInfo",
"=",
"false",
";",
"if",
"(",
"validationResults",
".",
"getHasInfo",
"(",
")",
")",
"{",
"hasInfo",
"=",
"true",
";",
"}",
"else",
"{",
"Iterator",
"... | Revaluate the hasInfo property and fire an event if things have changed. | [
"Revaluate",
"the",
"hasInfo",
"property",
"and",
"fire",
"an",
"event",
"if",
"things",
"have",
"changed",
"."
] | 6aad6e640b348cda8f3b0841f6e42025233f1eb8 | https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/binding/validation/support/DefaultValidationResultsModel.java#L245-L262 |
12,054 | lievendoclo/Valkyrie-RCP | valkyrie-rcp-core/src/main/java/org/valkyriercp/binding/validation/support/DefaultValidationResultsModel.java | DefaultValidationResultsModel.updateWarnings | private void updateWarnings() {
boolean oldWarnings = hasWarnings;
hasWarnings = false;
if (validationResults.getHasWarnings()) {
hasWarnings = true;
}
else {
Iterator childIter = children.iterator();
while (childIter.hasNext()) {
ValidationResultsModel childModel = (ValidationResultsModel) child... | java | private void updateWarnings() {
boolean oldWarnings = hasWarnings;
hasWarnings = false;
if (validationResults.getHasWarnings()) {
hasWarnings = true;
}
else {
Iterator childIter = children.iterator();
while (childIter.hasNext()) {
ValidationResultsModel childModel = (ValidationResultsModel) child... | [
"private",
"void",
"updateWarnings",
"(",
")",
"{",
"boolean",
"oldWarnings",
"=",
"hasWarnings",
";",
"hasWarnings",
"=",
"false",
";",
"if",
"(",
"validationResults",
".",
"getHasWarnings",
"(",
")",
")",
"{",
"hasWarnings",
"=",
"true",
";",
"}",
"else",
... | Revaluate the hasWarnings property and fire an event if things have
changed. | [
"Revaluate",
"the",
"hasWarnings",
"property",
"and",
"fire",
"an",
"event",
"if",
"things",
"have",
"changed",
"."
] | 6aad6e640b348cda8f3b0841f6e42025233f1eb8 | https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/binding/validation/support/DefaultValidationResultsModel.java#L276-L293 |
12,055 | lievendoclo/Valkyrie-RCP | valkyrie-rcp-core/src/main/java/org/valkyriercp/binding/validation/support/DefaultValidationResultsModel.java | DefaultValidationResultsModel.add | public void add(ValidationResultsModel validationResultsModel) {
if (children.add(validationResultsModel)) {
validationResultsModel.addValidationListener(this);
validationResultsModel.addPropertyChangeListener(HAS_ERRORS_PROPERTY, this);
validationResultsModel.addPropertyChangeListener(HAS_WARNINGS_PROPERTY,... | java | public void add(ValidationResultsModel validationResultsModel) {
if (children.add(validationResultsModel)) {
validationResultsModel.addValidationListener(this);
validationResultsModel.addPropertyChangeListener(HAS_ERRORS_PROPERTY, this);
validationResultsModel.addPropertyChangeListener(HAS_WARNINGS_PROPERTY,... | [
"public",
"void",
"add",
"(",
"ValidationResultsModel",
"validationResultsModel",
")",
"{",
"if",
"(",
"children",
".",
"add",
"(",
"validationResultsModel",
")",
")",
"{",
"validationResultsModel",
".",
"addValidationListener",
"(",
"this",
")",
";",
"validationRes... | Add a validationResultsModel as a child to this one. Attach listeners and
if it already has messages, fire events.
@param validationResultsModel | [
"Add",
"a",
"validationResultsModel",
"as",
"a",
"child",
"to",
"this",
"one",
".",
"Attach",
"listeners",
"and",
"if",
"it",
"already",
"has",
"messages",
"fire",
"events",
"."
] | 6aad6e640b348cda8f3b0841f6e42025233f1eb8 | https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/binding/validation/support/DefaultValidationResultsModel.java#L436-L445 |
12,056 | lievendoclo/Valkyrie-RCP | valkyrie-rcp-core/src/main/java/org/valkyriercp/binding/validation/support/DefaultValidationResultsModel.java | DefaultValidationResultsModel.remove | public void remove(ValidationResultsModel validationResultsModel) {
if (children.remove(validationResultsModel)) {
validationResultsModel.removeValidationListener(this);
validationResultsModel.removePropertyChangeListener(HAS_ERRORS_PROPERTY, this);
validationResultsModel.removePropertyChangeListener(HAS_WAR... | java | public void remove(ValidationResultsModel validationResultsModel) {
if (children.remove(validationResultsModel)) {
validationResultsModel.removeValidationListener(this);
validationResultsModel.removePropertyChangeListener(HAS_ERRORS_PROPERTY, this);
validationResultsModel.removePropertyChangeListener(HAS_WAR... | [
"public",
"void",
"remove",
"(",
"ValidationResultsModel",
"validationResultsModel",
")",
"{",
"if",
"(",
"children",
".",
"remove",
"(",
"validationResultsModel",
")",
")",
"{",
"validationResultsModel",
".",
"removeValidationListener",
"(",
"this",
")",
";",
"vali... | Remove the given validationResultsModel from the list of children. Remove
listeners and if it had messages, fire events.
@param validationResultsModel | [
"Remove",
"the",
"given",
"validationResultsModel",
"from",
"the",
"list",
"of",
"children",
".",
"Remove",
"listeners",
"and",
"if",
"it",
"had",
"messages",
"fire",
"events",
"."
] | 6aad6e640b348cda8f3b0841f6e42025233f1eb8 | https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/binding/validation/support/DefaultValidationResultsModel.java#L453-L462 |
12,057 | lievendoclo/Valkyrie-RCP | valkyrie-rcp-core/src/main/java/org/valkyriercp/binding/validation/support/DefaultValidationResultsModel.java | DefaultValidationResultsModel.propertyChange | public void propertyChange(PropertyChangeEvent evt) {
if (evt.getPropertyName() == HAS_ERRORS_PROPERTY)
updateErrors();
else if (evt.getPropertyName() == HAS_WARNINGS_PROPERTY)
updateWarnings();
else if (evt.getPropertyName() == HAS_INFO_PROPERTY)
updateInfo();
} | java | public void propertyChange(PropertyChangeEvent evt) {
if (evt.getPropertyName() == HAS_ERRORS_PROPERTY)
updateErrors();
else if (evt.getPropertyName() == HAS_WARNINGS_PROPERTY)
updateWarnings();
else if (evt.getPropertyName() == HAS_INFO_PROPERTY)
updateInfo();
} | [
"public",
"void",
"propertyChange",
"(",
"PropertyChangeEvent",
"evt",
")",
"{",
"if",
"(",
"evt",
".",
"getPropertyName",
"(",
")",
"==",
"HAS_ERRORS_PROPERTY",
")",
"updateErrors",
"(",
")",
";",
"else",
"if",
"(",
"evt",
".",
"getPropertyName",
"(",
")",
... | Forwarding of known property events coming from child models. Each event
triggers a specific evaluation of the parent property, which will trigger
events as needed. | [
"Forwarding",
"of",
"known",
"property",
"events",
"coming",
"from",
"child",
"models",
".",
"Each",
"event",
"triggers",
"a",
"specific",
"evaluation",
"of",
"the",
"parent",
"property",
"which",
"will",
"trigger",
"events",
"as",
"needed",
"."
] | 6aad6e640b348cda8f3b0841f6e42025233f1eb8 | https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/binding/validation/support/DefaultValidationResultsModel.java#L477-L484 |
12,058 | lievendoclo/Valkyrie-RCP | valkyrie-rcp-core/src/main/java/org/valkyriercp/security/support/AuthorityConfigurableSecurityController.java | AuthorityConfigurableSecurityController.addAndPrepareControlledObject | private void addAndPrepareControlledObject(Authorizable controlledObject)
{
controlledObjects.add(new WeakReference<Authorizable>(controlledObject));
// Properly configure the new object
boolean authorize = shouldAuthorize(getLastAuthentication(), controlledObject);
updateControlled... | java | private void addAndPrepareControlledObject(Authorizable controlledObject)
{
controlledObjects.add(new WeakReference<Authorizable>(controlledObject));
// Properly configure the new object
boolean authorize = shouldAuthorize(getLastAuthentication(), controlledObject);
updateControlled... | [
"private",
"void",
"addAndPrepareControlledObject",
"(",
"Authorizable",
"controlledObject",
")",
"{",
"controlledObjects",
".",
"add",
"(",
"new",
"WeakReference",
"<",
"Authorizable",
">",
"(",
"controlledObject",
")",
")",
";",
"// Properly configure the new object",
... | Add a new object to the list of controlled objects. Install our last
known authorization decision so newly created objects will reflect the
current security state.
@param controlledObject
to add | [
"Add",
"a",
"new",
"object",
"to",
"the",
"list",
"of",
"controlled",
"objects",
".",
"Install",
"our",
"last",
"known",
"authorization",
"decision",
"so",
"newly",
"created",
"objects",
"will",
"reflect",
"the",
"current",
"security",
"state",
"."
] | 6aad6e640b348cda8f3b0841f6e42025233f1eb8 | https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/security/support/AuthorityConfigurableSecurityController.java#L122-L129 |
12,059 | lievendoclo/Valkyrie-RCP | valkyrie-rcp-core/src/main/java/org/valkyriercp/security/support/AuthorityConfigurableSecurityController.java | AuthorityConfigurableSecurityController.runAuthorization | protected void runAuthorization()
{
// Install the decision
for (Iterator iter = controlledObjects.iterator(); iter.hasNext();)
{
WeakReference ref = (WeakReference) iter.next();
Authorizable controlledObject = (Authorizable) ref.get();
if (controlledObje... | java | protected void runAuthorization()
{
// Install the decision
for (Iterator iter = controlledObjects.iterator(); iter.hasNext();)
{
WeakReference ref = (WeakReference) iter.next();
Authorizable controlledObject = (Authorizable) ref.get();
if (controlledObje... | [
"protected",
"void",
"runAuthorization",
"(",
")",
"{",
"// Install the decision",
"for",
"(",
"Iterator",
"iter",
"=",
"controlledObjects",
".",
"iterator",
"(",
")",
";",
"iter",
".",
"hasNext",
"(",
")",
";",
")",
"{",
"WeakReference",
"ref",
"=",
"(",
... | securityAwareConfigurer
Update the authorization of all controlled objects. | [
"securityAwareConfigurer",
"Update",
"the",
"authorization",
"of",
"all",
"controlled",
"objects",
"."
] | 6aad6e640b348cda8f3b0841f6e42025233f1eb8 | https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/security/support/AuthorityConfigurableSecurityController.java#L319-L338 |
12,060 | lievendoclo/Valkyrie-RCP | valkyrie-rcp-core/src/main/java/org/valkyriercp/component/RoundedBorder.java | RoundedBorder.getInteriorRectangle | public static Rectangle getInteriorRectangle(Component c, Border b, int x, int y, int width, int height) {
final Insets insets;
if (b != null) {
insets = b.getBorderInsets(c);
} else {
insets = new Insets(0, 0, 0, 0);
}
return new Rectangle(x + insets.le... | java | public static Rectangle getInteriorRectangle(Component c, Border b, int x, int y, int width, int height) {
final Insets insets;
if (b != null) {
insets = b.getBorderInsets(c);
} else {
insets = new Insets(0, 0, 0, 0);
}
return new Rectangle(x + insets.le... | [
"public",
"static",
"Rectangle",
"getInteriorRectangle",
"(",
"Component",
"c",
",",
"Border",
"b",
",",
"int",
"x",
",",
"int",
"y",
",",
"int",
"width",
",",
"int",
"height",
")",
"{",
"final",
"Insets",
"insets",
";",
"if",
"(",
"b",
"!=",
"null",
... | Gets the interior rectangle.
@param c
the target component.
@param b
the border.
@param x
the x coordinate.
@param y
the y coordinate.
@param width
the width.
@param height
the height.
@return the rectangle. | [
"Gets",
"the",
"interior",
"rectangle",
"."
] | 6aad6e640b348cda8f3b0841f6e42025233f1eb8 | https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/component/RoundedBorder.java#L167-L180 |
12,061 | lievendoclo/Valkyrie-RCP | valkyrie-rcp-core/src/main/java/org/valkyriercp/security/remoting/BasicAuthHttpInvokerProxyFactoryBean.java | BasicAuthHttpInvokerProxyFactoryBean.setAuthenticationToken | public void setAuthenticationToken(Authentication authentication) {
if( logger.isDebugEnabled() ) {
logger.debug( "New authentication token: " + authentication );
}
final HttpInvokerRequestExecutor hire = getHttpInvokerRequestExecutor();
if( hire instanceof BasicAuthHttpInvo... | java | public void setAuthenticationToken(Authentication authentication) {
if( logger.isDebugEnabled() ) {
logger.debug( "New authentication token: " + authentication );
}
final HttpInvokerRequestExecutor hire = getHttpInvokerRequestExecutor();
if( hire instanceof BasicAuthHttpInvo... | [
"public",
"void",
"setAuthenticationToken",
"(",
"Authentication",
"authentication",
")",
"{",
"if",
"(",
"logger",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"logger",
".",
"debug",
"(",
"\"New authentication token: \"",
"+",
"authentication",
")",
";",
"}",
"f... | Handle a change in the current authentication token. Pass it along to the executor
if it's of the proper type.
@see BasicAuthHttpInvokerRequestExecutor
@see AuthenticationAware#setAuthenticationToken(org.springframework.security.Authentication) | [
"Handle",
"a",
"change",
"in",
"the",
"current",
"authentication",
"token",
".",
"Pass",
"it",
"along",
"to",
"the",
"executor",
"if",
"it",
"s",
"of",
"the",
"proper",
"type",
"."
] | 6aad6e640b348cda8f3b0841f6e42025233f1eb8 | https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/security/remoting/BasicAuthHttpInvokerProxyFactoryBean.java#L64-L76 |
12,062 | youngmonkeys/ezyfox-sfs2x | src/main/java/com/tvd12/ezyfox/sfs2x/command/impl/CreateRoomImpl.java | CreateRoomImpl.execute | @SuppressWarnings("unchecked")
@Override
public Boolean execute() {
for(int i = 0 ; i < agents.length ; i++) {
createRoom(i);
}
return Boolean.TRUE;
} | java | @SuppressWarnings("unchecked")
@Override
public Boolean execute() {
for(int i = 0 ; i < agents.length ; i++) {
createRoom(i);
}
return Boolean.TRUE;
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"@",
"Override",
"public",
"Boolean",
"execute",
"(",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"agents",
".",
"length",
";",
"i",
"++",
")",
"{",
"createRoom",
"(",
"i",
")",
";"... | Execute to create list of room | [
"Execute",
"to",
"create",
"list",
"of",
"room"
] | 7e004033a3b551c3ae970a0c8f45db7b1ec144de | https://github.com/youngmonkeys/ezyfox-sfs2x/blob/7e004033a3b551c3ae970a0c8f45db7b1ec144de/src/main/java/com/tvd12/ezyfox/sfs2x/command/impl/CreateRoomImpl.java#L68-L75 |
12,063 | youngmonkeys/ezyfox-sfs2x | src/main/java/com/tvd12/ezyfox/sfs2x/command/impl/CreateRoomImpl.java | CreateRoomImpl.createRoom | private void createRoom(int index) {
ApiRoom agent = agents[index];
try {
CreateRoomSettings settings = createRoomSettings(agent);
User owner = CommandUtil.getSfsUser(agent.getOwner(), api);
Room room = api.createRoom(extension.getParentZone(), settings, owner);
... | java | private void createRoom(int index) {
ApiRoom agent = agents[index];
try {
CreateRoomSettings settings = createRoomSettings(agent);
User owner = CommandUtil.getSfsUser(agent.getOwner(), api);
Room room = api.createRoom(extension.getParentZone(), settings, owner);
... | [
"private",
"void",
"createRoom",
"(",
"int",
"index",
")",
"{",
"ApiRoom",
"agent",
"=",
"agents",
"[",
"index",
"]",
";",
"try",
"{",
"CreateRoomSettings",
"settings",
"=",
"createRoomSettings",
"(",
"agent",
")",
";",
"User",
"owner",
"=",
"CommandUtil",
... | Create a room at index
@param index index | [
"Create",
"a",
"room",
"at",
"index"
] | 7e004033a3b551c3ae970a0c8f45db7b1ec144de | https://github.com/youngmonkeys/ezyfox-sfs2x/blob/7e004033a3b551c3ae970a0c8f45db7b1ec144de/src/main/java/com/tvd12/ezyfox/sfs2x/command/impl/CreateRoomImpl.java#L82-L96 |
12,064 | youngmonkeys/ezyfox-sfs2x | src/main/java/com/tvd12/ezyfox/sfs2x/command/impl/CreateRoomImpl.java | CreateRoomImpl.createRoomSettings | private CreateRoomSettings createRoomSettings(ApiRoom agent) {
validateRoomAgentClass(agent);
CreateRoomSettings settings = new CreateRoomSettings();
settings.setName(agent.getName());
settings.setPassword(agent.getPassword());
settings.setDynamic(agent.isDynamic());
setting... | java | private CreateRoomSettings createRoomSettings(ApiRoom agent) {
validateRoomAgentClass(agent);
CreateRoomSettings settings = new CreateRoomSettings();
settings.setName(agent.getName());
settings.setPassword(agent.getPassword());
settings.setDynamic(agent.isDynamic());
setting... | [
"private",
"CreateRoomSettings",
"createRoomSettings",
"(",
"ApiRoom",
"agent",
")",
"{",
"validateRoomAgentClass",
"(",
"agent",
")",
";",
"CreateRoomSettings",
"settings",
"=",
"new",
"CreateRoomSettings",
"(",
")",
";",
"settings",
".",
"setName",
"(",
"agent",
... | Create smartfox CreateRoomSettings object
@param agent room agent object
@return CreateRoomSettings object | [
"Create",
"smartfox",
"CreateRoomSettings",
"object"
] | 7e004033a3b551c3ae970a0c8f45db7b1ec144de | https://github.com/youngmonkeys/ezyfox-sfs2x/blob/7e004033a3b551c3ae970a0c8f45db7b1ec144de/src/main/java/com/tvd12/ezyfox/sfs2x/command/impl/CreateRoomImpl.java#L104-L122 |
12,065 | youngmonkeys/ezyfox-sfs2x | src/main/java/com/tvd12/ezyfox/sfs2x/command/impl/UpdateUserImpl.java | UpdateUserImpl.execute | @SuppressWarnings("unchecked")
@Override
public <T> T execute() {
User sfsUser = CommandUtil.getSfsUser(agent, api);
if(sfsUser == null) return null;
try {
AgentClassUnwrapper unwrapper = context.getUserAgentClass(agent.getClass())
.getUnwrapper();
List<UserVariable> variables = new Us... | java | @SuppressWarnings("unchecked")
@Override
public <T> T execute() {
User sfsUser = CommandUtil.getSfsUser(agent, api);
if(sfsUser == null) return null;
try {
AgentClassUnwrapper unwrapper = context.getUserAgentClass(agent.getClass())
.getUnwrapper();
List<UserVariable> variables = new Us... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"@",
"Override",
"public",
"<",
"T",
">",
"T",
"execute",
"(",
")",
"{",
"User",
"sfsUser",
"=",
"CommandUtil",
".",
"getSfsUser",
"(",
"agent",
",",
"api",
")",
";",
"if",
"(",
"sfsUser",
"==",
"null... | Execute to update user variables | [
"Execute",
"to",
"update",
"user",
"variables"
] | 7e004033a3b551c3ae970a0c8f45db7b1ec144de | https://github.com/youngmonkeys/ezyfox-sfs2x/blob/7e004033a3b551c3ae970a0c8f45db7b1ec144de/src/main/java/com/tvd12/ezyfox/sfs2x/command/impl/UpdateUserImpl.java#L44-L68 |
12,066 | mgormley/pacaya | src/main/java/edu/jhu/pacaya/nlp/data/SentenceCollection.java | SentenceCollection.getVocab | public Set<String> getVocab() {
Set<String> vocab = new HashSet<String>();
for (Sentence sent : this) {
for (String label : sent) {
vocab.add(label);
}
}
return vocab;
} | java | public Set<String> getVocab() {
Set<String> vocab = new HashSet<String>();
for (Sentence sent : this) {
for (String label : sent) {
vocab.add(label);
}
}
return vocab;
} | [
"public",
"Set",
"<",
"String",
">",
"getVocab",
"(",
")",
"{",
"Set",
"<",
"String",
">",
"vocab",
"=",
"new",
"HashSet",
"<",
"String",
">",
"(",
")",
";",
"for",
"(",
"Sentence",
"sent",
":",
"this",
")",
"{",
"for",
"(",
"String",
"label",
":... | Vocabulary of the sentences. | [
"Vocabulary",
"of",
"the",
"sentences",
"."
] | 786294cbac7cc65dbc32210c10acc32ed0c69233 | https://github.com/mgormley/pacaya/blob/786294cbac7cc65dbc32210c10acc32ed0c69233/src/main/java/edu/jhu/pacaya/nlp/data/SentenceCollection.java#L77-L85 |
12,067 | JodaOrg/joda-collect | src/main/java/org/joda/collect/grid/ImmutableGrid.java | ImmutableGrid.of | public static <R> ImmutableGrid<R> of(int rowCount, int columnCount) {
return new EmptyGrid<R>(rowCount, columnCount);
} | java | public static <R> ImmutableGrid<R> of(int rowCount, int columnCount) {
return new EmptyGrid<R>(rowCount, columnCount);
} | [
"public",
"static",
"<",
"R",
">",
"ImmutableGrid",
"<",
"R",
">",
"of",
"(",
"int",
"rowCount",
",",
"int",
"columnCount",
")",
"{",
"return",
"new",
"EmptyGrid",
"<",
"R",
">",
"(",
"rowCount",
",",
"columnCount",
")",
";",
"}"
] | Obtains an empty immutable grid of the specified row-column count.
@param <R> the type of the value
@param rowCount the number of rows, zero or greater
@param columnCount the number of columns, zero or greater
@return the empty immutable grid, not null | [
"Obtains",
"an",
"empty",
"immutable",
"grid",
"of",
"the",
"specified",
"row",
"-",
"column",
"count",
"."
] | a4b05d5eebad5beb41715c0678cf11835cf0fa3f | https://github.com/JodaOrg/joda-collect/blob/a4b05d5eebad5beb41715c0678cf11835cf0fa3f/src/main/java/org/joda/collect/grid/ImmutableGrid.java#L44-L46 |
12,068 | JodaOrg/joda-collect | src/main/java/org/joda/collect/grid/ImmutableGrid.java | ImmutableGrid.of | public static <R> ImmutableGrid<R> of(int rowCount, int columnCount, int row, int column, R value) {
return new SingletonGrid<R>(rowCount, columnCount, row, column, value);
} | java | public static <R> ImmutableGrid<R> of(int rowCount, int columnCount, int row, int column, R value) {
return new SingletonGrid<R>(rowCount, columnCount, row, column, value);
} | [
"public",
"static",
"<",
"R",
">",
"ImmutableGrid",
"<",
"R",
">",
"of",
"(",
"int",
"rowCount",
",",
"int",
"columnCount",
",",
"int",
"row",
",",
"int",
"column",
",",
"R",
"value",
")",
"{",
"return",
"new",
"SingletonGrid",
"<",
"R",
">",
"(",
... | Obtains an immutable grid of the specified row-column count with a single cell.
@param <R> the type of the value
@param rowCount the number of rows, zero or greater
@param columnCount the number of columns, zero or greater
@param row the row of the single cell, zero or greater
@param column the column of the singl... | [
"Obtains",
"an",
"immutable",
"grid",
"of",
"the",
"specified",
"row",
"-",
"column",
"count",
"with",
"a",
"single",
"cell",
"."
] | a4b05d5eebad5beb41715c0678cf11835cf0fa3f | https://github.com/JodaOrg/joda-collect/blob/a4b05d5eebad5beb41715c0678cf11835cf0fa3f/src/main/java/org/joda/collect/grid/ImmutableGrid.java#L72-L74 |
12,069 | JodaOrg/joda-collect | src/main/java/org/joda/collect/grid/ImmutableGrid.java | ImmutableGrid.copyOf | public static <R> ImmutableGrid<R> copyOf(int rowCount, int columnCount, Cell<R> cell) {
if (cell == null) {
throw new IllegalArgumentException("Cell must not be null");
}
return new SingletonGrid<R>(rowCount, columnCount, cell);
} | java | public static <R> ImmutableGrid<R> copyOf(int rowCount, int columnCount, Cell<R> cell) {
if (cell == null) {
throw new IllegalArgumentException("Cell must not be null");
}
return new SingletonGrid<R>(rowCount, columnCount, cell);
} | [
"public",
"static",
"<",
"R",
">",
"ImmutableGrid",
"<",
"R",
">",
"copyOf",
"(",
"int",
"rowCount",
",",
"int",
"columnCount",
",",
"Cell",
"<",
"R",
">",
"cell",
")",
"{",
"if",
"(",
"cell",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentE... | Obtains an immutable grid with one cell.
@param <R> the type of the value
@param rowCount the number of rows, zero or greater
@param columnCount the number of columns, zero or greater
@param cell the cell that the grid should contain, not null
@return the immutable grid, not null
@throws IndexOutOfBoundsException i... | [
"Obtains",
"an",
"immutable",
"grid",
"with",
"one",
"cell",
"."
] | a4b05d5eebad5beb41715c0678cf11835cf0fa3f | https://github.com/JodaOrg/joda-collect/blob/a4b05d5eebad5beb41715c0678cf11835cf0fa3f/src/main/java/org/joda/collect/grid/ImmutableGrid.java#L87-L92 |
12,070 | JodaOrg/joda-collect | src/main/java/org/joda/collect/grid/ImmutableGrid.java | ImmutableGrid.copyOf | public static <R> ImmutableGrid<R> copyOf(int rowCount, int columnCount, Iterable<? extends Cell<R>> cells) {
if (cells == null) {
throw new IllegalArgumentException("Cells must not be null");
}
if (!cells.iterator().hasNext()) {
return new EmptyGrid<R>(rowCount, columnCo... | java | public static <R> ImmutableGrid<R> copyOf(int rowCount, int columnCount, Iterable<? extends Cell<R>> cells) {
if (cells == null) {
throw new IllegalArgumentException("Cells must not be null");
}
if (!cells.iterator().hasNext()) {
return new EmptyGrid<R>(rowCount, columnCo... | [
"public",
"static",
"<",
"R",
">",
"ImmutableGrid",
"<",
"R",
">",
"copyOf",
"(",
"int",
"rowCount",
",",
"int",
"columnCount",
",",
"Iterable",
"<",
"?",
"extends",
"Cell",
"<",
"R",
">",
">",
"cells",
")",
"{",
"if",
"(",
"cells",
"==",
"null",
"... | Obtains an immutable grid by copying a set of cells.
@param <R> the type of the value
@param rowCount the number of rows, zero or greater
@param columnCount the number of columns, zero or greater
@param cells the cells to copy, not null
@return the immutable grid, not null
@throws IndexOutOfBoundsException if eithe... | [
"Obtains",
"an",
"immutable",
"grid",
"by",
"copying",
"a",
"set",
"of",
"cells",
"."
] | a4b05d5eebad5beb41715c0678cf11835cf0fa3f | https://github.com/JodaOrg/joda-collect/blob/a4b05d5eebad5beb41715c0678cf11835cf0fa3f/src/main/java/org/joda/collect/grid/ImmutableGrid.java#L104-L112 |
12,071 | mgormley/pacaya | src/main/java/edu/jhu/pacaya/gm/decode/MbrDecoder.java | MbrDecoder.decode | public FgInferencer decode(FgModel model, UFgExample ex) {
// Run inference.
FactorGraph fgLatPred = ex.getFactorGraph();
fgLatPred.updateFromModel(model);
FgInferencer infLatPred = prm.infFactory.getInferencer(fgLatPred);
infLatPred.run();
decode(infLatPred, ex);... | java | public FgInferencer decode(FgModel model, UFgExample ex) {
// Run inference.
FactorGraph fgLatPred = ex.getFactorGraph();
fgLatPred.updateFromModel(model);
FgInferencer infLatPred = prm.infFactory.getInferencer(fgLatPred);
infLatPred.run();
decode(infLatPred, ex);... | [
"public",
"FgInferencer",
"decode",
"(",
"FgModel",
"model",
",",
"UFgExample",
"ex",
")",
"{",
"// Run inference.",
"FactorGraph",
"fgLatPred",
"=",
"ex",
".",
"getFactorGraph",
"(",
")",
";",
"fgLatPred",
".",
"updateFromModel",
"(",
"model",
")",
";",
"FgIn... | Runs inference and computes the MBR variable configuration. The outputs
are stored on the class, and can be queried after this call to decode.
@param model The input model.
@param ex The input data.
@return the FgInferencer that was used. | [
"Runs",
"inference",
"and",
"computes",
"the",
"MBR",
"variable",
"configuration",
".",
"The",
"outputs",
"are",
"stored",
"on",
"the",
"class",
"and",
"can",
"be",
"queried",
"after",
"this",
"call",
"to",
"decode",
"."
] | 786294cbac7cc65dbc32210c10acc32ed0c69233 | https://github.com/mgormley/pacaya/blob/786294cbac7cc65dbc32210c10acc32ed0c69233/src/main/java/edu/jhu/pacaya/gm/decode/MbrDecoder.java#L70-L78 |
12,072 | mgormley/pacaya | src/main/java/edu/jhu/pacaya/gm/decode/MbrDecoder.java | MbrDecoder.decode | public void decode(FgInferencer infLatPred, UFgExample ex) {
FactorGraph fgLatPred = ex.getFactorGraph();
mbrVarConfig = new VarConfig();
margs = new ArrayList<VarTensor>();
varMargMap = new HashMap<Var,Double>();
// Get the MBR configuration of all the latent and predi... | java | public void decode(FgInferencer infLatPred, UFgExample ex) {
FactorGraph fgLatPred = ex.getFactorGraph();
mbrVarConfig = new VarConfig();
margs = new ArrayList<VarTensor>();
varMargMap = new HashMap<Var,Double>();
// Get the MBR configuration of all the latent and predi... | [
"public",
"void",
"decode",
"(",
"FgInferencer",
"infLatPred",
",",
"UFgExample",
"ex",
")",
"{",
"FactorGraph",
"fgLatPred",
"=",
"ex",
".",
"getFactorGraph",
"(",
")",
";",
"mbrVarConfig",
"=",
"new",
"VarConfig",
"(",
")",
";",
"margs",
"=",
"new",
"Arr... | Computes the MBR variable configuration from the marginals cached in the
inferencer, which is assumed to have already been run. The outputs are
stored on the class, and can be queried after this call to decode. | [
"Computes",
"the",
"MBR",
"variable",
"configuration",
"from",
"the",
"marginals",
"cached",
"in",
"the",
"inferencer",
"which",
"is",
"assumed",
"to",
"have",
"already",
"been",
"run",
".",
"The",
"outputs",
"are",
"stored",
"on",
"the",
"class",
"and",
"ca... | 786294cbac7cc65dbc32210c10acc32ed0c69233 | https://github.com/mgormley/pacaya/blob/786294cbac7cc65dbc32210c10acc32ed0c69233/src/main/java/edu/jhu/pacaya/gm/decode/MbrDecoder.java#L85-L110 |
12,073 | jeffreyning/nh-micro | nh-micro-nhs/src/main/java/com/nh/micro/nhs/util/Parser.java | Parser.getAttributeList | protected AttributeList getAttributeList() throws IOException {
int i;
int quote;
String name = null;
String value = null;
StringBuilder buffer = new StringBuilder();
Map<String, String> attributes = new LinkedHashMap<String, String>();
Stream stream = this.stream... | java | protected AttributeList getAttributeList() throws IOException {
int i;
int quote;
String name = null;
String value = null;
StringBuilder buffer = new StringBuilder();
Map<String, String> attributes = new LinkedHashMap<String, String>();
Stream stream = this.stream... | [
"protected",
"AttributeList",
"getAttributeList",
"(",
")",
"throws",
"IOException",
"{",
"int",
"i",
";",
"int",
"quote",
";",
"String",
"name",
"=",
"null",
";",
"String",
"value",
"=",
"null",
";",
"StringBuilder",
"buffer",
"=",
"new",
"StringBuilder",
"... | read node name, after read nodeName
@return String
@throws IOException | [
"read",
"node",
"name",
"after",
"read",
"nodeName"
] | f1cb420a092f8ba94317519ede739974decb5617 | https://github.com/jeffreyning/nh-micro/blob/f1cb420a092f8ba94317519ede739974decb5617/nh-micro-nhs/src/main/java/com/nh/micro/nhs/util/Parser.java#L42-L135 |
12,074 | mgormley/pacaya | src/main/java/edu/jhu/pacaya/gm/inf/CachingBpSchedule.java | CachingBpSchedule.filterConstantMsgs | @SuppressWarnings("unchecked")
private static List<Object> filterConstantMsgs(List<Object> order, FactorGraph fg) {
ArrayList<Object> filt = new ArrayList<Object>();
for (Object item : order) {
if (item instanceof List) {
List<Object> items = filterConstantMsgs((List<Obje... | java | @SuppressWarnings("unchecked")
private static List<Object> filterConstantMsgs(List<Object> order, FactorGraph fg) {
ArrayList<Object> filt = new ArrayList<Object>();
for (Object item : order) {
if (item instanceof List) {
List<Object> items = filterConstantMsgs((List<Obje... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"private",
"static",
"List",
"<",
"Object",
">",
"filterConstantMsgs",
"(",
"List",
"<",
"Object",
">",
"order",
",",
"FactorGraph",
"fg",
")",
"{",
"ArrayList",
"<",
"Object",
">",
"filt",
"=",
"new",
"A... | Filters edges from a leaf node. | [
"Filters",
"edges",
"from",
"a",
"leaf",
"node",
"."
] | 786294cbac7cc65dbc32210c10acc32ed0c69233 | https://github.com/mgormley/pacaya/blob/786294cbac7cc65dbc32210c10acc32ed0c69233/src/main/java/edu/jhu/pacaya/gm/inf/CachingBpSchedule.java#L51-L72 |
12,075 | mgormley/pacaya | src/main/java/edu/jhu/pacaya/parse/cky/intdata/IntNaryTree.java | IntNaryTree.getAsPennTreebankString | public String getAsPennTreebankString() {
StringBuilder sb = new StringBuilder();
sb.append("(");
getAsPennTreebankString(1, 1, sb);
sb.append(")");
return sb.toString();
} | java | public String getAsPennTreebankString() {
StringBuilder sb = new StringBuilder();
sb.append("(");
getAsPennTreebankString(1, 1, sb);
sb.append(")");
return sb.toString();
} | [
"public",
"String",
"getAsPennTreebankString",
"(",
")",
"{",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"sb",
".",
"append",
"(",
"\"(\"",
")",
";",
"getAsPennTreebankString",
"(",
"1",
",",
"1",
",",
"sb",
")",
";",
"sb",
".",
... | Gets a string representation of this parse that looks like the typical
Penn Treebank style parse.
Example:
((ROOT (S (NP (NN time))
(VP (VBZ flies)
(PP (IN like)
(NP (DT an)
(NN arrow)))))))
@return A string representing this parse. | [
"Gets",
"a",
"string",
"representation",
"of",
"this",
"parse",
"that",
"looks",
"like",
"the",
"typical",
"Penn",
"Treebank",
"style",
"parse",
"."
] | 786294cbac7cc65dbc32210c10acc32ed0c69233 | https://github.com/mgormley/pacaya/blob/786294cbac7cc65dbc32210c10acc32ed0c69233/src/main/java/edu/jhu/pacaya/parse/cky/intdata/IntNaryTree.java#L71-L77 |
12,076 | mgormley/pacaya | src/main/java/edu/jhu/pacaya/parse/cky/intdata/IntNaryTree.java | IntNaryTree.postOrderFilterNodes | public void postOrderFilterNodes(final NaryTreeNodeFilter filter) {
postOrderTraversal(new FnO1ToVoid<IntNaryTree>() {
@Override
public void call(IntNaryTree node) {
if (!node.isLeaf()) {
ArrayList<IntNaryTree> filtChildren = new ArrayList<IntNaryTree>... | java | public void postOrderFilterNodes(final NaryTreeNodeFilter filter) {
postOrderTraversal(new FnO1ToVoid<IntNaryTree>() {
@Override
public void call(IntNaryTree node) {
if (!node.isLeaf()) {
ArrayList<IntNaryTree> filtChildren = new ArrayList<IntNaryTree>... | [
"public",
"void",
"postOrderFilterNodes",
"(",
"final",
"NaryTreeNodeFilter",
"filter",
")",
"{",
"postOrderTraversal",
"(",
"new",
"FnO1ToVoid",
"<",
"IntNaryTree",
">",
"(",
")",
"{",
"@",
"Override",
"public",
"void",
"call",
"(",
"IntNaryTree",
"node",
")",
... | Keep only those nodes which the filter accepts. | [
"Keep",
"only",
"those",
"nodes",
"which",
"the",
"filter",
"accepts",
"."
] | 786294cbac7cc65dbc32210c10acc32ed0c69233 | https://github.com/mgormley/pacaya/blob/786294cbac7cc65dbc32210c10acc32ed0c69233/src/main/java/edu/jhu/pacaya/parse/cky/intdata/IntNaryTree.java#L306-L322 |
12,077 | mgormley/pacaya | src/main/java/edu/jhu/pacaya/gm/data/LabeledFgExample.java | LabeledFgExample.getGoldConfigPred | public VarConfig getGoldConfigPred(int factorId) {
VarSet vars = fgLatPred.getFactor(factorId).getVars();
return goldConfig.getIntersection(VarSet.getVarsOfType(vars, VarType.PREDICTED));
} | java | public VarConfig getGoldConfigPred(int factorId) {
VarSet vars = fgLatPred.getFactor(factorId).getVars();
return goldConfig.getIntersection(VarSet.getVarsOfType(vars, VarType.PREDICTED));
} | [
"public",
"VarConfig",
"getGoldConfigPred",
"(",
"int",
"factorId",
")",
"{",
"VarSet",
"vars",
"=",
"fgLatPred",
".",
"getFactor",
"(",
"factorId",
")",
".",
"getVars",
"(",
")",
";",
"return",
"goldConfig",
".",
"getIntersection",
"(",
"VarSet",
".",
"getV... | Gets the gold configuration of the predicted variables ONLY for the given factor. | [
"Gets",
"the",
"gold",
"configuration",
"of",
"the",
"predicted",
"variables",
"ONLY",
"for",
"the",
"given",
"factor",
"."
] | 786294cbac7cc65dbc32210c10acc32ed0c69233 | https://github.com/mgormley/pacaya/blob/786294cbac7cc65dbc32210c10acc32ed0c69233/src/main/java/edu/jhu/pacaya/gm/data/LabeledFgExample.java#L72-L75 |
12,078 | mgormley/pacaya | src/main/java/edu/jhu/pacaya/gm/data/LabeledFgExample.java | LabeledFgExample.getGoldConfigIdxPred | public int getGoldConfigIdxPred(int factorId) {
VarSet vars = VarSet.getVarsOfType(fgLatPred.getFactor(factorId).getVars(), VarType.PREDICTED);
return goldConfig.getConfigIndexOfSubset(vars);
} | java | public int getGoldConfigIdxPred(int factorId) {
VarSet vars = VarSet.getVarsOfType(fgLatPred.getFactor(factorId).getVars(), VarType.PREDICTED);
return goldConfig.getConfigIndexOfSubset(vars);
} | [
"public",
"int",
"getGoldConfigIdxPred",
"(",
"int",
"factorId",
")",
"{",
"VarSet",
"vars",
"=",
"VarSet",
".",
"getVarsOfType",
"(",
"fgLatPred",
".",
"getFactor",
"(",
"factorId",
")",
".",
"getVars",
"(",
")",
",",
"VarType",
".",
"PREDICTED",
")",
";"... | Gets the gold configuration index of the predicted variables for the given factor. | [
"Gets",
"the",
"gold",
"configuration",
"index",
"of",
"the",
"predicted",
"variables",
"for",
"the",
"given",
"factor",
"."
] | 786294cbac7cc65dbc32210c10acc32ed0c69233 | https://github.com/mgormley/pacaya/blob/786294cbac7cc65dbc32210c10acc32ed0c69233/src/main/java/edu/jhu/pacaya/gm/data/LabeledFgExample.java#L78-L81 |
12,079 | jeffreyning/nh-micro | nh-micro-nhs/src/main/java/com/nh/micro/nhs/JspParser.java | JspParser.clip | protected void clip(Node node, int type) {
if(node.getNodeType() != NodeType.TEXT) {
return;
}
char c;
int j = 0;
String content = node.getTextContent();
if(type == 1) {
/**
* 删除该文本节点的后缀空格
* 也就是删除下�?��标签节点的前导空�? ... | java | protected void clip(Node node, int type) {
if(node.getNodeType() != NodeType.TEXT) {
return;
}
char c;
int j = 0;
String content = node.getTextContent();
if(type == 1) {
/**
* 删除该文本节点的后缀空格
* 也就是删除下�?��标签节点的前导空�? ... | [
"protected",
"void",
"clip",
"(",
"Node",
"node",
",",
"int",
"type",
")",
"{",
"if",
"(",
"node",
".",
"getNodeType",
"(",
")",
"!=",
"NodeType",
".",
"TEXT",
")",
"{",
"return",
";",
"}",
"char",
"c",
";",
"int",
"j",
"=",
"0",
";",
"String",
... | type == 1 prefix clip
type == 2 suffix clip
@param node
@param type | [
"type",
"==",
"1",
"prefix",
"clip",
"type",
"==",
"2",
"suffix",
"clip"
] | f1cb420a092f8ba94317519ede739974decb5617 | https://github.com/jeffreyning/nh-micro/blob/f1cb420a092f8ba94317519ede739974decb5617/nh-micro-nhs/src/main/java/com/nh/micro/nhs/JspParser.java#L685-L736 |
12,080 | mgormley/pacaya | src/main/java/edu/jhu/pacaya/parse/dep/EdgeScores.java | EdgeScores.edgeScoresToTensor | public static Tensor edgeScoresToTensor(EdgeScores es, Algebra s) {
int n = es.child.length;
Tensor m = new Tensor(s, n, n);
for (int p = -1; p < n; p++) {
for (int c = 0; c < n; c++) {
if (p == c) { continue; }
int pp = getTensorParent(p, c);
... | java | public static Tensor edgeScoresToTensor(EdgeScores es, Algebra s) {
int n = es.child.length;
Tensor m = new Tensor(s, n, n);
for (int p = -1; p < n; p++) {
for (int c = 0; c < n; c++) {
if (p == c) { continue; }
int pp = getTensorParent(p, c);
... | [
"public",
"static",
"Tensor",
"edgeScoresToTensor",
"(",
"EdgeScores",
"es",
",",
"Algebra",
"s",
")",
"{",
"int",
"n",
"=",
"es",
".",
"child",
".",
"length",
";",
"Tensor",
"m",
"=",
"new",
"Tensor",
"(",
"s",
",",
"n",
",",
"n",
")",
";",
"for",... | Convert an EdgeScores object to a Tensor, where the wall node is indexed as position n+1 in the Tensor.
@param s TODO | [
"Convert",
"an",
"EdgeScores",
"object",
"to",
"a",
"Tensor",
"where",
"the",
"wall",
"node",
"is",
"indexed",
"as",
"position",
"n",
"+",
"1",
"in",
"the",
"Tensor",
"."
] | 786294cbac7cc65dbc32210c10acc32ed0c69233 | https://github.com/mgormley/pacaya/blob/786294cbac7cc65dbc32210c10acc32ed0c69233/src/main/java/edu/jhu/pacaya/parse/dep/EdgeScores.java#L85-L96 |
12,081 | mgormley/pacaya | src/main/java/edu/jhu/pacaya/parse/dep/EdgeScores.java | EdgeScores.tensorToEdgeScores | public static EdgeScores tensorToEdgeScores(Tensor t) {
if (t.getDims().length != 2) {
throw new IllegalArgumentException("Tensor must be an nxn matrix.");
}
int n = t.getDims()[1];
EdgeScores es = new EdgeScores(n, 0);
for (int p = -1; p < n; p++) {
... | java | public static EdgeScores tensorToEdgeScores(Tensor t) {
if (t.getDims().length != 2) {
throw new IllegalArgumentException("Tensor must be an nxn matrix.");
}
int n = t.getDims()[1];
EdgeScores es = new EdgeScores(n, 0);
for (int p = -1; p < n; p++) {
... | [
"public",
"static",
"EdgeScores",
"tensorToEdgeScores",
"(",
"Tensor",
"t",
")",
"{",
"if",
"(",
"t",
".",
"getDims",
"(",
")",
".",
"length",
"!=",
"2",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Tensor must be an nxn matrix.\"",
")",
";",
... | Convert a Tensor object to an EdgeScores, where the wall node is indexed as position n+1 in the Tensor. | [
"Convert",
"a",
"Tensor",
"object",
"to",
"an",
"EdgeScores",
"where",
"the",
"wall",
"node",
"is",
"indexed",
"as",
"position",
"n",
"+",
"1",
"in",
"the",
"Tensor",
"."
] | 786294cbac7cc65dbc32210c10acc32ed0c69233 | https://github.com/mgormley/pacaya/blob/786294cbac7cc65dbc32210c10acc32ed0c69233/src/main/java/edu/jhu/pacaya/parse/dep/EdgeScores.java#L99-L113 |
12,082 | mgormley/pacaya | src/main/java/edu/jhu/pacaya/parse/dep/EdgeScores.java | EdgeScores.combine | public static double[][] combine(double[] fracRoot, double[][] fracChild) {
int nplus = fracChild.length + 1;
double[][] scores = new double[nplus][nplus];
for (int p=0; p<nplus; p++) {
for (int c=0; c<nplus; c++) {
if (c == 0) {
scores[p][c] = Do... | java | public static double[][] combine(double[] fracRoot, double[][] fracChild) {
int nplus = fracChild.length + 1;
double[][] scores = new double[nplus][nplus];
for (int p=0; p<nplus; p++) {
for (int c=0; c<nplus; c++) {
if (c == 0) {
scores[p][c] = Do... | [
"public",
"static",
"double",
"[",
"]",
"[",
"]",
"combine",
"(",
"double",
"[",
"]",
"fracRoot",
",",
"double",
"[",
"]",
"[",
"]",
"fracChild",
")",
"{",
"int",
"nplus",
"=",
"fracChild",
".",
"length",
"+",
"1",
";",
"double",
"[",
"]",
"[",
"... | Combines a set of edge weights represented as wall and child weights into a single set of
weights. The combined weights are indexed such that the wall has index 0 and the tokens of
the sentence are 1-indexed.
@param fracRoot The edge weights from the wall to each child.
@param fracChild The edge weights from parent to... | [
"Combines",
"a",
"set",
"of",
"edge",
"weights",
"represented",
"as",
"wall",
"and",
"child",
"weights",
"into",
"a",
"single",
"set",
"of",
"weights",
".",
"The",
"combined",
"weights",
"are",
"indexed",
"such",
"that",
"the",
"wall",
"has",
"index",
"0",... | 786294cbac7cc65dbc32210c10acc32ed0c69233 | https://github.com/mgormley/pacaya/blob/786294cbac7cc65dbc32210c10acc32ed0c69233/src/main/java/edu/jhu/pacaya/parse/dep/EdgeScores.java#L136-L151 |
12,083 | mgormley/pacaya | src/main/java/edu/jhu/pacaya/gm/train/MarginalLogLikelihood.java | MarginalLogLikelihood.getFgLat | public static FactorGraph getFgLat(FactorGraph fgLatPred, VarConfig goldConfig) {
// TODO: instead, have this just look at whether or not the var is in the gold config
List<Var> predictedVars = VarSet.getVarsOfType(fgLatPred.getVars(), VarType.PREDICTED);
VarConfig predConfig = goldConfig.getInt... | java | public static FactorGraph getFgLat(FactorGraph fgLatPred, VarConfig goldConfig) {
// TODO: instead, have this just look at whether or not the var is in the gold config
List<Var> predictedVars = VarSet.getVarsOfType(fgLatPred.getVars(), VarType.PREDICTED);
VarConfig predConfig = goldConfig.getInt... | [
"public",
"static",
"FactorGraph",
"getFgLat",
"(",
"FactorGraph",
"fgLatPred",
",",
"VarConfig",
"goldConfig",
")",
"{",
"// TODO: instead, have this just look at whether or not the var is in the gold config",
"List",
"<",
"Var",
">",
"predictedVars",
"=",
"VarSet",
".",
"... | Get a copy of the factor graph where the predicted variables are clamped.
@param fgLatPred The original factor graph.
@param goldConfig The assignment to the predicted variables.
@return The clamped factor graph. | [
"Get",
"a",
"copy",
"of",
"the",
"factor",
"graph",
"where",
"the",
"predicted",
"variables",
"are",
"clamped",
"."
] | 786294cbac7cc65dbc32210c10acc32ed0c69233 | https://github.com/mgormley/pacaya/blob/786294cbac7cc65dbc32210c10acc32ed0c69233/src/main/java/edu/jhu/pacaya/gm/train/MarginalLogLikelihood.java#L175-L182 |
12,084 | mgormley/pacaya | src/main/java/edu/jhu/pacaya/gm/train/MarginalLogLikelihood.java | MarginalLogLikelihood.getExpectedFeatureCounts | public static FeatureVector getExpectedFeatureCounts(FgExampleList data, FgInferencerFactory infFactory, FgModel model, double[] params) {
model.updateModelFromDoubles(params);
FgModel feats = model.getDenseCopy();
feats.zero();
for (int i=0; i<data.size(); i++) {
LFgExample ... | java | public static FeatureVector getExpectedFeatureCounts(FgExampleList data, FgInferencerFactory infFactory, FgModel model, double[] params) {
model.updateModelFromDoubles(params);
FgModel feats = model.getDenseCopy();
feats.zero();
for (int i=0; i<data.size(); i++) {
LFgExample ... | [
"public",
"static",
"FeatureVector",
"getExpectedFeatureCounts",
"(",
"FgExampleList",
"data",
",",
"FgInferencerFactory",
"infFactory",
",",
"FgModel",
"model",
",",
"double",
"[",
"]",
"params",
")",
"{",
"model",
".",
"updateModelFromDoubles",
"(",
"params",
")",... | Gets the "expected" feature counts. | [
"Gets",
"the",
"expected",
"feature",
"counts",
"."
] | 786294cbac7cc65dbc32210c10acc32ed0c69233 | https://github.com/mgormley/pacaya/blob/786294cbac7cc65dbc32210c10acc32ed0c69233/src/main/java/edu/jhu/pacaya/gm/train/MarginalLogLikelihood.java#L185-L200 |
12,085 | mgormley/pacaya | src/main/java/edu/jhu/pacaya/gm/train/MarginalLogLikelihood.java | MarginalLogLikelihood.getObservedFeatureCounts | public static FeatureVector getObservedFeatureCounts(FgExampleList data, FgInferencerFactory infFactory, FgModel model, double[] params) {
model.updateModelFromDoubles(params);
FgModel feats = model.getDenseCopy();
feats.zero();
for (int i=0; i<data.size(); i++) {
LFgExample ... | java | public static FeatureVector getObservedFeatureCounts(FgExampleList data, FgInferencerFactory infFactory, FgModel model, double[] params) {
model.updateModelFromDoubles(params);
FgModel feats = model.getDenseCopy();
feats.zero();
for (int i=0; i<data.size(); i++) {
LFgExample ... | [
"public",
"static",
"FeatureVector",
"getObservedFeatureCounts",
"(",
"FgExampleList",
"data",
",",
"FgInferencerFactory",
"infFactory",
",",
"FgModel",
"model",
",",
"double",
"[",
"]",
"params",
")",
"{",
"model",
".",
"updateModelFromDoubles",
"(",
"params",
")",... | Gets the "observed" feature counts. | [
"Gets",
"the",
"observed",
"feature",
"counts",
"."
] | 786294cbac7cc65dbc32210c10acc32ed0c69233 | https://github.com/mgormley/pacaya/blob/786294cbac7cc65dbc32210c10acc32ed0c69233/src/main/java/edu/jhu/pacaya/gm/train/MarginalLogLikelihood.java#L203-L218 |
12,086 | mcaserta/spring-crypto-utils | src/main/java/com/springcryptoutils/core/key/PublicKeyRegistryByAliasImpl.java | PublicKeyRegistryByAliasImpl.get | public PublicKey get(KeyStoreChooser keyStoreChooser, PublicKeyChooserByAlias publicKeyChooserByAlias) {
CacheKey cacheKey = new CacheKey(keyStoreChooser.getKeyStoreName(), publicKeyChooserByAlias.getAlias());
PublicKey retrievedPublicKey = cache.get(cacheKey);
if (retrievedPublicKey != null) {... | java | public PublicKey get(KeyStoreChooser keyStoreChooser, PublicKeyChooserByAlias publicKeyChooserByAlias) {
CacheKey cacheKey = new CacheKey(keyStoreChooser.getKeyStoreName(), publicKeyChooserByAlias.getAlias());
PublicKey retrievedPublicKey = cache.get(cacheKey);
if (retrievedPublicKey != null) {... | [
"public",
"PublicKey",
"get",
"(",
"KeyStoreChooser",
"keyStoreChooser",
",",
"PublicKeyChooserByAlias",
"publicKeyChooserByAlias",
")",
"{",
"CacheKey",
"cacheKey",
"=",
"new",
"CacheKey",
"(",
"keyStoreChooser",
".",
"getKeyStoreName",
"(",
")",
",",
"publicKeyChooser... | Returns the selected public key or null if not found.
@param keyStoreChooser the keystore chooser
@param publicKeyChooserByAlias the public key chooser by alias
@return the selected public key or null if not found | [
"Returns",
"the",
"selected",
"public",
"key",
"or",
"null",
"if",
"not",
"found",
"."
] | 1dbf6211542fb1e3f9297941d691e7e89cc72c46 | https://github.com/mcaserta/spring-crypto-utils/blob/1dbf6211542fb1e3f9297941d691e7e89cc72c46/src/main/java/com/springcryptoutils/core/key/PublicKeyRegistryByAliasImpl.java#L53-L81 |
12,087 | mgormley/pacaya | src/main/java/edu/jhu/pacaya/gm/util/DirectedGraph.java | DirectedGraph.add | public void add(N node) {
if (! node.added) {
nodes.add(node);
node.added = true;
}
} | java | public void add(N node) {
if (! node.added) {
nodes.add(node);
node.added = true;
}
} | [
"public",
"void",
"add",
"(",
"N",
"node",
")",
"{",
"if",
"(",
"!",
"node",
".",
"added",
")",
"{",
"nodes",
".",
"add",
"(",
"node",
")",
";",
"node",
".",
"added",
"=",
"true",
";",
"}",
"}"
] | Adds the node if it's not already present in the graph. | [
"Adds",
"the",
"node",
"if",
"it",
"s",
"not",
"already",
"present",
"in",
"the",
"graph",
"."
] | 786294cbac7cc65dbc32210c10acc32ed0c69233 | https://github.com/mgormley/pacaya/blob/786294cbac7cc65dbc32210c10acc32ed0c69233/src/main/java/edu/jhu/pacaya/gm/util/DirectedGraph.java#L103-L108 |
12,088 | mgormley/pacaya | src/main/java/edu/jhu/pacaya/gm/util/DirectedGraph.java | DirectedGraph.add | public void add(E edge) {
if (! edge.added) {
edges.add(edge);
edge.added = true;
add(edge.getChild());
add(edge.getParent());
}
} | java | public void add(E edge) {
if (! edge.added) {
edges.add(edge);
edge.added = true;
add(edge.getChild());
add(edge.getParent());
}
} | [
"public",
"void",
"add",
"(",
"E",
"edge",
")",
"{",
"if",
"(",
"!",
"edge",
".",
"added",
")",
"{",
"edges",
".",
"add",
"(",
"edge",
")",
";",
"edge",
".",
"added",
"=",
"true",
";",
"add",
"(",
"edge",
".",
"getChild",
"(",
")",
")",
";",
... | Adds the edge and its nodes if not already present in the graph. | [
"Adds",
"the",
"edge",
"and",
"its",
"nodes",
"if",
"not",
"already",
"present",
"in",
"the",
"graph",
"."
] | 786294cbac7cc65dbc32210c10acc32ed0c69233 | https://github.com/mgormley/pacaya/blob/786294cbac7cc65dbc32210c10acc32ed0c69233/src/main/java/edu/jhu/pacaya/gm/util/DirectedGraph.java#L111-L118 |
12,089 | mgormley/pacaya | src/main/java/edu/jhu/pacaya/gm/util/DirectedGraph.java | DirectedGraph.dfs | private void dfs(Node root) {
root.setMarked(true);
for (Edge e : root.getOutEdges()) {
N n = e.getChild();
if (!n.isMarked()) {
dfs(n);
}
}
} | java | private void dfs(Node root) {
root.setMarked(true);
for (Edge e : root.getOutEdges()) {
N n = e.getChild();
if (!n.isMarked()) {
dfs(n);
}
}
} | [
"private",
"void",
"dfs",
"(",
"Node",
"root",
")",
"{",
"root",
".",
"setMarked",
"(",
"true",
")",
";",
"for",
"(",
"Edge",
"e",
":",
"root",
".",
"getOutEdges",
"(",
")",
")",
"{",
"N",
"n",
"=",
"e",
".",
"getChild",
"(",
")",
";",
"if",
... | Runs depth-first search on the graph starting at node n, marking each node as it is encountered.
@param root | [
"Runs",
"depth",
"-",
"first",
"search",
"on",
"the",
"graph",
"starting",
"at",
"node",
"n",
"marking",
"each",
"node",
"as",
"it",
"is",
"encountered",
"."
] | 786294cbac7cc65dbc32210c10acc32ed0c69233 | https://github.com/mgormley/pacaya/blob/786294cbac7cc65dbc32210c10acc32ed0c69233/src/main/java/edu/jhu/pacaya/gm/util/DirectedGraph.java#L206-L214 |
12,090 | mgormley/pacaya | src/main/java/edu/jhu/pacaya/gm/util/DirectedGraph.java | DirectedGraph.preOrderTraversal | public void preOrderTraversal(N root, Visitor<N> v) {
setMarkedAllNodes(false);
preOrderTraveralRecursive(root, v);
} | java | public void preOrderTraversal(N root, Visitor<N> v) {
setMarkedAllNodes(false);
preOrderTraveralRecursive(root, v);
} | [
"public",
"void",
"preOrderTraversal",
"(",
"N",
"root",
",",
"Visitor",
"<",
"N",
">",
"v",
")",
"{",
"setMarkedAllNodes",
"(",
"false",
")",
";",
"preOrderTraveralRecursive",
"(",
"root",
",",
"v",
")",
";",
"}"
] | Visits the nodes in a pre-order traversal. | [
"Visits",
"the",
"nodes",
"in",
"a",
"pre",
"-",
"order",
"traversal",
"."
] | 786294cbac7cc65dbc32210c10acc32ed0c69233 | https://github.com/mgormley/pacaya/blob/786294cbac7cc65dbc32210c10acc32ed0c69233/src/main/java/edu/jhu/pacaya/gm/util/DirectedGraph.java#L247-L250 |
12,091 | rtyley/roboguice-sherlock | src/main/java/com/github/rtyley/android/sherlock/android/accounts/SherlockAccountAuthenticatorActivity.java | SherlockAccountAuthenticatorActivity.onCreate | protected void onCreate(Bundle icicle) {
super.onCreate(icicle);
mAccountAuthenticatorResponse =
getIntent().getParcelableExtra(AccountManager.KEY_ACCOUNT_AUTHENTICATOR_RESPONSE);
if (mAccountAuthenticatorResponse != null) {
mAccountAuthenticatorResponse.onRequestCo... | java | protected void onCreate(Bundle icicle) {
super.onCreate(icicle);
mAccountAuthenticatorResponse =
getIntent().getParcelableExtra(AccountManager.KEY_ACCOUNT_AUTHENTICATOR_RESPONSE);
if (mAccountAuthenticatorResponse != null) {
mAccountAuthenticatorResponse.onRequestCo... | [
"protected",
"void",
"onCreate",
"(",
"Bundle",
"icicle",
")",
"{",
"super",
".",
"onCreate",
"(",
"icicle",
")",
";",
"mAccountAuthenticatorResponse",
"=",
"getIntent",
"(",
")",
".",
"getParcelableExtra",
"(",
"AccountManager",
".",
"KEY_ACCOUNT_AUTHENTICATOR_RESP... | Retreives the AccountAuthenticatorResponse from either the intent of the icicle, if the
icicle is non-zero.
@param icicle the save instance data of this Activity, may be null | [
"Retreives",
"the",
"AccountAuthenticatorResponse",
"from",
"either",
"the",
"intent",
"of",
"the",
"icicle",
"if",
"the",
"icicle",
"is",
"non",
"-",
"zero",
"."
] | 691d41f41bd42d6d981c4b9f3451ab342efa0293 | https://github.com/rtyley/roboguice-sherlock/blob/691d41f41bd42d6d981c4b9f3451ab342efa0293/src/main/java/com/github/rtyley/android/sherlock/android/accounts/SherlockAccountAuthenticatorActivity.java#L59-L68 |
12,092 | rtyley/roboguice-sherlock | src/main/java/com/github/rtyley/android/sherlock/android/accounts/SherlockAccountAuthenticatorActivity.java | SherlockAccountAuthenticatorActivity.finish | public void finish() {
if (mAccountAuthenticatorResponse != null) {
// send the result bundle back if set, otherwise send an error.
if (mResultBundle != null) {
mAccountAuthenticatorResponse.onResult(mResultBundle);
} else {
mAccountAuthenticat... | java | public void finish() {
if (mAccountAuthenticatorResponse != null) {
// send the result bundle back if set, otherwise send an error.
if (mResultBundle != null) {
mAccountAuthenticatorResponse.onResult(mResultBundle);
} else {
mAccountAuthenticat... | [
"public",
"void",
"finish",
"(",
")",
"{",
"if",
"(",
"mAccountAuthenticatorResponse",
"!=",
"null",
")",
"{",
"// send the result bundle back if set, otherwise send an error.",
"if",
"(",
"mResultBundle",
"!=",
"null",
")",
"{",
"mAccountAuthenticatorResponse",
".",
"o... | Sends the result or a Constants.ERROR_CODE_CANCELED error if a result isn't present. | [
"Sends",
"the",
"result",
"or",
"a",
"Constants",
".",
"ERROR_CODE_CANCELED",
"error",
"if",
"a",
"result",
"isn",
"t",
"present",
"."
] | 691d41f41bd42d6d981c4b9f3451ab342efa0293 | https://github.com/rtyley/roboguice-sherlock/blob/691d41f41bd42d6d981c4b9f3451ab342efa0293/src/main/java/com/github/rtyley/android/sherlock/android/accounts/SherlockAccountAuthenticatorActivity.java#L73-L85 |
12,093 | mgormley/pacaya | src/main/java/edu/jhu/pacaya/gm/model/globalfac/ProjDepTreeModule.java | ProjDepTreeModule.containsZeros | public static boolean containsZeros(Tensor tmFalseIn) {
Algebra s = tmFalseIn.getAlgebra();
for (int c=0; c<tmFalseIn.size(); c++) {
if (tmFalseIn.getValue(c) == s.zero()) {
return true;
}
}
return false;
} | java | public static boolean containsZeros(Tensor tmFalseIn) {
Algebra s = tmFalseIn.getAlgebra();
for (int c=0; c<tmFalseIn.size(); c++) {
if (tmFalseIn.getValue(c) == s.zero()) {
return true;
}
}
return false;
} | [
"public",
"static",
"boolean",
"containsZeros",
"(",
"Tensor",
"tmFalseIn",
")",
"{",
"Algebra",
"s",
"=",
"tmFalseIn",
".",
"getAlgebra",
"(",
")",
";",
"for",
"(",
"int",
"c",
"=",
"0",
";",
"c",
"<",
"tmFalseIn",
".",
"size",
"(",
")",
";",
"c",
... | Returns true if the tensor contains zeros. | [
"Returns",
"true",
"if",
"the",
"tensor",
"contains",
"zeros",
"."
] | 786294cbac7cc65dbc32210c10acc32ed0c69233 | https://github.com/mgormley/pacaya/blob/786294cbac7cc65dbc32210c10acc32ed0c69233/src/main/java/edu/jhu/pacaya/gm/model/globalfac/ProjDepTreeModule.java#L292-L300 |
12,094 | mgormley/pacaya | src/main/java/edu/jhu/pacaya/parse/cky/CkyPcfgParser.java | CkyPcfgParser.parseSentence | public static final void parseSentence(final int[] sent, final CnfGrammar grammar, final LoopOrder loopOrder, final Chart chart, final Scorer scorer) {
// Apply lexical rules to each word.
for (int i = 0; i <= sent.length - 1; i++) {
ChartCell cell = chart.getCell(i, i+1);
for (f... | java | public static final void parseSentence(final int[] sent, final CnfGrammar grammar, final LoopOrder loopOrder, final Chart chart, final Scorer scorer) {
// Apply lexical rules to each word.
for (int i = 0; i <= sent.length - 1; i++) {
ChartCell cell = chart.getCell(i, i+1);
for (f... | [
"public",
"static",
"final",
"void",
"parseSentence",
"(",
"final",
"int",
"[",
"]",
"sent",
",",
"final",
"CnfGrammar",
"grammar",
",",
"final",
"LoopOrder",
"loopOrder",
",",
"final",
"Chart",
"chart",
",",
"final",
"Scorer",
"scorer",
")",
"{",
"// Apply ... | Runs CKY and populates the chart.
@param sent The input sentence.
@param grammar The input grammar.
@param loopOrder The loop order to use when parsing.
@param chart The output chart. | [
"Runs",
"CKY",
"and",
"populates",
"the",
"chart",
"."
] | 786294cbac7cc65dbc32210c10acc32ed0c69233 | https://github.com/mgormley/pacaya/blob/786294cbac7cc65dbc32210c10acc32ed0c69233/src/main/java/edu/jhu/pacaya/parse/cky/CkyPcfgParser.java#L98-L134 |
12,095 | mgormley/pacaya | src/main/java/edu/jhu/pacaya/parse/cky/CkyPcfgParser.java | CkyPcfgParser.processCellUnaryRules | private static final void processCellUnaryRules(final CnfGrammar grammar, final int start, final int end,
final ChartCell cell, final Scorer scorer) {
// Apply unary rules.
ScoresSnapshot scoresSnapshot = cell.getScoresSnapshot();
int[] nts = cell.getNts();
for(final int pare... | java | private static final void processCellUnaryRules(final CnfGrammar grammar, final int start, final int end,
final ChartCell cell, final Scorer scorer) {
// Apply unary rules.
ScoresSnapshot scoresSnapshot = cell.getScoresSnapshot();
int[] nts = cell.getNts();
for(final int pare... | [
"private",
"static",
"final",
"void",
"processCellUnaryRules",
"(",
"final",
"CnfGrammar",
"grammar",
",",
"final",
"int",
"start",
",",
"final",
"int",
"end",
",",
"final",
"ChartCell",
"cell",
",",
"final",
"Scorer",
"scorer",
")",
"{",
"// Apply unary rules."... | Process a cell, unary rules only. | [
"Process",
"a",
"cell",
"unary",
"rules",
"only",
"."
] | 786294cbac7cc65dbc32210c10acc32ed0c69233 | https://github.com/mgormley/pacaya/blob/786294cbac7cc65dbc32210c10acc32ed0c69233/src/main/java/edu/jhu/pacaya/parse/cky/CkyPcfgParser.java#L137-L149 |
12,096 | mgormley/pacaya | src/main/java/edu/jhu/pacaya/parse/cky/data/NaryTree.java | NaryTree.getLeafAt | public NaryTree getLeafAt(int idx) {
NaryTree leaf = null;
for (NaryTree l : this.getLeaves()) {
if (l.start <= idx && idx < l.end) {
leaf = l;
}
}
return leaf;
} | java | public NaryTree getLeafAt(int idx) {
NaryTree leaf = null;
for (NaryTree l : this.getLeaves()) {
if (l.start <= idx && idx < l.end) {
leaf = l;
}
}
return leaf;
} | [
"public",
"NaryTree",
"getLeafAt",
"(",
"int",
"idx",
")",
"{",
"NaryTree",
"leaf",
"=",
"null",
";",
"for",
"(",
"NaryTree",
"l",
":",
"this",
".",
"getLeaves",
"(",
")",
")",
"{",
"if",
"(",
"l",
".",
"start",
"<=",
"idx",
"&&",
"idx",
"<",
"l"... | Gets the leaf containing the specified token index. | [
"Gets",
"the",
"leaf",
"containing",
"the",
"specified",
"token",
"index",
"."
] | 786294cbac7cc65dbc32210c10acc32ed0c69233 | https://github.com/mgormley/pacaya/blob/786294cbac7cc65dbc32210c10acc32ed0c69233/src/main/java/edu/jhu/pacaya/parse/cky/data/NaryTree.java#L345-L353 |
12,097 | mgormley/pacaya | src/main/java/edu/jhu/pacaya/gm/model/globalfac/HeadAutomataFactor.java | HeadAutomataFactor.getVarsByDist | public static LinkVar[] getVarsByDist(int head, boolean isRight, LinkVar[] rootVars, LinkVar[][] childVars) {
int dir = isRight ? 1 : -1;
int maxDist = isRight ? rootVars.length - head - 1: head - 1;
LinkVar[] varsByDist = new LinkVar[maxDist];
for (int cDist = 1; cDist <= maxDist; cDist... | java | public static LinkVar[] getVarsByDist(int head, boolean isRight, LinkVar[] rootVars, LinkVar[][] childVars) {
int dir = isRight ? 1 : -1;
int maxDist = isRight ? rootVars.length - head - 1: head - 1;
LinkVar[] varsByDist = new LinkVar[maxDist];
for (int cDist = 1; cDist <= maxDist; cDist... | [
"public",
"static",
"LinkVar",
"[",
"]",
"getVarsByDist",
"(",
"int",
"head",
",",
"boolean",
"isRight",
",",
"LinkVar",
"[",
"]",
"rootVars",
",",
"LinkVar",
"[",
"]",
"[",
"]",
"childVars",
")",
"{",
"int",
"dir",
"=",
"isRight",
"?",
"1",
":",
"-"... | Gets the variables for this factor ordered from the head outward.
@param head The 0-indexed head (i.e. -1 denotes the wall).
@param isRight Whether or not this is a right or left head automata.
@param rootVars The link vars with the wall as parent.
@param childVars The other child variables.
@return An array of variabl... | [
"Gets",
"the",
"variables",
"for",
"this",
"factor",
"ordered",
"from",
"the",
"head",
"outward",
"."
] | 786294cbac7cc65dbc32210c10acc32ed0c69233 | https://github.com/mgormley/pacaya/blob/786294cbac7cc65dbc32210c10acc32ed0c69233/src/main/java/edu/jhu/pacaya/gm/model/globalfac/HeadAutomataFactor.java#L201-L214 |
12,098 | mgormley/pacaya | src/main/java/edu/jhu/pacaya/gm/model/VarTensor.java | VarTensor.getMarginal | public VarTensor getMarginal(VarSet vars, boolean normalize) {
VarSet margVars = new VarSet(this.vars);
margVars.retainAll(vars);
VarTensor marg = new VarTensor(s, margVars, s.zero());
if (margVars.size() == 0) {
return marg;
}
IntIter iter =... | java | public VarTensor getMarginal(VarSet vars, boolean normalize) {
VarSet margVars = new VarSet(this.vars);
margVars.retainAll(vars);
VarTensor marg = new VarTensor(s, margVars, s.zero());
if (margVars.size() == 0) {
return marg;
}
IntIter iter =... | [
"public",
"VarTensor",
"getMarginal",
"(",
"VarSet",
"vars",
",",
"boolean",
"normalize",
")",
"{",
"VarSet",
"margVars",
"=",
"new",
"VarSet",
"(",
"this",
".",
"vars",
")",
";",
"margVars",
".",
"retainAll",
"(",
"vars",
")",
";",
"VarTensor",
"marg",
... | Gets the marginal distribution over a subset of the variables in this
factor, optionally normalized.
@param vars The subset of variables for the marginal distribution. This will sum over all variables not in this set.
@param normalize Whether to normalize the resulting distribution.
@return The marginal distribution. | [
"Gets",
"the",
"marginal",
"distribution",
"over",
"a",
"subset",
"of",
"the",
"variables",
"in",
"this",
"factor",
"optionally",
"normalized",
"."
] | 786294cbac7cc65dbc32210c10acc32ed0c69233 | https://github.com/mgormley/pacaya/blob/786294cbac7cc65dbc32210c10acc32ed0c69233/src/main/java/edu/jhu/pacaya/gm/model/VarTensor.java#L65-L85 |
12,099 | mgormley/pacaya | src/main/java/edu/jhu/pacaya/gm/model/VarTensor.java | VarTensor.add | public void add(VarTensor f) {
VarTensor newFactor = applyBinOp(this, f, new AlgebraLambda.Add());
internalSet(newFactor);
} | java | public void add(VarTensor f) {
VarTensor newFactor = applyBinOp(this, f, new AlgebraLambda.Add());
internalSet(newFactor);
} | [
"public",
"void",
"add",
"(",
"VarTensor",
"f",
")",
"{",
"VarTensor",
"newFactor",
"=",
"applyBinOp",
"(",
"this",
",",
"f",
",",
"new",
"AlgebraLambda",
".",
"Add",
"(",
")",
")",
";",
"internalSet",
"(",
"newFactor",
")",
";",
"}"
] | Adds a factor to this one.
From libDAI:
The sum of two factors is defined as follows: if
\f$f : \prod_{l\in L} X_l \to [0,\infty)\f$ and \f$g : \prod_{m\in M} X_m \to [0,\infty)\f$, then
\f[f+g : \prod_{l\in L\cup M} X_l \to [0,\infty) : x \mapsto f(x_L) + g(x_M).\f] | [
"Adds",
"a",
"factor",
"to",
"this",
"one",
"."
] | 786294cbac7cc65dbc32210c10acc32ed0c69233 | https://github.com/mgormley/pacaya/blob/786294cbac7cc65dbc32210c10acc32ed0c69233/src/main/java/edu/jhu/pacaya/gm/model/VarTensor.java#L120-L123 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.