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
14,900
lightbend/config
config/src/main/java/com/typesafe/config/impl/ConfigImplUtil.java
ConfigImplUtil.syntaxFromExtension
public static ConfigSyntax syntaxFromExtension(String filename) { if (filename == null) return null; else if (filename.endsWith(".json")) return ConfigSyntax.JSON; else if (filename.endsWith(".conf")) return ConfigSyntax.CONF; else if (filename.endsWit...
java
public static ConfigSyntax syntaxFromExtension(String filename) { if (filename == null) return null; else if (filename.endsWith(".json")) return ConfigSyntax.JSON; else if (filename.endsWith(".conf")) return ConfigSyntax.CONF; else if (filename.endsWit...
[ "public", "static", "ConfigSyntax", "syntaxFromExtension", "(", "String", "filename", ")", "{", "if", "(", "filename", "==", "null", ")", "return", "null", ";", "else", "if", "(", "filename", ".", "endsWith", "(", "\".json\"", ")", ")", "return", "ConfigSynt...
Guess configuration syntax from given filename. @param filename configuration filename @return configuration syntax if a match is found. Otherwise, null.
[ "Guess", "configuration", "syntax", "from", "given", "filename", "." ]
68cebfde5e861e9a5fdc75ceff366ed95e17d475
https://github.com/lightbend/config/blob/68cebfde5e861e9a5fdc75ceff366ed95e17d475/config/src/main/java/com/typesafe/config/impl/ConfigImplUtil.java#L290-L301
14,901
lightbend/config
config/src/main/java/com/typesafe/config/impl/ConfigDelayedMerge.java
ConfigDelayedMerge.makeReplacement
static AbstractConfigValue makeReplacement(ResolveContext context, List<AbstractConfigValue> stack, int skipping) { List<AbstractConfigValue> subStack = stack.subList(skipping, stack.size()); if (subStack.isEmpty()) { if (ConfigImpl.traceSubstitutionsEnabled()) ConfigImpl.tr...
java
static AbstractConfigValue makeReplacement(ResolveContext context, List<AbstractConfigValue> stack, int skipping) { List<AbstractConfigValue> subStack = stack.subList(skipping, stack.size()); if (subStack.isEmpty()) { if (ConfigImpl.traceSubstitutionsEnabled()) ConfigImpl.tr...
[ "static", "AbstractConfigValue", "makeReplacement", "(", "ResolveContext", "context", ",", "List", "<", "AbstractConfigValue", ">", "stack", ",", "int", "skipping", ")", "{", "List", "<", "AbstractConfigValue", ">", "subStack", "=", "stack", ".", "subList", "(", ...
static method also used by ConfigDelayedMergeObject; end may be null
[ "static", "method", "also", "used", "by", "ConfigDelayedMergeObject", ";", "end", "may", "be", "null" ]
68cebfde5e861e9a5fdc75ceff366ed95e17d475
https://github.com/lightbend/config/blob/68cebfde5e861e9a5fdc75ceff366ed95e17d475/config/src/main/java/com/typesafe/config/impl/ConfigDelayedMerge.java#L161-L179
14,902
lightbend/config
config/src/main/java/com/typesafe/config/impl/ConfigDelayedMerge.java
ConfigDelayedMerge.stackIgnoresFallbacks
static boolean stackIgnoresFallbacks(List<AbstractConfigValue> stack) { AbstractConfigValue last = stack.get(stack.size() - 1); return last.ignoresFallbacks(); }
java
static boolean stackIgnoresFallbacks(List<AbstractConfigValue> stack) { AbstractConfigValue last = stack.get(stack.size() - 1); return last.ignoresFallbacks(); }
[ "static", "boolean", "stackIgnoresFallbacks", "(", "List", "<", "AbstractConfigValue", ">", "stack", ")", "{", "AbstractConfigValue", "last", "=", "stack", ".", "get", "(", "stack", ".", "size", "(", ")", "-", "1", ")", ";", "return", "last", ".", "ignores...
static utility shared with ConfigDelayedMergeObject
[ "static", "utility", "shared", "with", "ConfigDelayedMergeObject" ]
68cebfde5e861e9a5fdc75ceff366ed95e17d475
https://github.com/lightbend/config/blob/68cebfde5e861e9a5fdc75ceff366ed95e17d475/config/src/main/java/com/typesafe/config/impl/ConfigDelayedMerge.java#L210-L213
14,903
lightbend/config
config/src/main/java/com/typesafe/config/impl/ConfigDelayedMerge.java
ConfigDelayedMerge.render
static void render(List<AbstractConfigValue> stack, StringBuilder sb, int indent, boolean atRoot, String atKey, ConfigRenderOptions options) { boolean commentMerge = options.getComments(); if (commentMerge) { sb.append("# unresolved merge of " + stack.size() + " values follows (\...
java
static void render(List<AbstractConfigValue> stack, StringBuilder sb, int indent, boolean atRoot, String atKey, ConfigRenderOptions options) { boolean commentMerge = options.getComments(); if (commentMerge) { sb.append("# unresolved merge of " + stack.size() + " values follows (\...
[ "static", "void", "render", "(", "List", "<", "AbstractConfigValue", ">", "stack", ",", "StringBuilder", "sb", ",", "int", "indent", ",", "boolean", "atRoot", ",", "String", "atKey", ",", "ConfigRenderOptions", "options", ")", "{", "boolean", "commentMerge", "...
static method also used by ConfigDelayedMergeObject.
[ "static", "method", "also", "used", "by", "ConfigDelayedMergeObject", "." ]
68cebfde5e861e9a5fdc75ceff366ed95e17d475
https://github.com/lightbend/config/blob/68cebfde5e861e9a5fdc75ceff366ed95e17d475/config/src/main/java/com/typesafe/config/impl/ConfigDelayedMerge.java#L279-L341
14,904
lightbend/config
config/src/main/java/com/typesafe/config/impl/ConfigImpl.java
ConfigImpl.improveNotResolved
static ConfigException.NotResolved improveNotResolved(Path what, ConfigException.NotResolved original) { String newMessage = what.render() + " has not been resolved, you need to call Config#resolve()," + " see API docs for Config#resolve()"; if (newMessage.equ...
java
static ConfigException.NotResolved improveNotResolved(Path what, ConfigException.NotResolved original) { String newMessage = what.render() + " has not been resolved, you need to call Config#resolve()," + " see API docs for Config#resolve()"; if (newMessage.equ...
[ "static", "ConfigException", ".", "NotResolved", "improveNotResolved", "(", "Path", "what", ",", "ConfigException", ".", "NotResolved", "original", ")", "{", "String", "newMessage", "=", "what", ".", "render", "(", ")", "+", "\" has not been resolved, you need to call...
further down on the stack.
[ "further", "down", "on", "the", "stack", "." ]
68cebfde5e861e9a5fdc75ceff366ed95e17d475
https://github.com/lightbend/config/blob/68cebfde5e861e9a5fdc75ceff366ed95e17d475/config/src/main/java/com/typesafe/config/impl/ConfigImpl.java#L489-L498
14,905
lightbend/config
config/src/main/java/com/typesafe/config/ConfigRenderOptions.java
ConfigRenderOptions.setFormatted
public ConfigRenderOptions setFormatted(boolean value) { if (value == formatted) return this; else return new ConfigRenderOptions(originComments, comments, value, json); }
java
public ConfigRenderOptions setFormatted(boolean value) { if (value == formatted) return this; else return new ConfigRenderOptions(originComments, comments, value, json); }
[ "public", "ConfigRenderOptions", "setFormatted", "(", "boolean", "value", ")", "{", "if", "(", "value", "==", "formatted", ")", "return", "this", ";", "else", "return", "new", "ConfigRenderOptions", "(", "originComments", ",", "comments", ",", "value", ",", "j...
Returns options with formatting toggled. Formatting means indentation and whitespace, enabling formatting makes things prettier but larger. @param value true to enable formatting @return options with requested setting for formatting
[ "Returns", "options", "with", "formatting", "toggled", ".", "Formatting", "means", "indentation", "and", "whitespace", "enabling", "formatting", "makes", "things", "prettier", "but", "larger", "." ]
68cebfde5e861e9a5fdc75ceff366ed95e17d475
https://github.com/lightbend/config/blob/68cebfde5e861e9a5fdc75ceff366ed95e17d475/config/src/main/java/com/typesafe/config/ConfigRenderOptions.java#L121-L126
14,906
lightbend/config
config/src/main/java/com/typesafe/config/impl/ResolveSource.java
ResolveSource.rootMustBeObj
private AbstractConfigObject rootMustBeObj(Container value) { if (value instanceof AbstractConfigObject) { return (AbstractConfigObject) value; } else { return SimpleConfigObject.empty(); } }
java
private AbstractConfigObject rootMustBeObj(Container value) { if (value instanceof AbstractConfigObject) { return (AbstractConfigObject) value; } else { return SimpleConfigObject.empty(); } }
[ "private", "AbstractConfigObject", "rootMustBeObj", "(", "Container", "value", ")", "{", "if", "(", "value", "instanceof", "AbstractConfigObject", ")", "{", "return", "(", "AbstractConfigObject", ")", "value", ";", "}", "else", "{", "return", "SimpleConfigObject", ...
object with nothing in it instead.
[ "object", "with", "nothing", "in", "it", "instead", "." ]
68cebfde5e861e9a5fdc75ceff366ed95e17d475
https://github.com/lightbend/config/blob/68cebfde5e861e9a5fdc75ceff366ed95e17d475/config/src/main/java/com/typesafe/config/impl/ResolveSource.java#L29-L35
14,907
lightbend/config
config/src/main/java/com/typesafe/config/impl/ResolveSource.java
ResolveSource.findInObject
static private ResultWithPath findInObject(AbstractConfigObject obj, ResolveContext context, Path path) throws NotPossibleToResolve { // resolve ONLY portions of the object which are along our path if (ConfigImpl.traceSubstitutionsEnabled()) ConfigImpl.trace("*** finding '" + pat...
java
static private ResultWithPath findInObject(AbstractConfigObject obj, ResolveContext context, Path path) throws NotPossibleToResolve { // resolve ONLY portions of the object which are along our path if (ConfigImpl.traceSubstitutionsEnabled()) ConfigImpl.trace("*** finding '" + pat...
[ "static", "private", "ResultWithPath", "findInObject", "(", "AbstractConfigObject", "obj", ",", "ResolveContext", "context", ",", "Path", "path", ")", "throws", "NotPossibleToResolve", "{", "// resolve ONLY portions of the object which are along our path", "if", "(", "ConfigI...
the ValueWithPath instance itself should not be.
[ "the", "ValueWithPath", "instance", "itself", "should", "not", "be", "." ]
68cebfde5e861e9a5fdc75ceff366ed95e17d475
https://github.com/lightbend/config/blob/68cebfde5e861e9a5fdc75ceff366ed95e17d475/config/src/main/java/com/typesafe/config/impl/ResolveSource.java#L41-L56
14,908
lightbend/config
config/src/main/java/com/typesafe/config/impl/ResolveSource.java
ResolveSource.replace
private static Node<Container> replace(Node<Container> list, Container old, AbstractConfigValue replacement) { Container child = list.head(); if (child != old) throw new ConfigException.BugOrBroken("Can only replace() the top node we're resolving; had " + child + " on top...
java
private static Node<Container> replace(Node<Container> list, Container old, AbstractConfigValue replacement) { Container child = list.head(); if (child != old) throw new ConfigException.BugOrBroken("Can only replace() the top node we're resolving; had " + child + " on top...
[ "private", "static", "Node", "<", "Container", ">", "replace", "(", "Node", "<", "Container", ">", "list", ",", "Container", "old", ",", "AbstractConfigValue", "replacement", ")", "{", "Container", "child", "=", "list", ".", "head", "(", ")", ";", "if", ...
returns null if the replacement results in deleting all the nodes.
[ "returns", "null", "if", "the", "replacement", "results", "in", "deleting", "all", "the", "nodes", "." ]
68cebfde5e861e9a5fdc75ceff366ed95e17d475
https://github.com/lightbend/config/blob/68cebfde5e861e9a5fdc75ceff366ed95e17d475/config/src/main/java/com/typesafe/config/impl/ResolveSource.java#L169-L200
14,909
lightbend/config
config/src/main/java/com/typesafe/config/impl/ResolveSource.java
ResolveSource.replaceWithinCurrentParent
ResolveSource replaceWithinCurrentParent(AbstractConfigValue old, AbstractConfigValue replacement) { if (ConfigImpl.traceSubstitutionsEnabled()) ConfigImpl.trace("replaceWithinCurrentParent old " + old + "@" + System.identityHashCode(old) + " replacement " + replacement + "@" + S...
java
ResolveSource replaceWithinCurrentParent(AbstractConfigValue old, AbstractConfigValue replacement) { if (ConfigImpl.traceSubstitutionsEnabled()) ConfigImpl.trace("replaceWithinCurrentParent old " + old + "@" + System.identityHashCode(old) + " replacement " + replacement + "@" + S...
[ "ResolveSource", "replaceWithinCurrentParent", "(", "AbstractConfigValue", "old", ",", "AbstractConfigValue", "replacement", ")", "{", "if", "(", "ConfigImpl", ".", "traceSubstitutionsEnabled", "(", ")", ")", "ConfigImpl", ".", "trace", "(", "\"replaceWithinCurrentParent ...
replacement may be null to delete
[ "replacement", "may", "be", "null", "to", "delete" ]
68cebfde5e861e9a5fdc75ceff366ed95e17d475
https://github.com/lightbend/config/blob/68cebfde5e861e9a5fdc75ceff366ed95e17d475/config/src/main/java/com/typesafe/config/impl/ResolveSource.java#L231-L250
14,910
lightbend/config
config/src/main/java/com/typesafe/config/impl/Tokenizer.java
Tokenizer.tokenize
static Iterator<Token> tokenize(ConfigOrigin origin, Reader input, ConfigSyntax flavor) { return new TokenIterator(origin, input, flavor != ConfigSyntax.JSON); }
java
static Iterator<Token> tokenize(ConfigOrigin origin, Reader input, ConfigSyntax flavor) { return new TokenIterator(origin, input, flavor != ConfigSyntax.JSON); }
[ "static", "Iterator", "<", "Token", ">", "tokenize", "(", "ConfigOrigin", "origin", ",", "Reader", "input", ",", "ConfigSyntax", "flavor", ")", "{", "return", "new", "TokenIterator", "(", "origin", ",", "input", ",", "flavor", "!=", "ConfigSyntax", ".", "JSO...
Tokenizes a Reader. Does not close the reader; you have to arrange to do that after you're done with the returned iterator.
[ "Tokenizes", "a", "Reader", ".", "Does", "not", "close", "the", "reader", ";", "you", "have", "to", "arrange", "to", "do", "that", "after", "you", "re", "done", "with", "the", "returned", "iterator", "." ]
68cebfde5e861e9a5fdc75ceff366ed95e17d475
https://github.com/lightbend/config/blob/68cebfde5e861e9a5fdc75ceff366ed95e17d475/config/src/main/java/com/typesafe/config/impl/Tokenizer.java#L51-L53
14,911
lightbend/config
config/src/main/java/com/typesafe/config/impl/SimpleConfigOrigin.java
SimpleConfigOrigin.mergeThree
private static SimpleConfigOrigin mergeThree(SimpleConfigOrigin a, SimpleConfigOrigin b, SimpleConfigOrigin c) { if (similarity(a, b) >= similarity(b, c)) { return mergeTwo(mergeTwo(a, b), c); } else { return mergeTwo(a, mergeTwo(b, c)); } }
java
private static SimpleConfigOrigin mergeThree(SimpleConfigOrigin a, SimpleConfigOrigin b, SimpleConfigOrigin c) { if (similarity(a, b) >= similarity(b, c)) { return mergeTwo(mergeTwo(a, b), c); } else { return mergeTwo(a, mergeTwo(b, c)); } }
[ "private", "static", "SimpleConfigOrigin", "mergeThree", "(", "SimpleConfigOrigin", "a", ",", "SimpleConfigOrigin", "b", ",", "SimpleConfigOrigin", "c", ")", "{", "if", "(", "similarity", "(", "a", ",", "b", ")", ">=", "similarity", "(", "b", ",", "c", ")", ...
better consolidated.
[ "better", "consolidated", "." ]
68cebfde5e861e9a5fdc75ceff366ed95e17d475
https://github.com/lightbend/config/blob/68cebfde5e861e9a5fdc75ceff366ed95e17d475/config/src/main/java/com/typesafe/config/impl/SimpleConfigOrigin.java#L338-L344
14,912
lightbend/config
config/src/main/java/com/typesafe/config/impl/SimpleConfigOrigin.java
SimpleConfigOrigin.fieldsDelta
static Map<SerializedField, Object> fieldsDelta(Map<SerializedField, Object> base, Map<SerializedField, Object> child) { Map<SerializedField, Object> m = new EnumMap<SerializedField, Object>(child); for (Map.Entry<SerializedField, Object> baseEntry : base.entrySet()) { Serialize...
java
static Map<SerializedField, Object> fieldsDelta(Map<SerializedField, Object> base, Map<SerializedField, Object> child) { Map<SerializedField, Object> m = new EnumMap<SerializedField, Object>(child); for (Map.Entry<SerializedField, Object> baseEntry : base.entrySet()) { Serialize...
[ "static", "Map", "<", "SerializedField", ",", "Object", ">", "fieldsDelta", "(", "Map", "<", "SerializedField", ",", "Object", ">", "base", ",", "Map", "<", "SerializedField", ",", "Object", ">", "child", ")", "{", "Map", "<", "SerializedField", ",", "Obje...
filename with every single value.
[ "filename", "with", "every", "single", "value", "." ]
68cebfde5e861e9a5fdc75ceff366ed95e17d475
https://github.com/lightbend/config/blob/68cebfde5e861e9a5fdc75ceff366ed95e17d475/config/src/main/java/com/typesafe/config/impl/SimpleConfigOrigin.java#L424-L474
14,913
mikepenz/MaterialDrawer
library/src/main/java/com/mikepenz/materialdrawer/DrawerBuilder.java
DrawerBuilder.withDrawerWidthDp
public DrawerBuilder withDrawerWidthDp(int drawerWidthDp) { if (mActivity == null) { throw new RuntimeException("please pass an activity first to use this call"); } this.mDrawerWidth = Utils.convertDpToPx(mActivity, drawerWidthDp); return this; }
java
public DrawerBuilder withDrawerWidthDp(int drawerWidthDp) { if (mActivity == null) { throw new RuntimeException("please pass an activity first to use this call"); } this.mDrawerWidth = Utils.convertDpToPx(mActivity, drawerWidthDp); return this; }
[ "public", "DrawerBuilder", "withDrawerWidthDp", "(", "int", "drawerWidthDp", ")", "{", "if", "(", "mActivity", "==", "null", ")", "{", "throw", "new", "RuntimeException", "(", "\"please pass an activity first to use this call\"", ")", ";", "}", "this", ".", "mDrawer...
Set the DrawerBuilder width with a dp value @param drawerWidthDp @return
[ "Set", "the", "DrawerBuilder", "width", "with", "a", "dp", "value" ]
f4fb31635767edead0a01cee7b7588942b89d8d9
https://github.com/mikepenz/MaterialDrawer/blob/f4fb31635767edead0a01cee7b7588942b89d8d9/library/src/main/java/com/mikepenz/materialdrawer/DrawerBuilder.java#L419-L426
14,914
mikepenz/MaterialDrawer
library/src/main/java/com/mikepenz/materialdrawer/DrawerBuilder.java
DrawerBuilder.addMenuItems
private void addMenuItems(Menu mMenu, boolean subMenu) { int groupId = R.id.material_drawer_menu_default_group; for (int i = 0; i < mMenu.size(); i++) { MenuItem mMenuItem = mMenu.getItem(i); IDrawerItem iDrawerItem; if (!subMenu && mMenuItem.getGroupId() != groupId &...
java
private void addMenuItems(Menu mMenu, boolean subMenu) { int groupId = R.id.material_drawer_menu_default_group; for (int i = 0; i < mMenu.size(); i++) { MenuItem mMenuItem = mMenu.getItem(i); IDrawerItem iDrawerItem; if (!subMenu && mMenuItem.getGroupId() != groupId &...
[ "private", "void", "addMenuItems", "(", "Menu", "mMenu", ",", "boolean", "subMenu", ")", "{", "int", "groupId", "=", "R", ".", "id", ".", "material_drawer_menu_default_group", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "mMenu", ".", "size", ...
helper method to init the drawerItems from a menu @param mMenu @param subMenu
[ "helper", "method", "to", "init", "the", "drawerItems", "from", "a", "menu" ]
f4fb31635767edead0a01cee7b7588942b89d8d9
https://github.com/mikepenz/MaterialDrawer/blob/f4fb31635767edead0a01cee7b7588942b89d8d9/library/src/main/java/com/mikepenz/materialdrawer/DrawerBuilder.java#L1048-L1083
14,915
mikepenz/MaterialDrawer
library/src/main/java/com/mikepenz/materialdrawer/DrawerBuilder.java
DrawerBuilder.handleShowOnLaunch
private void handleShowOnLaunch() { //check if it should be shown on launch (and we have a drawerLayout) if (mActivity != null && mDrawerLayout != null) { if (mShowDrawerOnFirstLaunch || mShowDrawerUntilDraggedOpened) { final SharedPreferences preferences = mSharedPreferences...
java
private void handleShowOnLaunch() { //check if it should be shown on launch (and we have a drawerLayout) if (mActivity != null && mDrawerLayout != null) { if (mShowDrawerOnFirstLaunch || mShowDrawerUntilDraggedOpened) { final SharedPreferences preferences = mSharedPreferences...
[ "private", "void", "handleShowOnLaunch", "(", ")", "{", "//check if it should be shown on launch (and we have a drawerLayout)", "if", "(", "mActivity", "!=", "null", "&&", "mDrawerLayout", "!=", "null", ")", "{", "if", "(", "mShowDrawerOnFirstLaunch", "||", "mShowDrawerUn...
helper method to handle when the drawer should be shown on launch
[ "helper", "method", "to", "handle", "when", "the", "drawer", "should", "be", "shown", "on", "launch" ]
f4fb31635767edead0a01cee7b7588942b89d8d9
https://github.com/mikepenz/MaterialDrawer/blob/f4fb31635767edead0a01cee7b7588942b89d8d9/library/src/main/java/com/mikepenz/materialdrawer/DrawerBuilder.java#L1265-L1312
14,916
mikepenz/MaterialDrawer
library/src/main/java/com/mikepenz/materialdrawer/DrawerBuilder.java
DrawerBuilder.buildView
public Drawer buildView() { // get the slider view mSliderLayout = (ScrimInsetsRelativeLayout) mActivity.getLayoutInflater().inflate(R.layout.material_drawer_slider, mDrawerLayout, false); mSliderLayout.setBackgroundColor(UIUtils.getThemeColorFromAttrOrRes(mActivity, R.attr.material_drawer_backg...
java
public Drawer buildView() { // get the slider view mSliderLayout = (ScrimInsetsRelativeLayout) mActivity.getLayoutInflater().inflate(R.layout.material_drawer_slider, mDrawerLayout, false); mSliderLayout.setBackgroundColor(UIUtils.getThemeColorFromAttrOrRes(mActivity, R.attr.material_drawer_backg...
[ "public", "Drawer", "buildView", "(", ")", "{", "// get the slider view", "mSliderLayout", "=", "(", "ScrimInsetsRelativeLayout", ")", "mActivity", ".", "getLayoutInflater", "(", ")", ".", "inflate", "(", "R", ".", "layout", ".", "material_drawer_slider", ",", "mD...
build the drawers content only. This will still return a Result object, but only with the content set. No inflating of a DrawerLayout. @return Result object with only the content set
[ "build", "the", "drawers", "content", "only", ".", "This", "will", "still", "return", "a", "Result", "object", "but", "only", "with", "the", "content", "set", ".", "No", "inflating", "of", "a", "DrawerLayout", "." ]
f4fb31635767edead0a01cee7b7588942b89d8d9
https://github.com/mikepenz/MaterialDrawer/blob/f4fb31635767edead0a01cee7b7588942b89d8d9/library/src/main/java/com/mikepenz/materialdrawer/DrawerBuilder.java#L1537-L1580
14,917
mikepenz/MaterialDrawer
library/src/main/java/com/mikepenz/materialdrawer/DrawerBuilder.java
DrawerBuilder.closeDrawerDelayed
protected void closeDrawerDelayed() { if (mCloseOnClick && mDrawerLayout != null) { if (mDelayOnDrawerClose > -1) { new Handler().postDelayed(new Runnable() { @Override public void run() { mDrawerLayout.closeDrawers(); ...
java
protected void closeDrawerDelayed() { if (mCloseOnClick && mDrawerLayout != null) { if (mDelayOnDrawerClose > -1) { new Handler().postDelayed(new Runnable() { @Override public void run() { mDrawerLayout.closeDrawers(); ...
[ "protected", "void", "closeDrawerDelayed", "(", ")", "{", "if", "(", "mCloseOnClick", "&&", "mDrawerLayout", "!=", "null", ")", "{", "if", "(", "mDelayOnDrawerClose", ">", "-", "1", ")", "{", "new", "Handler", "(", ")", ".", "postDelayed", "(", "new", "R...
helper method to close the drawer delayed
[ "helper", "method", "to", "close", "the", "drawer", "delayed" ]
f4fb31635767edead0a01cee7b7588942b89d8d9
https://github.com/mikepenz/MaterialDrawer/blob/f4fb31635767edead0a01cee7b7588942b89d8d9/library/src/main/java/com/mikepenz/materialdrawer/DrawerBuilder.java#L1848-L1865
14,918
mikepenz/MaterialDrawer
library/src/main/java/com/mikepenz/materialdrawer/DrawerBuilder.java
DrawerBuilder.resetStickyFooterSelection
protected void resetStickyFooterSelection() { if (mStickyFooterView instanceof LinearLayout) { for (int i = 0; i < (mStickyFooterView).getChildCount(); i++) { (mStickyFooterView).getChildAt(i).setActivated(false); (mStickyFooterView).getChildAt(i).setSelected(false); ...
java
protected void resetStickyFooterSelection() { if (mStickyFooterView instanceof LinearLayout) { for (int i = 0; i < (mStickyFooterView).getChildCount(); i++) { (mStickyFooterView).getChildAt(i).setActivated(false); (mStickyFooterView).getChildAt(i).setSelected(false); ...
[ "protected", "void", "resetStickyFooterSelection", "(", ")", "{", "if", "(", "mStickyFooterView", "instanceof", "LinearLayout", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "(", "mStickyFooterView", ")", ".", "getChildCount", "(", ")", ";", "...
simple helper method to reset the selection of the sticky footer
[ "simple", "helper", "method", "to", "reset", "the", "selection", "of", "the", "sticky", "footer" ]
f4fb31635767edead0a01cee7b7588942b89d8d9
https://github.com/mikepenz/MaterialDrawer/blob/f4fb31635767edead0a01cee7b7588942b89d8d9/library/src/main/java/com/mikepenz/materialdrawer/DrawerBuilder.java#L1891-L1898
14,919
mikepenz/MaterialDrawer
library/src/main/java/com/mikepenz/materialdrawer/AccountHeader.java
AccountHeader.setActiveProfile
public void setActiveProfile(IProfile profile, boolean fireOnProfileChanged) { final boolean isCurrentSelectedProfile = mAccountHeaderBuilder.switchProfiles(profile); //if the selectionList is shown we should also update the current selected profile in the list if (mAccountHeaderBuilder.mDrawer ...
java
public void setActiveProfile(IProfile profile, boolean fireOnProfileChanged) { final boolean isCurrentSelectedProfile = mAccountHeaderBuilder.switchProfiles(profile); //if the selectionList is shown we should also update the current selected profile in the list if (mAccountHeaderBuilder.mDrawer ...
[ "public", "void", "setActiveProfile", "(", "IProfile", "profile", ",", "boolean", "fireOnProfileChanged", ")", "{", "final", "boolean", "isCurrentSelectedProfile", "=", "mAccountHeaderBuilder", ".", "switchProfiles", "(", "profile", ")", ";", "//if the selectionList is sh...
Selects the given profile and sets it to the new active profile @param profile
[ "Selects", "the", "given", "profile", "and", "sets", "it", "to", "the", "new", "active", "profile" ]
f4fb31635767edead0a01cee7b7588942b89d8d9
https://github.com/mikepenz/MaterialDrawer/blob/f4fb31635767edead0a01cee7b7588942b89d8d9/library/src/main/java/com/mikepenz/materialdrawer/AccountHeader.java#L190-L200
14,920
mikepenz/MaterialDrawer
library/src/main/java/com/mikepenz/materialdrawer/AccountHeader.java
AccountHeader.setActiveProfile
public void setActiveProfile(long identifier, boolean fireOnProfileChanged) { if (mAccountHeaderBuilder.mProfiles != null) { for (IProfile profile : mAccountHeaderBuilder.mProfiles) { if (profile != null) { if (profile.getIdentifier() == identifier) { ...
java
public void setActiveProfile(long identifier, boolean fireOnProfileChanged) { if (mAccountHeaderBuilder.mProfiles != null) { for (IProfile profile : mAccountHeaderBuilder.mProfiles) { if (profile != null) { if (profile.getIdentifier() == identifier) { ...
[ "public", "void", "setActiveProfile", "(", "long", "identifier", ",", "boolean", "fireOnProfileChanged", ")", "{", "if", "(", "mAccountHeaderBuilder", ".", "mProfiles", "!=", "null", ")", "{", "for", "(", "IProfile", "profile", ":", "mAccountHeaderBuilder", ".", ...
Selects a profile by its identifier @param identifier
[ "Selects", "a", "profile", "by", "its", "identifier" ]
f4fb31635767edead0a01cee7b7588942b89d8d9
https://github.com/mikepenz/MaterialDrawer/blob/f4fb31635767edead0a01cee7b7588942b89d8d9/library/src/main/java/com/mikepenz/materialdrawer/AccountHeader.java#L216-L227
14,921
mikepenz/MaterialDrawer
library/src/main/java/com/mikepenz/materialdrawer/AccountHeader.java
AccountHeader.removeProfile
public void removeProfile(int position) { if (mAccountHeaderBuilder.mProfiles != null && mAccountHeaderBuilder.mProfiles.size() > position) { mAccountHeaderBuilder.mProfiles.remove(position); } mAccountHeaderBuilder.updateHeaderAndList(); }
java
public void removeProfile(int position) { if (mAccountHeaderBuilder.mProfiles != null && mAccountHeaderBuilder.mProfiles.size() > position) { mAccountHeaderBuilder.mProfiles.remove(position); } mAccountHeaderBuilder.updateHeaderAndList(); }
[ "public", "void", "removeProfile", "(", "int", "position", ")", "{", "if", "(", "mAccountHeaderBuilder", ".", "mProfiles", "!=", "null", "&&", "mAccountHeaderBuilder", ".", "mProfiles", ".", "size", "(", ")", ">", "position", ")", "{", "mAccountHeaderBuilder", ...
remove a profile from the given position @param position
[ "remove", "a", "profile", "from", "the", "given", "position" ]
f4fb31635767edead0a01cee7b7588942b89d8d9
https://github.com/mikepenz/MaterialDrawer/blob/f4fb31635767edead0a01cee7b7588942b89d8d9/library/src/main/java/com/mikepenz/materialdrawer/AccountHeader.java#L298-L304
14,922
mikepenz/MaterialDrawer
library/src/main/java/com/mikepenz/materialdrawer/AccountHeader.java
AccountHeader.removeProfileByIdentifier
public void removeProfileByIdentifier(long identifier) { int found = getPositionByIdentifier(identifier); if (found > -1) { mAccountHeaderBuilder.mProfiles.remove(found); } mAccountHeaderBuilder.updateHeaderAndList(); }
java
public void removeProfileByIdentifier(long identifier) { int found = getPositionByIdentifier(identifier); if (found > -1) { mAccountHeaderBuilder.mProfiles.remove(found); } mAccountHeaderBuilder.updateHeaderAndList(); }
[ "public", "void", "removeProfileByIdentifier", "(", "long", "identifier", ")", "{", "int", "found", "=", "getPositionByIdentifier", "(", "identifier", ")", ";", "if", "(", "found", ">", "-", "1", ")", "{", "mAccountHeaderBuilder", ".", "mProfiles", ".", "remov...
remove the profile with the given identifier @param identifier
[ "remove", "the", "profile", "with", "the", "given", "identifier" ]
f4fb31635767edead0a01cee7b7588942b89d8d9
https://github.com/mikepenz/MaterialDrawer/blob/f4fb31635767edead0a01cee7b7588942b89d8d9/library/src/main/java/com/mikepenz/materialdrawer/AccountHeader.java#L311-L318
14,923
mikepenz/MaterialDrawer
library/src/main/java/com/mikepenz/materialdrawer/AccountHeader.java
AccountHeader.getPositionByIdentifier
private int getPositionByIdentifier(long identifier) { int found = -1; if (mAccountHeaderBuilder.mProfiles != null && identifier != -1) { for (int i = 0; i < mAccountHeaderBuilder.mProfiles.size(); i++) { if (mAccountHeaderBuilder.mProfiles.get(i) != null) { ...
java
private int getPositionByIdentifier(long identifier) { int found = -1; if (mAccountHeaderBuilder.mProfiles != null && identifier != -1) { for (int i = 0; i < mAccountHeaderBuilder.mProfiles.size(); i++) { if (mAccountHeaderBuilder.mProfiles.get(i) != null) { ...
[ "private", "int", "getPositionByIdentifier", "(", "long", "identifier", ")", "{", "int", "found", "=", "-", "1", ";", "if", "(", "mAccountHeaderBuilder", ".", "mProfiles", "!=", "null", "&&", "identifier", "!=", "-", "1", ")", "{", "for", "(", "int", "i"...
gets the position of a profile by it's identifier @param identifier @return
[ "gets", "the", "position", "of", "a", "profile", "by", "it", "s", "identifier" ]
f4fb31635767edead0a01cee7b7588942b89d8d9
https://github.com/mikepenz/MaterialDrawer/blob/f4fb31635767edead0a01cee7b7588942b89d8d9/library/src/main/java/com/mikepenz/materialdrawer/AccountHeader.java#L348-L361
14,924
mikepenz/MaterialDrawer
library/src/main/java/com/mikepenz/materialdrawer/view/BezelImageView.java
BezelImageView.setSelectorColor
public void setSelectorColor(int selectorColor) { this.mSelectorColor = selectorColor; this.mSelectorFilter = new PorterDuffColorFilter(Color.argb(mSelectorAlpha, Color.red(mSelectorColor), Color.green(mSelectorColor), Color.blue(mSelectorColor)), PorterDuff.Mode.SRC_ATOP); this.invalidate(); ...
java
public void setSelectorColor(int selectorColor) { this.mSelectorColor = selectorColor; this.mSelectorFilter = new PorterDuffColorFilter(Color.argb(mSelectorAlpha, Color.red(mSelectorColor), Color.green(mSelectorColor), Color.blue(mSelectorColor)), PorterDuff.Mode.SRC_ATOP); this.invalidate(); ...
[ "public", "void", "setSelectorColor", "(", "int", "selectorColor", ")", "{", "this", ".", "mSelectorColor", "=", "selectorColor", ";", "this", ".", "mSelectorFilter", "=", "new", "PorterDuffColorFilter", "(", "Color", ".", "argb", "(", "mSelectorAlpha", ",", "Co...
Sets the color of the selector to be draw over the CircularImageView. Be sure to provide some opacity. @param selectorColor The color (including alpha) to set for the selector overlay.
[ "Sets", "the", "color", "of", "the", "selector", "to", "be", "draw", "over", "the", "CircularImageView", ".", "Be", "sure", "to", "provide", "some", "opacity", "." ]
f4fb31635767edead0a01cee7b7588942b89d8d9
https://github.com/mikepenz/MaterialDrawer/blob/f4fb31635767edead0a01cee7b7588942b89d8d9/library/src/main/java/com/mikepenz/materialdrawer/view/BezelImageView.java#L300-L304
14,925
mikepenz/MaterialDrawer
library/src/main/java/com/mikepenz/materialdrawer/MiniDrawer.java
MiniDrawer.generateMiniDrawerItem
public IDrawerItem generateMiniDrawerItem(IDrawerItem drawerItem) { if (drawerItem instanceof SecondaryDrawerItem) { return mIncludeSecondaryDrawerItems ? new MiniDrawerItem((SecondaryDrawerItem) drawerItem).withEnableSelectedBackground(mEnableSelectedMiniDrawerItemBackground).withSelectedBackground...
java
public IDrawerItem generateMiniDrawerItem(IDrawerItem drawerItem) { if (drawerItem instanceof SecondaryDrawerItem) { return mIncludeSecondaryDrawerItems ? new MiniDrawerItem((SecondaryDrawerItem) drawerItem).withEnableSelectedBackground(mEnableSelectedMiniDrawerItemBackground).withSelectedBackground...
[ "public", "IDrawerItem", "generateMiniDrawerItem", "(", "IDrawerItem", "drawerItem", ")", "{", "if", "(", "drawerItem", "instanceof", "SecondaryDrawerItem", ")", "{", "return", "mIncludeSecondaryDrawerItems", "?", "new", "MiniDrawerItem", "(", "(", "SecondaryDrawerItem", ...
generates a MiniDrawerItem from a IDrawerItem @param drawerItem @return
[ "generates", "a", "MiniDrawerItem", "from", "a", "IDrawerItem" ]
f4fb31635767edead0a01cee7b7588942b89d8d9
https://github.com/mikepenz/MaterialDrawer/blob/f4fb31635767edead0a01cee7b7588942b89d8d9/library/src/main/java/com/mikepenz/materialdrawer/MiniDrawer.java#L267-L278
14,926
mikepenz/MaterialDrawer
library/src/main/java/com/mikepenz/materialdrawer/MiniDrawer.java
MiniDrawer.build
public View build(Context ctx) { mContainer = new LinearLayout(ctx); if (mInnerShadow) { if (!mInRTL) { mContainer.setBackgroundResource(R.drawable.material_drawer_shadow_left); } else { mContainer.setBackgroundResource(R.drawable.material_drawer_s...
java
public View build(Context ctx) { mContainer = new LinearLayout(ctx); if (mInnerShadow) { if (!mInRTL) { mContainer.setBackgroundResource(R.drawable.material_drawer_shadow_left); } else { mContainer.setBackgroundResource(R.drawable.material_drawer_s...
[ "public", "View", "build", "(", "Context", "ctx", ")", "{", "mContainer", "=", "new", "LinearLayout", "(", "ctx", ")", ";", "if", "(", "mInnerShadow", ")", "{", "if", "(", "!", "mInRTL", ")", "{", "mContainer", ".", "setBackgroundResource", "(", "R", "...
build the MiniDrawer @param ctx @return
[ "build", "the", "MiniDrawer" ]
f4fb31635767edead0a01cee7b7588942b89d8d9
https://github.com/mikepenz/MaterialDrawer/blob/f4fb31635767edead0a01cee7b7588942b89d8d9/library/src/main/java/com/mikepenz/materialdrawer/MiniDrawer.java#L301-L345
14,927
mikepenz/MaterialDrawer
library/src/main/java/com/mikepenz/materialdrawer/MiniDrawer.java
MiniDrawer.onProfileClick
public void onProfileClick() { //crossfade if we are cross faded if (mCrossFader != null) { if (mCrossFader.isCrossfaded()) { mCrossFader.crossfade(); } } //update the current profile if (mAccountHeader != null) { IProfile prof...
java
public void onProfileClick() { //crossfade if we are cross faded if (mCrossFader != null) { if (mCrossFader.isCrossfaded()) { mCrossFader.crossfade(); } } //update the current profile if (mAccountHeader != null) { IProfile prof...
[ "public", "void", "onProfileClick", "(", ")", "{", "//crossfade if we are cross faded", "if", "(", "mCrossFader", "!=", "null", ")", "{", "if", "(", "mCrossFader", ".", "isCrossfaded", "(", ")", ")", "{", "mCrossFader", ".", "crossfade", "(", ")", ";", "}", ...
call this method to trigger the onProfileClick on the MiniDrawer
[ "call", "this", "method", "to", "trigger", "the", "onProfileClick", "on", "the", "MiniDrawer" ]
f4fb31635767edead0a01cee7b7588942b89d8d9
https://github.com/mikepenz/MaterialDrawer/blob/f4fb31635767edead0a01cee7b7588942b89d8d9/library/src/main/java/com/mikepenz/materialdrawer/MiniDrawer.java#L350-L365
14,928
mikepenz/MaterialDrawer
library/src/main/java/com/mikepenz/materialdrawer/MiniDrawer.java
MiniDrawer.onItemClick
public boolean onItemClick(IDrawerItem selectedDrawerItem) { //We only need to clear if the new item is selectable if (selectedDrawerItem.isSelectable()) { //crossfade if we are cross faded if (mCrossFader != null) { if (mCrossFader.isCrossfaded()) { ...
java
public boolean onItemClick(IDrawerItem selectedDrawerItem) { //We only need to clear if the new item is selectable if (selectedDrawerItem.isSelectable()) { //crossfade if we are cross faded if (mCrossFader != null) { if (mCrossFader.isCrossfaded()) { ...
[ "public", "boolean", "onItemClick", "(", "IDrawerItem", "selectedDrawerItem", ")", "{", "//We only need to clear if the new item is selectable", "if", "(", "selectedDrawerItem", ".", "isSelectable", "(", ")", ")", "{", "//crossfade if we are cross faded", "if", "(", "mCross...
call this method to trigger the onItemClick on the MiniDrawer @param selectedDrawerItem @return
[ "call", "this", "method", "to", "trigger", "the", "onItemClick", "on", "the", "MiniDrawer" ]
f4fb31635767edead0a01cee7b7588942b89d8d9
https://github.com/mikepenz/MaterialDrawer/blob/f4fb31635767edead0a01cee7b7588942b89d8d9/library/src/main/java/com/mikepenz/materialdrawer/MiniDrawer.java#L373-L389
14,929
mikepenz/MaterialDrawer
library/src/main/java/com/mikepenz/materialdrawer/MiniDrawer.java
MiniDrawer.setSelection
public void setSelection(long identifier) { if (identifier == -1) { mAdapter.deselect(); } int count = mAdapter.getItemCount(); for (int i = 0; i < count; i++) { IDrawerItem item = mAdapter.getItem(i); if (item.getIdentifier() == identifier && !item.is...
java
public void setSelection(long identifier) { if (identifier == -1) { mAdapter.deselect(); } int count = mAdapter.getItemCount(); for (int i = 0; i < count; i++) { IDrawerItem item = mAdapter.getItem(i); if (item.getIdentifier() == identifier && !item.is...
[ "public", "void", "setSelection", "(", "long", "identifier", ")", "{", "if", "(", "identifier", "==", "-", "1", ")", "{", "mAdapter", ".", "deselect", "(", ")", ";", "}", "int", "count", "=", "mAdapter", ".", "getItemCount", "(", ")", ";", "for", "("...
set the selection of the MiniDrawer @param identifier the identifier of the item which should be selected (-1 for none)
[ "set", "the", "selection", "of", "the", "MiniDrawer" ]
f4fb31635767edead0a01cee7b7588942b89d8d9
https://github.com/mikepenz/MaterialDrawer/blob/f4fb31635767edead0a01cee7b7588942b89d8d9/library/src/main/java/com/mikepenz/materialdrawer/MiniDrawer.java#L396-L408
14,930
mikepenz/MaterialDrawer
library/src/main/java/com/mikepenz/materialdrawer/MiniDrawer.java
MiniDrawer.createItems
public void createItems() { mItemAdapter.clear(); int profileOffset = 0; if (mAccountHeader != null && mAccountHeader.getAccountHeaderBuilder().mProfileImagesVisible) { IProfile profile = mAccountHeader.getActiveProfile(); if (profile instanceof IDrawerItem) { ...
java
public void createItems() { mItemAdapter.clear(); int profileOffset = 0; if (mAccountHeader != null && mAccountHeader.getAccountHeaderBuilder().mProfileImagesVisible) { IProfile profile = mAccountHeader.getActiveProfile(); if (profile instanceof IDrawerItem) { ...
[ "public", "void", "createItems", "(", ")", "{", "mItemAdapter", ".", "clear", "(", ")", ";", "int", "profileOffset", "=", "0", ";", "if", "(", "mAccountHeader", "!=", "null", "&&", "mAccountHeader", ".", "getAccountHeaderBuilder", "(", ")", ".", "mProfileIma...
creates the items for the MiniDrawer
[ "creates", "the", "items", "for", "the", "MiniDrawer" ]
f4fb31635767edead0a01cee7b7588942b89d8d9
https://github.com/mikepenz/MaterialDrawer/blob/f4fb31635767edead0a01cee7b7588942b89d8d9/library/src/main/java/com/mikepenz/materialdrawer/MiniDrawer.java#L432-L513
14,931
mikepenz/MaterialDrawer
library/src/main/java/com/mikepenz/materialdrawer/MiniDrawer.java
MiniDrawer.getDrawerItems
private List<IDrawerItem> getDrawerItems() { return mDrawer.getOriginalDrawerItems() != null ? mDrawer.getOriginalDrawerItems() : mDrawer.getDrawerItems(); }
java
private List<IDrawerItem> getDrawerItems() { return mDrawer.getOriginalDrawerItems() != null ? mDrawer.getOriginalDrawerItems() : mDrawer.getDrawerItems(); }
[ "private", "List", "<", "IDrawerItem", ">", "getDrawerItems", "(", ")", "{", "return", "mDrawer", ".", "getOriginalDrawerItems", "(", ")", "!=", "null", "?", "mDrawer", ".", "getOriginalDrawerItems", "(", ")", ":", "mDrawer", ".", "getDrawerItems", "(", ")", ...
returns always the original drawerItems and not the switched content @return
[ "returns", "always", "the", "original", "drawerItems", "and", "not", "the", "switched", "content" ]
f4fb31635767edead0a01cee7b7588942b89d8d9
https://github.com/mikepenz/MaterialDrawer/blob/f4fb31635767edead0a01cee7b7588942b89d8d9/library/src/main/java/com/mikepenz/materialdrawer/MiniDrawer.java#L520-L522
14,932
mikepenz/MaterialDrawer
library/src/main/java/com/mikepenz/materialdrawer/AccountHeaderBuilder.java
AccountHeaderBuilder.setHeaderHeight
private void setHeaderHeight(int height) { if (mAccountHeaderContainer != null) { ViewGroup.LayoutParams params = mAccountHeaderContainer.getLayoutParams(); if (params != null) { params.height = height; mAccountHeaderContainer.setLayoutParams(params); ...
java
private void setHeaderHeight(int height) { if (mAccountHeaderContainer != null) { ViewGroup.LayoutParams params = mAccountHeaderContainer.getLayoutParams(); if (params != null) { params.height = height; mAccountHeaderContainer.setLayoutParams(params); ...
[ "private", "void", "setHeaderHeight", "(", "int", "height", ")", "{", "if", "(", "mAccountHeaderContainer", "!=", "null", ")", "{", "ViewGroup", ".", "LayoutParams", "params", "=", "mAccountHeaderContainer", ".", "getLayoutParams", "(", ")", ";", "if", "(", "p...
helper method to set the height for the header! @param height
[ "helper", "method", "to", "set", "the", "height", "for", "the", "header!" ]
f4fb31635767edead0a01cee7b7588942b89d8d9
https://github.com/mikepenz/MaterialDrawer/blob/f4fb31635767edead0a01cee7b7588942b89d8d9/library/src/main/java/com/mikepenz/materialdrawer/AccountHeaderBuilder.java#L702-L727
14,933
mikepenz/MaterialDrawer
library/src/main/java/com/mikepenz/materialdrawer/AccountHeaderBuilder.java
AccountHeaderBuilder.handleSelectionView
private void handleSelectionView(IProfile profile, boolean on) { if (on) { if (Build.VERSION.SDK_INT >= 23) { mAccountHeaderContainer.setForeground(AppCompatResources.getDrawable(mAccountHeaderContainer.getContext(), mAccountHeaderTextSectionBackgroundResource)); } else {...
java
private void handleSelectionView(IProfile profile, boolean on) { if (on) { if (Build.VERSION.SDK_INT >= 23) { mAccountHeaderContainer.setForeground(AppCompatResources.getDrawable(mAccountHeaderContainer.getContext(), mAccountHeaderTextSectionBackgroundResource)); } else {...
[ "private", "void", "handleSelectionView", "(", "IProfile", "profile", ",", "boolean", "on", ")", "{", "if", "(", "on", ")", "{", "if", "(", "Build", ".", "VERSION", ".", "SDK_INT", ">=", "23", ")", "{", "mAccountHeaderContainer", ".", "setForeground", "(",...
a small helper to handle the selectionView @param on
[ "a", "small", "helper", "to", "handle", "the", "selectionView" ]
f4fb31635767edead0a01cee7b7588942b89d8d9
https://github.com/mikepenz/MaterialDrawer/blob/f4fb31635767edead0a01cee7b7588942b89d8d9/library/src/main/java/com/mikepenz/materialdrawer/AccountHeaderBuilder.java#L734-L751
14,934
mikepenz/MaterialDrawer
library/src/main/java/com/mikepenz/materialdrawer/AccountHeaderBuilder.java
AccountHeaderBuilder.switchProfiles
protected boolean switchProfiles(IProfile newSelection) { if (newSelection == null) { return false; } if (mCurrentProfile == newSelection) { return true; } if (mAlternativeProfileHeaderSwitching) { int prevSelection = -1; if (mProf...
java
protected boolean switchProfiles(IProfile newSelection) { if (newSelection == null) { return false; } if (mCurrentProfile == newSelection) { return true; } if (mAlternativeProfileHeaderSwitching) { int prevSelection = -1; if (mProf...
[ "protected", "boolean", "switchProfiles", "(", "IProfile", "newSelection", ")", "{", "if", "(", "newSelection", "==", "null", ")", "{", "return", "false", ";", "}", "if", "(", "mCurrentProfile", "==", "newSelection", ")", "{", "return", "true", ";", "}", "...
helper method to switch the profiles @param newSelection @return true if the new selection was the current profile
[ "helper", "method", "to", "switch", "the", "profiles" ]
f4fb31635767edead0a01cee7b7588942b89d8d9
https://github.com/mikepenz/MaterialDrawer/blob/f4fb31635767edead0a01cee7b7588942b89d8d9/library/src/main/java/com/mikepenz/materialdrawer/AccountHeaderBuilder.java#L987-L1058
14,935
mikepenz/MaterialDrawer
library/src/main/java/com/mikepenz/materialdrawer/AccountHeaderBuilder.java
AccountHeaderBuilder.setImageOrPlaceholder
private void setImageOrPlaceholder(ImageView iv, ImageHolder imageHolder) { //cancel previous started image loading processes DrawerImageLoader.getInstance().cancelImage(iv); //set the placeholder iv.setImageDrawable(DrawerImageLoader.getInstance().getImageLoader().placeholder(iv.getCont...
java
private void setImageOrPlaceholder(ImageView iv, ImageHolder imageHolder) { //cancel previous started image loading processes DrawerImageLoader.getInstance().cancelImage(iv); //set the placeholder iv.setImageDrawable(DrawerImageLoader.getInstance().getImageLoader().placeholder(iv.getCont...
[ "private", "void", "setImageOrPlaceholder", "(", "ImageView", "iv", ",", "ImageHolder", "imageHolder", ")", "{", "//cancel previous started image loading processes", "DrawerImageLoader", ".", "getInstance", "(", ")", ".", "cancelImage", "(", "iv", ")", ";", "//set the p...
small helper method to set an profile image or a placeholder @param iv @param imageHolder
[ "small", "helper", "method", "to", "set", "an", "profile", "image", "or", "a", "placeholder" ]
f4fb31635767edead0a01cee7b7588942b89d8d9
https://github.com/mikepenz/MaterialDrawer/blob/f4fb31635767edead0a01cee7b7588942b89d8d9/library/src/main/java/com/mikepenz/materialdrawer/AccountHeaderBuilder.java#L1182-L1189
14,936
mikepenz/MaterialDrawer
library/src/main/java/com/mikepenz/materialdrawer/AccountHeaderBuilder.java
AccountHeaderBuilder.onProfileImageClick
private void onProfileImageClick(View v, boolean current) { IProfile profile = (IProfile) v.getTag(R.id.material_drawer_profile_header); boolean consumed = false; if (mOnAccountHeaderProfileImageListener != null) { consumed = mOnAccountHeaderProfileImageListener.onProfileImageClick(...
java
private void onProfileImageClick(View v, boolean current) { IProfile profile = (IProfile) v.getTag(R.id.material_drawer_profile_header); boolean consumed = false; if (mOnAccountHeaderProfileImageListener != null) { consumed = mOnAccountHeaderProfileImageListener.onProfileImageClick(...
[ "private", "void", "onProfileImageClick", "(", "View", "v", ",", "boolean", "current", ")", "{", "IProfile", "profile", "=", "(", "IProfile", ")", "v", ".", "getTag", "(", "R", ".", "id", ".", "material_drawer_profile_header", ")", ";", "boolean", "consumed"...
calls the mOnAccountHEaderProfileImageListener and continues with the actions afterwards @param v @param current
[ "calls", "the", "mOnAccountHEaderProfileImageListener", "and", "continues", "with", "the", "actions", "afterwards" ]
f4fb31635767edead0a01cee7b7588942b89d8d9
https://github.com/mikepenz/MaterialDrawer/blob/f4fb31635767edead0a01cee7b7588942b89d8d9/library/src/main/java/com/mikepenz/materialdrawer/AccountHeaderBuilder.java#L1217-L1229
14,937
mikepenz/MaterialDrawer
library/src/main/java/com/mikepenz/materialdrawer/AccountHeaderBuilder.java
AccountHeaderBuilder.getCurrentSelection
protected int getCurrentSelection() { if (mCurrentProfile != null && mProfiles != null) { int i = 0; for (IProfile profile : mProfiles) { if (profile == mCurrentProfile) { return i; } i++; } } ...
java
protected int getCurrentSelection() { if (mCurrentProfile != null && mProfiles != null) { int i = 0; for (IProfile profile : mProfiles) { if (profile == mCurrentProfile) { return i; } i++; } } ...
[ "protected", "int", "getCurrentSelection", "(", ")", "{", "if", "(", "mCurrentProfile", "!=", "null", "&&", "mProfiles", "!=", "null", ")", "{", "int", "i", "=", "0", ";", "for", "(", "IProfile", "profile", ":", "mProfiles", ")", "{", "if", "(", "profi...
get the current selection @return
[ "get", "the", "current", "selection" ]
f4fb31635767edead0a01cee7b7588942b89d8d9
https://github.com/mikepenz/MaterialDrawer/blob/f4fb31635767edead0a01cee7b7588942b89d8d9/library/src/main/java/com/mikepenz/materialdrawer/AccountHeaderBuilder.java#L1300-L1311
14,938
mikepenz/MaterialDrawer
library/src/main/java/com/mikepenz/materialdrawer/AccountHeaderBuilder.java
AccountHeaderBuilder.toggleSelectionList
protected void toggleSelectionList(Context ctx) { if (mDrawer != null) { //if we already show the list. reset everything instead if (mDrawer.switchedDrawerContent()) { resetDrawerContent(ctx); mSelectionListShown = false; } else { ...
java
protected void toggleSelectionList(Context ctx) { if (mDrawer != null) { //if we already show the list. reset everything instead if (mDrawer.switchedDrawerContent()) { resetDrawerContent(ctx); mSelectionListShown = false; } else { ...
[ "protected", "void", "toggleSelectionList", "(", "Context", "ctx", ")", "{", "if", "(", "mDrawer", "!=", "null", ")", "{", "//if we already show the list. reset everything instead", "if", "(", "mDrawer", ".", "switchedDrawerContent", "(", ")", ")", "{", "resetDrawer...
helper method to toggle the collection @param ctx
[ "helper", "method", "to", "toggle", "the", "collection" ]
f4fb31635767edead0a01cee7b7588942b89d8d9
https://github.com/mikepenz/MaterialDrawer/blob/f4fb31635767edead0a01cee7b7588942b89d8d9/library/src/main/java/com/mikepenz/materialdrawer/AccountHeaderBuilder.java#L1335-L1352
14,939
mikepenz/MaterialDrawer
library/src/main/java/com/mikepenz/materialdrawer/AccountHeaderBuilder.java
AccountHeaderBuilder.buildDrawerSelectionList
protected void buildDrawerSelectionList() { int selectedPosition = -1; int position = 0; ArrayList<IDrawerItem> profileDrawerItems = new ArrayList<>(); if (mProfiles != null) { for (IProfile profile : mProfiles) { if (profile == mCurrentProfile) { ...
java
protected void buildDrawerSelectionList() { int selectedPosition = -1; int position = 0; ArrayList<IDrawerItem> profileDrawerItems = new ArrayList<>(); if (mProfiles != null) { for (IProfile profile : mProfiles) { if (profile == mCurrentProfile) { ...
[ "protected", "void", "buildDrawerSelectionList", "(", ")", "{", "int", "selectedPosition", "=", "-", "1", ";", "int", "position", "=", "0", ";", "ArrayList", "<", "IDrawerItem", ">", "profileDrawerItems", "=", "new", "ArrayList", "<>", "(", ")", ";", "if", ...
helper method to build and set the drawer selection list
[ "helper", "method", "to", "build", "and", "set", "the", "drawer", "selection", "list" ]
f4fb31635767edead0a01cee7b7588942b89d8d9
https://github.com/mikepenz/MaterialDrawer/blob/f4fb31635767edead0a01cee7b7588942b89d8d9/library/src/main/java/com/mikepenz/materialdrawer/AccountHeaderBuilder.java#L1357-L1378
14,940
mikepenz/MaterialDrawer
library/src/main/java/com/mikepenz/materialdrawer/AccountHeaderBuilder.java
AccountHeaderBuilder.resetDrawerContent
private void resetDrawerContent(Context ctx) { if (mDrawer != null) { mDrawer.resetDrawerContent(); } mAccountSwitcherArrow.clearAnimation(); ViewCompat.animate(mAccountSwitcherArrow).rotation(0).start(); //mAccountSwitcherArrow.setImageDrawable(new IconicsDrawable(c...
java
private void resetDrawerContent(Context ctx) { if (mDrawer != null) { mDrawer.resetDrawerContent(); } mAccountSwitcherArrow.clearAnimation(); ViewCompat.animate(mAccountSwitcherArrow).rotation(0).start(); //mAccountSwitcherArrow.setImageDrawable(new IconicsDrawable(c...
[ "private", "void", "resetDrawerContent", "(", "Context", "ctx", ")", "{", "if", "(", "mDrawer", "!=", "null", ")", "{", "mDrawer", ".", "resetDrawerContent", "(", ")", ";", "}", "mAccountSwitcherArrow", ".", "clearAnimation", "(", ")", ";", "ViewCompat", "."...
helper method to reset the drawer content
[ "helper", "method", "to", "reset", "the", "drawer", "content" ]
f4fb31635767edead0a01cee7b7588942b89d8d9
https://github.com/mikepenz/MaterialDrawer/blob/f4fb31635767edead0a01cee7b7588942b89d8d9/library/src/main/java/com/mikepenz/materialdrawer/AccountHeaderBuilder.java#L1452-L1460
14,941
mikepenz/MaterialDrawer
library/src/main/java/com/mikepenz/materialdrawer/Drawer.java
Drawer.isDrawerOpen
public boolean isDrawerOpen() { if (mDrawerBuilder.mDrawerLayout != null && mDrawerBuilder.mSliderLayout != null) { return mDrawerBuilder.mDrawerLayout.isDrawerOpen(mDrawerBuilder.mDrawerGravity); } return false; }
java
public boolean isDrawerOpen() { if (mDrawerBuilder.mDrawerLayout != null && mDrawerBuilder.mSliderLayout != null) { return mDrawerBuilder.mDrawerLayout.isDrawerOpen(mDrawerBuilder.mDrawerGravity); } return false; }
[ "public", "boolean", "isDrawerOpen", "(", ")", "{", "if", "(", "mDrawerBuilder", ".", "mDrawerLayout", "!=", "null", "&&", "mDrawerBuilder", ".", "mSliderLayout", "!=", "null", ")", "{", "return", "mDrawerBuilder", ".", "mDrawerLayout", ".", "isDrawerOpen", "(",...
Get the current state of the drawer. True if the drawer is currently open. @return
[ "Get", "the", "current", "state", "of", "the", "drawer", ".", "True", "if", "the", "drawer", "is", "currently", "open", "." ]
f4fb31635767edead0a01cee7b7588942b89d8d9
https://github.com/mikepenz/MaterialDrawer/blob/f4fb31635767edead0a01cee7b7588942b89d8d9/library/src/main/java/com/mikepenz/materialdrawer/Drawer.java#L153-L158
14,942
mikepenz/MaterialDrawer
library/src/main/java/com/mikepenz/materialdrawer/Drawer.java
Drawer.getMiniDrawer
public MiniDrawer getMiniDrawer() { if (mDrawerBuilder.mMiniDrawer == null) { mDrawerBuilder.mMiniDrawer = new MiniDrawer().withDrawer(this).withAccountHeader(mDrawerBuilder.mAccountHeader); } return mDrawerBuilder.mMiniDrawer; }
java
public MiniDrawer getMiniDrawer() { if (mDrawerBuilder.mMiniDrawer == null) { mDrawerBuilder.mMiniDrawer = new MiniDrawer().withDrawer(this).withAccountHeader(mDrawerBuilder.mAccountHeader); } return mDrawerBuilder.mMiniDrawer; }
[ "public", "MiniDrawer", "getMiniDrawer", "(", ")", "{", "if", "(", "mDrawerBuilder", ".", "mMiniDrawer", "==", "null", ")", "{", "mDrawerBuilder", ".", "mMiniDrawer", "=", "new", "MiniDrawer", "(", ")", ".", "withDrawer", "(", "this", ")", ".", "withAccountH...
gets the already generated MiniDrawer or creates a new one @return
[ "gets", "the", "already", "generated", "MiniDrawer", "or", "creates", "a", "new", "one" ]
f4fb31635767edead0a01cee7b7588942b89d8d9
https://github.com/mikepenz/MaterialDrawer/blob/f4fb31635767edead0a01cee7b7588942b89d8d9/library/src/main/java/com/mikepenz/materialdrawer/Drawer.java#L188-L193
14,943
mikepenz/MaterialDrawer
library/src/main/java/com/mikepenz/materialdrawer/Drawer.java
Drawer.getContent
public FrameLayout getContent() { if (mContentView == null && this.mDrawerBuilder.mDrawerLayout != null) { mContentView = (FrameLayout) this.mDrawerBuilder.mDrawerLayout.findViewById(R.id.content_layout); } return mContentView; }
java
public FrameLayout getContent() { if (mContentView == null && this.mDrawerBuilder.mDrawerLayout != null) { mContentView = (FrameLayout) this.mDrawerBuilder.mDrawerLayout.findViewById(R.id.content_layout); } return mContentView; }
[ "public", "FrameLayout", "getContent", "(", ")", "{", "if", "(", "mContentView", "==", "null", "&&", "this", ".", "mDrawerBuilder", ".", "mDrawerLayout", "!=", "null", ")", "{", "mContentView", "=", "(", "FrameLayout", ")", "this", ".", "mDrawerBuilder", "."...
get the container frameLayout of the current drawer @return
[ "get", "the", "container", "frameLayout", "of", "the", "current", "drawer" ]
f4fb31635767edead0a01cee7b7588942b89d8d9
https://github.com/mikepenz/MaterialDrawer/blob/f4fb31635767edead0a01cee7b7588942b89d8d9/library/src/main/java/com/mikepenz/materialdrawer/Drawer.java#L210-L215
14,944
mikepenz/MaterialDrawer
library/src/main/java/com/mikepenz/materialdrawer/Drawer.java
Drawer.setGravity
public void setGravity(int gravity) { DrawerLayout.LayoutParams params = (DrawerLayout.LayoutParams) getSlider().getLayoutParams(); params.gravity = gravity; getSlider().setLayoutParams(params); mDrawerBuilder.mDrawerGravity = gravity; }
java
public void setGravity(int gravity) { DrawerLayout.LayoutParams params = (DrawerLayout.LayoutParams) getSlider().getLayoutParams(); params.gravity = gravity; getSlider().setLayoutParams(params); mDrawerBuilder.mDrawerGravity = gravity; }
[ "public", "void", "setGravity", "(", "int", "gravity", ")", "{", "DrawerLayout", ".", "LayoutParams", "params", "=", "(", "DrawerLayout", ".", "LayoutParams", ")", "getSlider", "(", ")", ".", "getLayoutParams", "(", ")", ";", "params", ".", "gravity", "=", ...
sets the gravity for this drawer. @param gravity the gravity which is defined for the drawer
[ "sets", "the", "gravity", "for", "this", "drawer", "." ]
f4fb31635767edead0a01cee7b7588942b89d8d9
https://github.com/mikepenz/MaterialDrawer/blob/f4fb31635767edead0a01cee7b7588942b89d8d9/library/src/main/java/com/mikepenz/materialdrawer/Drawer.java#L396-L401
14,945
mikepenz/MaterialDrawer
library/src/main/java/com/mikepenz/materialdrawer/Drawer.java
Drawer.getDrawerItem
public IDrawerItem getDrawerItem(long identifier) { Pair<IDrawerItem, Integer> res = getAdapter().getItemById(identifier); if (res != null) { return res.first; } else { return null; } }
java
public IDrawerItem getDrawerItem(long identifier) { Pair<IDrawerItem, Integer> res = getAdapter().getItemById(identifier); if (res != null) { return res.first; } else { return null; } }
[ "public", "IDrawerItem", "getDrawerItem", "(", "long", "identifier", ")", "{", "Pair", "<", "IDrawerItem", ",", "Integer", ">", "res", "=", "getAdapter", "(", ")", ".", "getItemById", "(", "identifier", ")", ";", "if", "(", "res", "!=", "null", ")", "{",...
returns the DrawerItem by the given identifier @param identifier @return
[ "returns", "the", "DrawerItem", "by", "the", "given", "identifier" ]
f4fb31635767edead0a01cee7b7588942b89d8d9
https://github.com/mikepenz/MaterialDrawer/blob/f4fb31635767edead0a01cee7b7588942b89d8d9/library/src/main/java/com/mikepenz/materialdrawer/Drawer.java#L429-L436
14,946
mikepenz/MaterialDrawer
library/src/main/java/com/mikepenz/materialdrawer/Drawer.java
Drawer.getCurrentSelectedPosition
public int getCurrentSelectedPosition() { return mDrawerBuilder.mAdapter.getSelections().size() == 0 ? -1 : mDrawerBuilder.mAdapter.getSelections().iterator().next(); }
java
public int getCurrentSelectedPosition() { return mDrawerBuilder.mAdapter.getSelections().size() == 0 ? -1 : mDrawerBuilder.mAdapter.getSelections().iterator().next(); }
[ "public", "int", "getCurrentSelectedPosition", "(", ")", "{", "return", "mDrawerBuilder", ".", "mAdapter", ".", "getSelections", "(", ")", ".", "size", "(", ")", "==", "0", "?", "-", "1", ":", "mDrawerBuilder", ".", "mAdapter", ".", "getSelections", "(", "...
get the current position of the selected drawer element @return
[ "get", "the", "current", "position", "of", "the", "selected", "drawer", "element" ]
f4fb31635767edead0a01cee7b7588942b89d8d9
https://github.com/mikepenz/MaterialDrawer/blob/f4fb31635767edead0a01cee7b7588942b89d8d9/library/src/main/java/com/mikepenz/materialdrawer/Drawer.java#L473-L475
14,947
mikepenz/MaterialDrawer
library/src/main/java/com/mikepenz/materialdrawer/Drawer.java
Drawer.getCurrentSelection
public long getCurrentSelection() { IDrawerItem drawerItem = mDrawerBuilder.getDrawerItem(getCurrentSelectedPosition()); if (drawerItem != null) { return drawerItem.getIdentifier(); } return -1; }
java
public long getCurrentSelection() { IDrawerItem drawerItem = mDrawerBuilder.getDrawerItem(getCurrentSelectedPosition()); if (drawerItem != null) { return drawerItem.getIdentifier(); } return -1; }
[ "public", "long", "getCurrentSelection", "(", ")", "{", "IDrawerItem", "drawerItem", "=", "mDrawerBuilder", ".", "getDrawerItem", "(", "getCurrentSelectedPosition", "(", ")", ")", ";", "if", "(", "drawerItem", "!=", "null", ")", "{", "return", "drawerItem", ".",...
get the current selected item identifier @return
[ "get", "the", "current", "selected", "item", "identifier" ]
f4fb31635767edead0a01cee7b7588942b89d8d9
https://github.com/mikepenz/MaterialDrawer/blob/f4fb31635767edead0a01cee7b7588942b89d8d9/library/src/main/java/com/mikepenz/materialdrawer/Drawer.java#L482-L488
14,948
mikepenz/MaterialDrawer
library/src/main/java/com/mikepenz/materialdrawer/Drawer.java
Drawer.updateBadge
public void updateBadge(long identifier, StringHolder badge) { IDrawerItem drawerItem = getDrawerItem(identifier); if (drawerItem instanceof Badgeable) { Badgeable badgeable = (Badgeable) drawerItem; badgeable.withBadge(badge); updateItem((IDrawerItem) badgeable); ...
java
public void updateBadge(long identifier, StringHolder badge) { IDrawerItem drawerItem = getDrawerItem(identifier); if (drawerItem instanceof Badgeable) { Badgeable badgeable = (Badgeable) drawerItem; badgeable.withBadge(badge); updateItem((IDrawerItem) badgeable); ...
[ "public", "void", "updateBadge", "(", "long", "identifier", ",", "StringHolder", "badge", ")", "{", "IDrawerItem", "drawerItem", "=", "getDrawerItem", "(", "identifier", ")", ";", "if", "(", "drawerItem", "instanceof", "Badgeable", ")", "{", "Badgeable", "badgea...
update the badge for a specific drawerItem identified by its id @param identifier @param badge
[ "update", "the", "badge", "for", "a", "specific", "drawerItem", "identified", "by", "its", "id" ]
f4fb31635767edead0a01cee7b7588942b89d8d9
https://github.com/mikepenz/MaterialDrawer/blob/f4fb31635767edead0a01cee7b7588942b89d8d9/library/src/main/java/com/mikepenz/materialdrawer/Drawer.java#L665-L672
14,949
mikepenz/MaterialDrawer
library/src/main/java/com/mikepenz/materialdrawer/Drawer.java
Drawer.removeItemByPosition
public void removeItemByPosition(int position) { if (mDrawerBuilder.checkDrawerItem(position, false)) { mDrawerBuilder.getItemAdapter().remove(position); } }
java
public void removeItemByPosition(int position) { if (mDrawerBuilder.checkDrawerItem(position, false)) { mDrawerBuilder.getItemAdapter().remove(position); } }
[ "public", "void", "removeItemByPosition", "(", "int", "position", ")", "{", "if", "(", "mDrawerBuilder", ".", "checkDrawerItem", "(", "position", ",", "false", ")", ")", "{", "mDrawerBuilder", ".", "getItemAdapter", "(", ")", ".", "remove", "(", "position", ...
Remove a drawerItem at a specific position @param position
[ "Remove", "a", "drawerItem", "at", "a", "specific", "position" ]
f4fb31635767edead0a01cee7b7588942b89d8d9
https://github.com/mikepenz/MaterialDrawer/blob/f4fb31635767edead0a01cee7b7588942b89d8d9/library/src/main/java/com/mikepenz/materialdrawer/Drawer.java#L752-L756
14,950
mikepenz/MaterialDrawer
library/src/main/java/com/mikepenz/materialdrawer/Drawer.java
Drawer.removeStickyFooterItemAtPosition
public void removeStickyFooterItemAtPosition(int position) { if (mDrawerBuilder.mStickyDrawerItems != null && mDrawerBuilder.mStickyDrawerItems.size() > position) { mDrawerBuilder.mStickyDrawerItems.remove(position); } DrawerUtils.rebuildStickyFooterView(mDrawerBuilder); }
java
public void removeStickyFooterItemAtPosition(int position) { if (mDrawerBuilder.mStickyDrawerItems != null && mDrawerBuilder.mStickyDrawerItems.size() > position) { mDrawerBuilder.mStickyDrawerItems.remove(position); } DrawerUtils.rebuildStickyFooterView(mDrawerBuilder); }
[ "public", "void", "removeStickyFooterItemAtPosition", "(", "int", "position", ")", "{", "if", "(", "mDrawerBuilder", ".", "mStickyDrawerItems", "!=", "null", "&&", "mDrawerBuilder", ".", "mStickyDrawerItems", ".", "size", "(", ")", ">", "position", ")", "{", "mD...
Remove a footerDrawerItem at a specific position @param position
[ "Remove", "a", "footerDrawerItem", "at", "a", "specific", "position" ]
f4fb31635767edead0a01cee7b7588942b89d8d9
https://github.com/mikepenz/MaterialDrawer/blob/f4fb31635767edead0a01cee7b7588942b89d8d9/library/src/main/java/com/mikepenz/materialdrawer/Drawer.java#L903-L909
14,951
mikepenz/MaterialDrawer
library/src/main/java/com/mikepenz/materialdrawer/Drawer.java
Drawer.removeAllStickyFooterItems
public void removeAllStickyFooterItems() { if (mDrawerBuilder.mStickyDrawerItems != null) { mDrawerBuilder.mStickyDrawerItems.clear(); } if (mDrawerBuilder.mStickyFooterView != null) { mDrawerBuilder.mStickyFooterView.setVisibility(View.GONE); } }
java
public void removeAllStickyFooterItems() { if (mDrawerBuilder.mStickyDrawerItems != null) { mDrawerBuilder.mStickyDrawerItems.clear(); } if (mDrawerBuilder.mStickyFooterView != null) { mDrawerBuilder.mStickyFooterView.setVisibility(View.GONE); } }
[ "public", "void", "removeAllStickyFooterItems", "(", ")", "{", "if", "(", "mDrawerBuilder", ".", "mStickyDrawerItems", "!=", "null", ")", "{", "mDrawerBuilder", ".", "mStickyDrawerItems", ".", "clear", "(", ")", ";", "}", "if", "(", "mDrawerBuilder", ".", "mSt...
Removes all footerItems from drawer
[ "Removes", "all", "footerItems", "from", "drawer" ]
f4fb31635767edead0a01cee7b7588942b89d8d9
https://github.com/mikepenz/MaterialDrawer/blob/f4fb31635767edead0a01cee7b7588942b89d8d9/library/src/main/java/com/mikepenz/materialdrawer/Drawer.java#L914-L921
14,952
mikepenz/MaterialDrawer
library/src/main/java/com/mikepenz/materialdrawer/Drawer.java
Drawer.resetDrawerContent
public void resetDrawerContent() { if (switchedDrawerContent()) { //set the new items setOnDrawerItemClickListener(originalOnDrawerItemClickListener); setOnDrawerItemLongClickListener(originalOnDrawerItemLongClickListener); setItems(originalDrawerItems, true); ...
java
public void resetDrawerContent() { if (switchedDrawerContent()) { //set the new items setOnDrawerItemClickListener(originalOnDrawerItemClickListener); setOnDrawerItemLongClickListener(originalOnDrawerItemLongClickListener); setItems(originalDrawerItems, true); ...
[ "public", "void", "resetDrawerContent", "(", ")", "{", "if", "(", "switchedDrawerContent", "(", ")", ")", "{", "//set the new items", "setOnDrawerItemClickListener", "(", "originalOnDrawerItemClickListener", ")", ";", "setOnDrawerItemLongClickListener", "(", "originalOnDraw...
helper method to reset to the original drawerContent
[ "helper", "method", "to", "reset", "to", "the", "original", "drawerContent" ]
f4fb31635767edead0a01cee7b7588942b89d8d9
https://github.com/mikepenz/MaterialDrawer/blob/f4fb31635767edead0a01cee7b7588942b89d8d9/library/src/main/java/com/mikepenz/materialdrawer/Drawer.java#L1034-L1063
14,953
mikepenz/MaterialDrawer
library/src/main/java/com/mikepenz/materialdrawer/util/DrawerUIUtils.java
DrawerUIUtils.getTextColorStateList
public static ColorStateList getTextColorStateList(int text_color, int selected_text_color) { return new ColorStateList( new int[][]{ new int[]{android.R.attr.state_selected}, new int[]{} }, new int[]{ ...
java
public static ColorStateList getTextColorStateList(int text_color, int selected_text_color) { return new ColorStateList( new int[][]{ new int[]{android.R.attr.state_selected}, new int[]{} }, new int[]{ ...
[ "public", "static", "ColorStateList", "getTextColorStateList", "(", "int", "text_color", ",", "int", "selected_text_color", ")", "{", "return", "new", "ColorStateList", "(", "new", "int", "[", "]", "[", "]", "{", "new", "int", "[", "]", "{", "android", ".", ...
helper to create a colorStateList for the text @param text_color @param selected_text_color @return
[ "helper", "to", "create", "a", "colorStateList", "for", "the", "text" ]
f4fb31635767edead0a01cee7b7588942b89d8d9
https://github.com/mikepenz/MaterialDrawer/blob/f4fb31635767edead0a01cee7b7588942b89d8d9/library/src/main/java/com/mikepenz/materialdrawer/util/DrawerUIUtils.java#L135-L146
14,954
mikepenz/MaterialDrawer
library/src/main/java/com/mikepenz/materialdrawer/util/DrawerUIUtils.java
DrawerUIUtils.getIconStateList
public static StateListDrawable getIconStateList(Drawable icon, Drawable selectedIcon) { StateListDrawable iconStateListDrawable = new StateListDrawable(); iconStateListDrawable.addState(new int[]{android.R.attr.state_selected}, selectedIcon); iconStateListDrawable.addState(new int[]{}, icon); ...
java
public static StateListDrawable getIconStateList(Drawable icon, Drawable selectedIcon) { StateListDrawable iconStateListDrawable = new StateListDrawable(); iconStateListDrawable.addState(new int[]{android.R.attr.state_selected}, selectedIcon); iconStateListDrawable.addState(new int[]{}, icon); ...
[ "public", "static", "StateListDrawable", "getIconStateList", "(", "Drawable", "icon", ",", "Drawable", "selectedIcon", ")", "{", "StateListDrawable", "iconStateListDrawable", "=", "new", "StateListDrawable", "(", ")", ";", "iconStateListDrawable", ".", "addState", "(", ...
helper to create a stateListDrawable for the icon @param icon @param selectedIcon @return
[ "helper", "to", "create", "a", "stateListDrawable", "for", "the", "icon" ]
f4fb31635767edead0a01cee7b7588942b89d8d9
https://github.com/mikepenz/MaterialDrawer/blob/f4fb31635767edead0a01cee7b7588942b89d8d9/library/src/main/java/com/mikepenz/materialdrawer/util/DrawerUIUtils.java#L155-L160
14,955
mikepenz/MaterialDrawer
library/src/main/java/com/mikepenz/materialdrawer/util/DrawerUIUtils.java
DrawerUIUtils.getDrawerItemBackground
public static StateListDrawable getDrawerItemBackground(int selected_color) { ColorDrawable clrActive = new ColorDrawable(selected_color); StateListDrawable states = new StateListDrawable(); states.addState(new int[]{android.R.attr.state_selected}, clrActive); return states; }
java
public static StateListDrawable getDrawerItemBackground(int selected_color) { ColorDrawable clrActive = new ColorDrawable(selected_color); StateListDrawable states = new StateListDrawable(); states.addState(new int[]{android.R.attr.state_selected}, clrActive); return states; }
[ "public", "static", "StateListDrawable", "getDrawerItemBackground", "(", "int", "selected_color", ")", "{", "ColorDrawable", "clrActive", "=", "new", "ColorDrawable", "(", "selected_color", ")", ";", "StateListDrawable", "states", "=", "new", "StateListDrawable", "(", ...
helper to create a StateListDrawable for the drawer item background @param selected_color @return
[ "helper", "to", "create", "a", "StateListDrawable", "for", "the", "drawer", "item", "background" ]
f4fb31635767edead0a01cee7b7588942b89d8d9
https://github.com/mikepenz/MaterialDrawer/blob/f4fb31635767edead0a01cee7b7588942b89d8d9/library/src/main/java/com/mikepenz/materialdrawer/util/DrawerUIUtils.java#L168-L173
14,956
mikepenz/MaterialDrawer
library/src/main/java/com/mikepenz/materialdrawer/util/DrawerUIUtils.java
DrawerUIUtils.getOptimalDrawerWidth
public static int getOptimalDrawerWidth(Context context) { int possibleMinDrawerWidth = UIUtils.getScreenWidth(context) - UIUtils.getActionBarHeight(context); int maxDrawerWidth = context.getResources().getDimensionPixelSize(R.dimen.material_drawer_width); return Math.min(possibleMinDrawerWidth,...
java
public static int getOptimalDrawerWidth(Context context) { int possibleMinDrawerWidth = UIUtils.getScreenWidth(context) - UIUtils.getActionBarHeight(context); int maxDrawerWidth = context.getResources().getDimensionPixelSize(R.dimen.material_drawer_width); return Math.min(possibleMinDrawerWidth,...
[ "public", "static", "int", "getOptimalDrawerWidth", "(", "Context", "context", ")", "{", "int", "possibleMinDrawerWidth", "=", "UIUtils", ".", "getScreenWidth", "(", "context", ")", "-", "UIUtils", ".", "getActionBarHeight", "(", "context", ")", ";", "int", "max...
helper to calculate the optimal drawer width @param context @return
[ "helper", "to", "calculate", "the", "optimal", "drawer", "width" ]
f4fb31635767edead0a01cee7b7588942b89d8d9
https://github.com/mikepenz/MaterialDrawer/blob/f4fb31635767edead0a01cee7b7588942b89d8d9/library/src/main/java/com/mikepenz/materialdrawer/util/DrawerUIUtils.java#L181-L185
14,957
mikepenz/MaterialDrawer
library/src/main/java/com/mikepenz/materialdrawer/util/DrawerUIUtils.java
DrawerUIUtils.getPlaceHolder
public static Drawable getPlaceHolder(Context ctx) { return new IconicsDrawable(ctx, MaterialDrawerFont.Icon.mdf_person).colorRes(R.color.accent).backgroundColorRes(R.color.primary).sizeDp(56).paddingDp(16); }
java
public static Drawable getPlaceHolder(Context ctx) { return new IconicsDrawable(ctx, MaterialDrawerFont.Icon.mdf_person).colorRes(R.color.accent).backgroundColorRes(R.color.primary).sizeDp(56).paddingDp(16); }
[ "public", "static", "Drawable", "getPlaceHolder", "(", "Context", "ctx", ")", "{", "return", "new", "IconicsDrawable", "(", "ctx", ",", "MaterialDrawerFont", ".", "Icon", ".", "mdf_person", ")", ".", "colorRes", "(", "R", ".", "color", ".", "accent", ")", ...
helper method to get a person placeHolder drawable @param ctx @return
[ "helper", "method", "to", "get", "a", "person", "placeHolder", "drawable" ]
f4fb31635767edead0a01cee7b7588942b89d8d9
https://github.com/mikepenz/MaterialDrawer/blob/f4fb31635767edead0a01cee7b7588942b89d8d9/library/src/main/java/com/mikepenz/materialdrawer/util/DrawerUIUtils.java#L194-L196
14,958
mikepenz/MaterialDrawer
library/src/main/java/com/mikepenz/materialdrawer/util/DrawerUIUtils.java
DrawerUIUtils.setDrawerVerticalPadding
public static void setDrawerVerticalPadding(View v) { int verticalPadding = v.getContext().getResources().getDimensionPixelSize(R.dimen.material_drawer_vertical_padding); v.setPadding(verticalPadding, 0, verticalPadding, 0); }
java
public static void setDrawerVerticalPadding(View v) { int verticalPadding = v.getContext().getResources().getDimensionPixelSize(R.dimen.material_drawer_vertical_padding); v.setPadding(verticalPadding, 0, verticalPadding, 0); }
[ "public", "static", "void", "setDrawerVerticalPadding", "(", "View", "v", ")", "{", "int", "verticalPadding", "=", "v", ".", "getContext", "(", ")", ".", "getResources", "(", ")", ".", "getDimensionPixelSize", "(", "R", ".", "dimen", ".", "material_drawer_vert...
helper to set the vertical padding to the DrawerItems this is required because on API Level 17 the padding is ignored which is set via the XML @param v
[ "helper", "to", "set", "the", "vertical", "padding", "to", "the", "DrawerItems", "this", "is", "required", "because", "on", "API", "Level", "17", "the", "padding", "is", "ignored", "which", "is", "set", "via", "the", "XML" ]
f4fb31635767edead0a01cee7b7588942b89d8d9
https://github.com/mikepenz/MaterialDrawer/blob/f4fb31635767edead0a01cee7b7588942b89d8d9/library/src/main/java/com/mikepenz/materialdrawer/util/DrawerUIUtils.java#L204-L207
14,959
mikepenz/MaterialDrawer
library/src/main/java/com/mikepenz/materialdrawer/util/DrawerUIUtils.java
DrawerUIUtils.setDrawerVerticalPadding
public static void setDrawerVerticalPadding(View v, int level) { int verticalPadding = v.getContext().getResources().getDimensionPixelSize(R.dimen.material_drawer_vertical_padding); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) { v.setPaddingRelative(verticalPadding * lev...
java
public static void setDrawerVerticalPadding(View v, int level) { int verticalPadding = v.getContext().getResources().getDimensionPixelSize(R.dimen.material_drawer_vertical_padding); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) { v.setPaddingRelative(verticalPadding * lev...
[ "public", "static", "void", "setDrawerVerticalPadding", "(", "View", "v", ",", "int", "level", ")", "{", "int", "verticalPadding", "=", "v", ".", "getContext", "(", ")", ".", "getResources", "(", ")", ".", "getDimensionPixelSize", "(", "R", ".", "dimen", "...
helper to set the vertical padding including the extra padding for deeper item hirachy level to the DrawerItems this is required because on API Level 17 the padding is ignored which is set via the XML @param v @param level
[ "helper", "to", "set", "the", "vertical", "padding", "including", "the", "extra", "padding", "for", "deeper", "item", "hirachy", "level", "to", "the", "DrawerItems", "this", "is", "required", "because", "on", "API", "Level", "17", "the", "padding", "is", "ig...
f4fb31635767edead0a01cee7b7588942b89d8d9
https://github.com/mikepenz/MaterialDrawer/blob/f4fb31635767edead0a01cee7b7588942b89d8d9/library/src/main/java/com/mikepenz/materialdrawer/util/DrawerUIUtils.java#L216-L224
14,960
mikepenz/MaterialDrawer
library/src/main/java/com/mikepenz/materialdrawer/util/DrawerUIUtils.java
DrawerUIUtils.isSystemBarOnBottom
public static boolean isSystemBarOnBottom(Context ctx) { WindowManager wm = (WindowManager) ctx.getSystemService(Context.WINDOW_SERVICE); DisplayMetrics metrics = new DisplayMetrics(); wm.getDefaultDisplay().getMetrics(metrics); Configuration cfg = ctx.getResources().getConfiguration(); ...
java
public static boolean isSystemBarOnBottom(Context ctx) { WindowManager wm = (WindowManager) ctx.getSystemService(Context.WINDOW_SERVICE); DisplayMetrics metrics = new DisplayMetrics(); wm.getDefaultDisplay().getMetrics(metrics); Configuration cfg = ctx.getResources().getConfiguration(); ...
[ "public", "static", "boolean", "isSystemBarOnBottom", "(", "Context", "ctx", ")", "{", "WindowManager", "wm", "=", "(", "WindowManager", ")", "ctx", ".", "getSystemService", "(", "Context", ".", "WINDOW_SERVICE", ")", ";", "DisplayMetrics", "metrics", "=", "new"...
helper to check if the system bar is on the bottom of the screen @param ctx @return
[ "helper", "to", "check", "if", "the", "system", "bar", "is", "on", "the", "bottom", "of", "the", "screen" ]
f4fb31635767edead0a01cee7b7588942b89d8d9
https://github.com/mikepenz/MaterialDrawer/blob/f4fb31635767edead0a01cee7b7588942b89d8d9/library/src/main/java/com/mikepenz/materialdrawer/util/DrawerUIUtils.java#L232-L241
14,961
mikepenz/MaterialDrawer
library/src/main/java/com/mikepenz/materialdrawer/model/AbstractDrawerItem.java
AbstractDrawerItem.onPostBindView
public void onPostBindView(IDrawerItem drawerItem, View view) { if (mOnPostBindViewListener != null) { mOnPostBindViewListener.onBindView(drawerItem, view); } }
java
public void onPostBindView(IDrawerItem drawerItem, View view) { if (mOnPostBindViewListener != null) { mOnPostBindViewListener.onBindView(drawerItem, view); } }
[ "public", "void", "onPostBindView", "(", "IDrawerItem", "drawerItem", ",", "View", "view", ")", "{", "if", "(", "mOnPostBindViewListener", "!=", "null", ")", "{", "mOnPostBindViewListener", ".", "onBindView", "(", "drawerItem", ",", "view", ")", ";", "}", "}" ...
is called after bindView to allow some post creation setps @param drawerItem the drawerItem which is bound to the view @param view the currently view which will be bound
[ "is", "called", "after", "bindView", "to", "allow", "some", "post", "creation", "setps" ]
f4fb31635767edead0a01cee7b7588942b89d8d9
https://github.com/mikepenz/MaterialDrawer/blob/f4fb31635767edead0a01cee7b7588942b89d8d9/library/src/main/java/com/mikepenz/materialdrawer/model/AbstractDrawerItem.java#L204-L208
14,962
mikepenz/MaterialDrawer
library/src/main/java/com/mikepenz/materialdrawer/model/AbstractDrawerItem.java
AbstractDrawerItem.getViewHolder
@Override public VH getViewHolder(ViewGroup parent) { return getViewHolder(LayoutInflater.from(parent.getContext()).inflate(getLayoutRes(), parent, false)); }
java
@Override public VH getViewHolder(ViewGroup parent) { return getViewHolder(LayoutInflater.from(parent.getContext()).inflate(getLayoutRes(), parent, false)); }
[ "@", "Override", "public", "VH", "getViewHolder", "(", "ViewGroup", "parent", ")", "{", "return", "getViewHolder", "(", "LayoutInflater", ".", "from", "(", "parent", ".", "getContext", "(", ")", ")", ".", "inflate", "(", "getLayoutRes", "(", ")", ",", "par...
This method returns the ViewHolder for our item, using the provided View. @param parent @return the ViewHolder for this Item
[ "This", "method", "returns", "the", "ViewHolder", "for", "our", "item", "using", "the", "provided", "View", "." ]
f4fb31635767edead0a01cee7b7588942b89d8d9
https://github.com/mikepenz/MaterialDrawer/blob/f4fb31635767edead0a01cee7b7588942b89d8d9/library/src/main/java/com/mikepenz/materialdrawer/model/AbstractDrawerItem.java#L390-L393
14,963
mikepenz/MaterialDrawer
library/src/main/java/com/mikepenz/materialdrawer/model/SecondarySwitchDrawerItem.java
SecondarySwitchDrawerItem.getColor
@Override protected int getColor(Context ctx) { int color; if (this.isEnabled()) { color = ColorHolder.color(getTextColor(), ctx, R.attr.material_drawer_secondary_text, R.color.material_drawer_secondary_text); } else { color = ColorHolder.color(getDisabledTextColor(),...
java
@Override protected int getColor(Context ctx) { int color; if (this.isEnabled()) { color = ColorHolder.color(getTextColor(), ctx, R.attr.material_drawer_secondary_text, R.color.material_drawer_secondary_text); } else { color = ColorHolder.color(getDisabledTextColor(),...
[ "@", "Override", "protected", "int", "getColor", "(", "Context", "ctx", ")", "{", "int", "color", ";", "if", "(", "this", ".", "isEnabled", "(", ")", ")", "{", "color", "=", "ColorHolder", ".", "color", "(", "getTextColor", "(", ")", ",", "ctx", ",",...
helper method to decide for the correct color OVERWRITE to get the correct secondary color @param ctx @return
[ "helper", "method", "to", "decide", "for", "the", "correct", "color", "OVERWRITE", "to", "get", "the", "correct", "secondary", "color" ]
f4fb31635767edead0a01cee7b7588942b89d8d9
https://github.com/mikepenz/MaterialDrawer/blob/f4fb31635767edead0a01cee7b7588942b89d8d9/library/src/main/java/com/mikepenz/materialdrawer/model/SecondarySwitchDrawerItem.java#L32-L41
14,964
mikepenz/MaterialDrawer
library/src/main/java/com/mikepenz/materialdrawer/DrawerUtils.java
DrawerUtils.onFooterDrawerItemClick
public static void onFooterDrawerItemClick(DrawerBuilder drawer, IDrawerItem drawerItem, View v, Boolean fireOnClick) { boolean checkable = !(drawerItem != null && drawerItem instanceof Selectable && !drawerItem.isSelectable()); if (checkable) { drawer.resetStickyFooterSelection(); ...
java
public static void onFooterDrawerItemClick(DrawerBuilder drawer, IDrawerItem drawerItem, View v, Boolean fireOnClick) { boolean checkable = !(drawerItem != null && drawerItem instanceof Selectable && !drawerItem.isSelectable()); if (checkable) { drawer.resetStickyFooterSelection(); ...
[ "public", "static", "void", "onFooterDrawerItemClick", "(", "DrawerBuilder", "drawer", ",", "IDrawerItem", "drawerItem", ",", "View", "v", ",", "Boolean", "fireOnClick", ")", "{", "boolean", "checkable", "=", "!", "(", "drawerItem", "!=", "null", "&&", "drawerIt...
helper method to handle the onClick of the footer @param drawer @param drawerItem @param v @param fireOnClick true if we should call the listener, false if not, null to not call the listener and not close the drawer
[ "helper", "method", "to", "handle", "the", "onClick", "of", "the", "footer" ]
f4fb31635767edead0a01cee7b7588942b89d8d9
https://github.com/mikepenz/MaterialDrawer/blob/f4fb31635767edead0a01cee7b7588942b89d8d9/library/src/main/java/com/mikepenz/materialdrawer/DrawerUtils.java#L34-L76
14,965
mikepenz/MaterialDrawer
library/src/main/java/com/mikepenz/materialdrawer/DrawerUtils.java
DrawerUtils.setStickyFooterSelection
public static void setStickyFooterSelection(DrawerBuilder drawer, int position, Boolean fireOnClick) { if (position > -1) { if (drawer.mStickyFooterView != null && drawer.mStickyFooterView instanceof LinearLayout) { LinearLayout footer = (LinearLayout) drawer.mStickyFooterView; ...
java
public static void setStickyFooterSelection(DrawerBuilder drawer, int position, Boolean fireOnClick) { if (position > -1) { if (drawer.mStickyFooterView != null && drawer.mStickyFooterView instanceof LinearLayout) { LinearLayout footer = (LinearLayout) drawer.mStickyFooterView; ...
[ "public", "static", "void", "setStickyFooterSelection", "(", "DrawerBuilder", "drawer", ",", "int", "position", ",", "Boolean", "fireOnClick", ")", "{", "if", "(", "position", ">", "-", "1", ")", "{", "if", "(", "drawer", ".", "mStickyFooterView", "!=", "nul...
helper method to set the selection of the footer @param drawer @param position @param fireOnClick
[ "helper", "method", "to", "set", "the", "selection", "of", "the", "footer" ]
f4fb31635767edead0a01cee7b7588942b89d8d9
https://github.com/mikepenz/MaterialDrawer/blob/f4fb31635767edead0a01cee7b7588942b89d8d9/library/src/main/java/com/mikepenz/materialdrawer/DrawerUtils.java#L85-L98
14,966
mikepenz/MaterialDrawer
library/src/main/java/com/mikepenz/materialdrawer/DrawerUtils.java
DrawerUtils.getPositionByIdentifier
public static int getPositionByIdentifier(DrawerBuilder drawer, long identifier) { if (identifier != -1) { for (int i = 0; i < drawer.getAdapter().getItemCount(); i++) { if (drawer.getAdapter().getItem(i).getIdentifier() == identifier) { return i; ...
java
public static int getPositionByIdentifier(DrawerBuilder drawer, long identifier) { if (identifier != -1) { for (int i = 0; i < drawer.getAdapter().getItemCount(); i++) { if (drawer.getAdapter().getItem(i).getIdentifier() == identifier) { return i; ...
[ "public", "static", "int", "getPositionByIdentifier", "(", "DrawerBuilder", "drawer", ",", "long", "identifier", ")", "{", "if", "(", "identifier", "!=", "-", "1", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "drawer", ".", "getAdapter", ...
calculates the position of an drawerItem. searching by it's identifier @param identifier @return
[ "calculates", "the", "position", "of", "an", "drawerItem", ".", "searching", "by", "it", "s", "identifier" ]
f4fb31635767edead0a01cee7b7588942b89d8d9
https://github.com/mikepenz/MaterialDrawer/blob/f4fb31635767edead0a01cee7b7588942b89d8d9/library/src/main/java/com/mikepenz/materialdrawer/DrawerUtils.java#L106-L116
14,967
mikepenz/MaterialDrawer
library/src/main/java/com/mikepenz/materialdrawer/DrawerUtils.java
DrawerUtils.getDrawerItem
public static IDrawerItem getDrawerItem(List<IDrawerItem> drawerItems, long identifier) { if (identifier != -1) { for (IDrawerItem drawerItem : drawerItems) { if (drawerItem.getIdentifier() == identifier) { return drawerItem; } } ...
java
public static IDrawerItem getDrawerItem(List<IDrawerItem> drawerItems, long identifier) { if (identifier != -1) { for (IDrawerItem drawerItem : drawerItems) { if (drawerItem.getIdentifier() == identifier) { return drawerItem; } } ...
[ "public", "static", "IDrawerItem", "getDrawerItem", "(", "List", "<", "IDrawerItem", ">", "drawerItems", ",", "long", "identifier", ")", "{", "if", "(", "identifier", "!=", "-", "1", ")", "{", "for", "(", "IDrawerItem", "drawerItem", ":", "drawerItems", ")",...
gets the drawerItem with the specific identifier from a drawerItem list @param drawerItems @param identifier @return
[ "gets", "the", "drawerItem", "with", "the", "specific", "identifier", "from", "a", "drawerItem", "list" ]
f4fb31635767edead0a01cee7b7588942b89d8d9
https://github.com/mikepenz/MaterialDrawer/blob/f4fb31635767edead0a01cee7b7588942b89d8d9/library/src/main/java/com/mikepenz/materialdrawer/DrawerUtils.java#L125-L134
14,968
mikepenz/MaterialDrawer
library/src/main/java/com/mikepenz/materialdrawer/DrawerUtils.java
DrawerUtils.getDrawerItem
public static IDrawerItem getDrawerItem(List<IDrawerItem> drawerItems, Object tag) { if (tag != null) { for (IDrawerItem drawerItem : drawerItems) { if (tag.equals(drawerItem.getTag())) { return drawerItem; } } } return ...
java
public static IDrawerItem getDrawerItem(List<IDrawerItem> drawerItems, Object tag) { if (tag != null) { for (IDrawerItem drawerItem : drawerItems) { if (tag.equals(drawerItem.getTag())) { return drawerItem; } } } return ...
[ "public", "static", "IDrawerItem", "getDrawerItem", "(", "List", "<", "IDrawerItem", ">", "drawerItems", ",", "Object", "tag", ")", "{", "if", "(", "tag", "!=", "null", ")", "{", "for", "(", "IDrawerItem", "drawerItem", ":", "drawerItems", ")", "{", "if", ...
gets the drawerItem by a defined tag from a drawerItem list @param drawerItems @param tag @return
[ "gets", "the", "drawerItem", "by", "a", "defined", "tag", "from", "a", "drawerItem", "list" ]
f4fb31635767edead0a01cee7b7588942b89d8d9
https://github.com/mikepenz/MaterialDrawer/blob/f4fb31635767edead0a01cee7b7588942b89d8d9/library/src/main/java/com/mikepenz/materialdrawer/DrawerUtils.java#L143-L152
14,969
mikepenz/MaterialDrawer
library/src/main/java/com/mikepenz/materialdrawer/DrawerUtils.java
DrawerUtils.getStickyFooterPositionByIdentifier
public static int getStickyFooterPositionByIdentifier(DrawerBuilder drawer, long identifier) { if (identifier != -1) { if (drawer.mStickyFooterView != null && drawer.mStickyFooterView instanceof LinearLayout) { LinearLayout footer = (LinearLayout) drawer.mStickyFooterView; ...
java
public static int getStickyFooterPositionByIdentifier(DrawerBuilder drawer, long identifier) { if (identifier != -1) { if (drawer.mStickyFooterView != null && drawer.mStickyFooterView instanceof LinearLayout) { LinearLayout footer = (LinearLayout) drawer.mStickyFooterView; ...
[ "public", "static", "int", "getStickyFooterPositionByIdentifier", "(", "DrawerBuilder", "drawer", ",", "long", "identifier", ")", "{", "if", "(", "identifier", "!=", "-", "1", ")", "{", "if", "(", "drawer", ".", "mStickyFooterView", "!=", "null", "&&", "drawer...
calculates the position of an drawerItem inside the footer. searching by it's identifier @param identifier @return
[ "calculates", "the", "position", "of", "an", "drawerItem", "inside", "the", "footer", ".", "searching", "by", "it", "s", "identifier" ]
f4fb31635767edead0a01cee7b7588942b89d8d9
https://github.com/mikepenz/MaterialDrawer/blob/f4fb31635767edead0a01cee7b7588942b89d8d9/library/src/main/java/com/mikepenz/materialdrawer/DrawerUtils.java#L160-L182
14,970
mikepenz/MaterialDrawer
library/src/main/java/com/mikepenz/materialdrawer/DrawerUtils.java
DrawerUtils.rebuildStickyFooterView
public static void rebuildStickyFooterView(final DrawerBuilder drawer) { if (drawer.mSliderLayout != null) { if (drawer.mStickyFooterView != null) { drawer.mStickyFooterView.removeAllViews(); //create the divider if (drawer.mStickyFooterDivider) { ...
java
public static void rebuildStickyFooterView(final DrawerBuilder drawer) { if (drawer.mSliderLayout != null) { if (drawer.mStickyFooterView != null) { drawer.mStickyFooterView.removeAllViews(); //create the divider if (drawer.mStickyFooterDivider) { ...
[ "public", "static", "void", "rebuildStickyFooterView", "(", "final", "DrawerBuilder", "drawer", ")", "{", "if", "(", "drawer", ".", "mSliderLayout", "!=", "null", ")", "{", "if", "(", "drawer", ".", "mStickyFooterView", "!=", "null", ")", "{", "drawer", ".",...
small helper to rebuild the FooterView @param drawer
[ "small", "helper", "to", "rebuild", "the", "FooterView" ]
f4fb31635767edead0a01cee7b7588942b89d8d9
https://github.com/mikepenz/MaterialDrawer/blob/f4fb31635767edead0a01cee7b7588942b89d8d9/library/src/main/java/com/mikepenz/materialdrawer/DrawerUtils.java#L257-L290
14,971
mikepenz/MaterialDrawer
library/src/main/java/com/mikepenz/materialdrawer/DrawerUtils.java
DrawerUtils.handleFooterView
public static void handleFooterView(DrawerBuilder drawer, View.OnClickListener onClickListener) { Context ctx = drawer.mSliderLayout.getContext(); //use the StickyDrawerItems if set if (drawer.mStickyDrawerItems != null && drawer.mStickyDrawerItems.size() > 0) { drawer.mStickyFooter...
java
public static void handleFooterView(DrawerBuilder drawer, View.OnClickListener onClickListener) { Context ctx = drawer.mSliderLayout.getContext(); //use the StickyDrawerItems if set if (drawer.mStickyDrawerItems != null && drawer.mStickyDrawerItems.size() > 0) { drawer.mStickyFooter...
[ "public", "static", "void", "handleFooterView", "(", "DrawerBuilder", "drawer", ",", "View", ".", "OnClickListener", "onClickListener", ")", "{", "Context", "ctx", "=", "drawer", ".", "mSliderLayout", ".", "getContext", "(", ")", ";", "//use the StickyDrawerItems if...
helper method to handle the footerView @param drawer
[ "helper", "method", "to", "handle", "the", "footerView" ]
f4fb31635767edead0a01cee7b7588942b89d8d9
https://github.com/mikepenz/MaterialDrawer/blob/f4fb31635767edead0a01cee7b7588942b89d8d9/library/src/main/java/com/mikepenz/materialdrawer/DrawerUtils.java#L297-L349
14,972
mikepenz/MaterialDrawer
library/src/main/java/com/mikepenz/materialdrawer/DrawerUtils.java
DrawerUtils.buildStickyDrawerItemFooter
public static ViewGroup buildStickyDrawerItemFooter(Context ctx, DrawerBuilder drawer, View.OnClickListener onClickListener) { //create the container view final LinearLayout linearLayout = new LinearLayout(ctx); linearLayout.setLayoutParams(new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MA...
java
public static ViewGroup buildStickyDrawerItemFooter(Context ctx, DrawerBuilder drawer, View.OnClickListener onClickListener) { //create the container view final LinearLayout linearLayout = new LinearLayout(ctx); linearLayout.setLayoutParams(new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MA...
[ "public", "static", "ViewGroup", "buildStickyDrawerItemFooter", "(", "Context", "ctx", ",", "DrawerBuilder", "drawer", ",", "View", ".", "OnClickListener", "onClickListener", ")", "{", "//create the container view", "final", "LinearLayout", "linearLayout", "=", "new", "...
build the sticky footer item view @return
[ "build", "the", "sticky", "footer", "item", "view" ]
f4fb31635767edead0a01cee7b7588942b89d8d9
https://github.com/mikepenz/MaterialDrawer/blob/f4fb31635767edead0a01cee7b7588942b89d8d9/library/src/main/java/com/mikepenz/materialdrawer/DrawerUtils.java#L357-L373
14,973
mikepenz/MaterialDrawer
library/src/main/java/com/mikepenz/materialdrawer/DrawerUtils.java
DrawerUtils.addStickyFooterDivider
private static void addStickyFooterDivider(Context ctx, ViewGroup footerView) { LinearLayout divider = new LinearLayout(ctx); LinearLayout.LayoutParams dividerParams = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT); divider.setMinimumHeigh...
java
private static void addStickyFooterDivider(Context ctx, ViewGroup footerView) { LinearLayout divider = new LinearLayout(ctx); LinearLayout.LayoutParams dividerParams = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT); divider.setMinimumHeigh...
[ "private", "static", "void", "addStickyFooterDivider", "(", "Context", "ctx", ",", "ViewGroup", "footerView", ")", "{", "LinearLayout", "divider", "=", "new", "LinearLayout", "(", "ctx", ")", ";", "LinearLayout", ".", "LayoutParams", "dividerParams", "=", "new", ...
adds the shadow to the stickyFooter @param ctx @param footerView
[ "adds", "the", "shadow", "to", "the", "stickyFooter" ]
f4fb31635767edead0a01cee7b7588942b89d8d9
https://github.com/mikepenz/MaterialDrawer/blob/f4fb31635767edead0a01cee7b7588942b89d8d9/library/src/main/java/com/mikepenz/materialdrawer/DrawerUtils.java#L381-L388
14,974
mikepenz/MaterialDrawer
library/src/main/java/com/mikepenz/materialdrawer/DrawerUtils.java
DrawerUtils.fillStickyDrawerItemFooter
public static void fillStickyDrawerItemFooter(DrawerBuilder drawer, ViewGroup container, View.OnClickListener onClickListener) { //add all drawer items for (IDrawerItem drawerItem : drawer.mStickyDrawerItems) { View view = drawerItem.generateView(container.getContext(), container); ...
java
public static void fillStickyDrawerItemFooter(DrawerBuilder drawer, ViewGroup container, View.OnClickListener onClickListener) { //add all drawer items for (IDrawerItem drawerItem : drawer.mStickyDrawerItems) { View view = drawerItem.generateView(container.getContext(), container); ...
[ "public", "static", "void", "fillStickyDrawerItemFooter", "(", "DrawerBuilder", "drawer", ",", "ViewGroup", "container", ",", "View", ".", "OnClickListener", "onClickListener", ")", "{", "//add all drawer items", "for", "(", "IDrawerItem", "drawerItem", ":", "drawer", ...
helper method to fill the sticky footer with it's elements @param drawer @param container @param onClickListener
[ "helper", "method", "to", "fill", "the", "sticky", "footer", "with", "it", "s", "elements" ]
f4fb31635767edead0a01cee7b7588942b89d8d9
https://github.com/mikepenz/MaterialDrawer/blob/f4fb31635767edead0a01cee7b7588942b89d8d9/library/src/main/java/com/mikepenz/materialdrawer/DrawerUtils.java#L397-L415
14,975
mikepenz/MaterialDrawer
library/src/main/java/com/mikepenz/materialdrawer/DrawerUtils.java
DrawerUtils.processDrawerLayoutParams
public static DrawerLayout.LayoutParams processDrawerLayoutParams(DrawerBuilder drawer, DrawerLayout.LayoutParams params) { if (params != null) { if (drawer.mDrawerGravity != null && (drawer.mDrawerGravity == Gravity.RIGHT || drawer.mDrawerGravity == Gravity.END)) { params.rightMargi...
java
public static DrawerLayout.LayoutParams processDrawerLayoutParams(DrawerBuilder drawer, DrawerLayout.LayoutParams params) { if (params != null) { if (drawer.mDrawerGravity != null && (drawer.mDrawerGravity == Gravity.RIGHT || drawer.mDrawerGravity == Gravity.END)) { params.rightMargi...
[ "public", "static", "DrawerLayout", ".", "LayoutParams", "processDrawerLayoutParams", "(", "DrawerBuilder", "drawer", ",", "DrawerLayout", ".", "LayoutParams", "params", ")", "{", "if", "(", "params", "!=", "null", ")", "{", "if", "(", "drawer", ".", "mDrawerGra...
helper to extend the layoutParams of the drawer @param params @return
[ "helper", "to", "extend", "the", "layoutParams", "of", "the", "drawer" ]
f4fb31635767edead0a01cee7b7588942b89d8d9
https://github.com/mikepenz/MaterialDrawer/blob/f4fb31635767edead0a01cee7b7588942b89d8d9/library/src/main/java/com/mikepenz/materialdrawer/DrawerUtils.java#L424-L446
14,976
mikepenz/MaterialDrawer
library/src/main/java/com/mikepenz/materialdrawer/util/KeyboardUtil.java
KeyboardUtil.hideKeyboard
public static void hideKeyboard(Activity act) { if (act != null && act.getCurrentFocus() != null) { InputMethodManager inputMethodManager = (InputMethodManager) act.getSystemService(Activity.INPUT_METHOD_SERVICE); inputMethodManager.hideSoftInputFromWindow(act.getCurrentFocus().getWindow...
java
public static void hideKeyboard(Activity act) { if (act != null && act.getCurrentFocus() != null) { InputMethodManager inputMethodManager = (InputMethodManager) act.getSystemService(Activity.INPUT_METHOD_SERVICE); inputMethodManager.hideSoftInputFromWindow(act.getCurrentFocus().getWindow...
[ "public", "static", "void", "hideKeyboard", "(", "Activity", "act", ")", "{", "if", "(", "act", "!=", "null", "&&", "act", ".", "getCurrentFocus", "(", ")", "!=", "null", ")", "{", "InputMethodManager", "inputMethodManager", "=", "(", "InputMethodManager", "...
Helper to hide the keyboard @param act
[ "Helper", "to", "hide", "the", "keyboard" ]
f4fb31635767edead0a01cee7b7588942b89d8d9
https://github.com/mikepenz/MaterialDrawer/blob/f4fb31635767edead0a01cee7b7588942b89d8d9/library/src/main/java/com/mikepenz/materialdrawer/util/KeyboardUtil.java#L97-L102
14,977
cucumber/cucumber-jvm
core/src/main/java/cucumber/api/cli/Main.java
Main.run
public static byte run(String[] argv, ClassLoader classLoader) { final Runtime runtime = Runtime.builder() .withArgs(argv) .withClassLoader(classLoader) .build(); runtime.run(); return runtime.exitStatus(); }
java
public static byte run(String[] argv, ClassLoader classLoader) { final Runtime runtime = Runtime.builder() .withArgs(argv) .withClassLoader(classLoader) .build(); runtime.run(); return runtime.exitStatus(); }
[ "public", "static", "byte", "run", "(", "String", "[", "]", "argv", ",", "ClassLoader", "classLoader", ")", "{", "final", "Runtime", "runtime", "=", "Runtime", ".", "builder", "(", ")", ".", "withArgs", "(", "argv", ")", ".", "withClassLoader", "(", "cla...
Launches the Cucumber-JVM command line. @param argv runtime options. See details in the {@code cucumber.api.cli.Usage.txt} resource. @param classLoader classloader used to load the runtime @return 0 if execution was successful, 1 if it was not (test failures)
[ "Launches", "the", "Cucumber", "-", "JVM", "command", "line", "." ]
437bb3a1f1d91b56f44059c835765b395eefc777
https://github.com/cucumber/cucumber-jvm/blob/437bb3a1f1d91b56f44059c835765b395eefc777/core/src/main/java/cucumber/api/cli/Main.java#L19-L28
14,978
cucumber/cucumber-jvm
core/src/main/java/cucumber/runtime/formatter/Plugins.java
Plugins.pluginProxy
private <T> T pluginProxy(final Class<T> type) { Object proxy = Proxy.newProxyInstance(classLoader, new Class<?>[]{type}, new InvocationHandler() { @Override public Object invoke(Object target, Method method, Object[] args) throws Throwable { for (Object plugin : getPlugi...
java
private <T> T pluginProxy(final Class<T> type) { Object proxy = Proxy.newProxyInstance(classLoader, new Class<?>[]{type}, new InvocationHandler() { @Override public Object invoke(Object target, Method method, Object[] args) throws Throwable { for (Object plugin : getPlugi...
[ "private", "<", "T", ">", "T", "pluginProxy", "(", "final", "Class", "<", "T", ">", "type", ")", "{", "Object", "proxy", "=", "Proxy", ".", "newProxyInstance", "(", "classLoader", ",", "new", "Class", "<", "?", ">", "[", "]", "{", "type", "}", ",",...
Creates a dynamic proxy that multiplexes method invocations to all plugins of the same type. @param type proxy type @param <T> generic proxy type @return a proxy
[ "Creates", "a", "dynamic", "proxy", "that", "multiplexes", "method", "invocations", "to", "all", "plugins", "of", "the", "same", "type", "." ]
437bb3a1f1d91b56f44059c835765b395eefc777
https://github.com/cucumber/cucumber-jvm/blob/437bb3a1f1d91b56f44059c835765b395eefc777/core/src/main/java/cucumber/runtime/formatter/Plugins.java#L124-L144
14,979
elastic/elasticsearch-hadoop
mr/src/main/java/org/elasticsearch/hadoop/serialization/json/BackportedJsonStringEncoder.java
BackportedJsonStringEncoder.getInstance
public static BackportedJsonStringEncoder getInstance() { SoftReference<BackportedJsonStringEncoder> ref = _threadEncoder.get(); BackportedJsonStringEncoder enc = (ref == null) ? null : ref.get(); if (enc == null) { enc = new BackportedJsonStringEncoder(); _threadEncoder...
java
public static BackportedJsonStringEncoder getInstance() { SoftReference<BackportedJsonStringEncoder> ref = _threadEncoder.get(); BackportedJsonStringEncoder enc = (ref == null) ? null : ref.get(); if (enc == null) { enc = new BackportedJsonStringEncoder(); _threadEncoder...
[ "public", "static", "BackportedJsonStringEncoder", "getInstance", "(", ")", "{", "SoftReference", "<", "BackportedJsonStringEncoder", ">", "ref", "=", "_threadEncoder", ".", "get", "(", ")", ";", "BackportedJsonStringEncoder", "enc", "=", "(", "ref", "==", "null", ...
Factory method for getting an instance; this is either recycled per-thread instance, or a newly constructed one.
[ "Factory", "method", "for", "getting", "an", "instance", ";", "this", "is", "either", "recycled", "per", "-", "thread", "instance", "or", "a", "newly", "constructed", "one", "." ]
f3acaba268ff96efae8eb946088c748c777c22cc
https://github.com/elastic/elasticsearch-hadoop/blob/f3acaba268ff96efae8eb946088c748c777c22cc/mr/src/main/java/org/elasticsearch/hadoop/serialization/json/BackportedJsonStringEncoder.java#L99-L108
14,980
elastic/elasticsearch-hadoop
mr/src/main/java/org/elasticsearch/hadoop/serialization/json/BackportedJsonStringEncoder.java
BackportedJsonStringEncoder.quoteAsString
public char[] quoteAsString(String input) { TextBuffer textBuffer = _textBuffer; if (textBuffer == null) { // no allocator; can add if we must, shouldn't need to _textBuffer = textBuffer = new TextBuffer(null); } char[] outputBuffer = textBuffer.emptyAndGetCurrent...
java
public char[] quoteAsString(String input) { TextBuffer textBuffer = _textBuffer; if (textBuffer == null) { // no allocator; can add if we must, shouldn't need to _textBuffer = textBuffer = new TextBuffer(null); } char[] outputBuffer = textBuffer.emptyAndGetCurrent...
[ "public", "char", "[", "]", "quoteAsString", "(", "String", "input", ")", "{", "TextBuffer", "textBuffer", "=", "_textBuffer", ";", "if", "(", "textBuffer", "==", "null", ")", "{", "// no allocator; can add if we must, shouldn't need to", "_textBuffer", "=", "textBu...
Method that will quote text contents using JSON standard quoting, and return results as a character array
[ "Method", "that", "will", "quote", "text", "contents", "using", "JSON", "standard", "quoting", "and", "return", "results", "as", "a", "character", "array" ]
f3acaba268ff96efae8eb946088c748c777c22cc
https://github.com/elastic/elasticsearch-hadoop/blob/f3acaba268ff96efae8eb946088c748c777c22cc/mr/src/main/java/org/elasticsearch/hadoop/serialization/json/BackportedJsonStringEncoder.java#L115-L164
14,981
elastic/elasticsearch-hadoop
mr/src/main/java/org/elasticsearch/hadoop/rest/commonshttp/auth/bearer/EsApiKeyAuthScheme.java
EsApiKeyAuthScheme.authenticate
private String authenticate(Credentials credentials) throws AuthenticationException { if (!(credentials instanceof EsApiKeyCredentials)) { throw new AuthenticationException("Incorrect credentials type provided. Expected [" + EsApiKeyCredentials.class.getName() + "] but got [" + c...
java
private String authenticate(Credentials credentials) throws AuthenticationException { if (!(credentials instanceof EsApiKeyCredentials)) { throw new AuthenticationException("Incorrect credentials type provided. Expected [" + EsApiKeyCredentials.class.getName() + "] but got [" + c...
[ "private", "String", "authenticate", "(", "Credentials", "credentials", ")", "throws", "AuthenticationException", "{", "if", "(", "!", "(", "credentials", "instanceof", "EsApiKeyCredentials", ")", ")", "{", "throw", "new", "AuthenticationException", "(", "\"Incorrect ...
Implementation method for authentication
[ "Implementation", "method", "for", "authentication" ]
f3acaba268ff96efae8eb946088c748c777c22cc
https://github.com/elastic/elasticsearch-hadoop/blob/f3acaba268ff96efae8eb946088c748c777c22cc/mr/src/main/java/org/elasticsearch/hadoop/rest/commonshttp/auth/bearer/EsApiKeyAuthScheme.java#L73-L91
14,982
elastic/elasticsearch-hadoop
mr/src/main/java/org/elasticsearch/hadoop/rest/pooling/PooledHttpTransportFactory.java
PooledHttpTransportFactory.assertCorrectJobId
private void assertCorrectJobId(Settings settings) { SettingsUtils.ensureJobTransportPoolingKey(settings); String requestingJobKey = SettingsUtils.getJobTransportPoolingKey(settings); if (!jobKey.equals(requestingJobKey)) { throw new EsHadoopIllegalArgumentException("Settings object ...
java
private void assertCorrectJobId(Settings settings) { SettingsUtils.ensureJobTransportPoolingKey(settings); String requestingJobKey = SettingsUtils.getJobTransportPoolingKey(settings); if (!jobKey.equals(requestingJobKey)) { throw new EsHadoopIllegalArgumentException("Settings object ...
[ "private", "void", "assertCorrectJobId", "(", "Settings", "settings", ")", "{", "SettingsUtils", ".", "ensureJobTransportPoolingKey", "(", "settings", ")", ";", "String", "requestingJobKey", "=", "SettingsUtils", ".", "getJobTransportPoolingKey", "(", "settings", ")", ...
Checks to ensure that the caller is using a settings object with the same job id that this pool is responsible for. @param settings To be checked
[ "Checks", "to", "ensure", "that", "the", "caller", "is", "using", "a", "settings", "object", "with", "the", "same", "job", "id", "that", "this", "pool", "is", "responsible", "for", "." ]
f3acaba268ff96efae8eb946088c748c777c22cc
https://github.com/elastic/elasticsearch-hadoop/blob/f3acaba268ff96efae8eb946088c748c777c22cc/mr/src/main/java/org/elasticsearch/hadoop/rest/pooling/PooledHttpTransportFactory.java#L64-L73
14,983
elastic/elasticsearch-hadoop
mr/src/main/java/org/elasticsearch/hadoop/rest/pooling/PooledHttpTransportFactory.java
PooledHttpTransportFactory.getOrCreateTransportPool
private TransportPool getOrCreateTransportPool(String hostInfo, Settings settings, SecureSettings secureSettings) { TransportPool pool; pool = hostPools.get(hostInfo); // Check again in case it was added while waiting for the lock if (pool == null) { pool = new TransportPool(jobKey, ...
java
private TransportPool getOrCreateTransportPool(String hostInfo, Settings settings, SecureSettings secureSettings) { TransportPool pool; pool = hostPools.get(hostInfo); // Check again in case it was added while waiting for the lock if (pool == null) { pool = new TransportPool(jobKey, ...
[ "private", "TransportPool", "getOrCreateTransportPool", "(", "String", "hostInfo", ",", "Settings", "settings", ",", "SecureSettings", "secureSettings", ")", "{", "TransportPool", "pool", ";", "pool", "=", "hostPools", ".", "get", "(", "hostInfo", ")", ";", "// Ch...
Gets the transport pool for the given host info, or creates one if it is absent. @param hostInfo To get a pool for @param settings For creating the pool if it does not exist @param secureSettings For providing secure settings to the connections within the pool once created @return A transport pool for the given host
[ "Gets", "the", "transport", "pool", "for", "the", "given", "host", "info", "or", "creates", "one", "if", "it", "is", "absent", "." ]
f3acaba268ff96efae8eb946088c748c777c22cc
https://github.com/elastic/elasticsearch-hadoop/blob/f3acaba268ff96efae8eb946088c748c777c22cc/mr/src/main/java/org/elasticsearch/hadoop/rest/pooling/PooledHttpTransportFactory.java#L82-L93
14,984
elastic/elasticsearch-hadoop
mr/src/main/java/org/elasticsearch/hadoop/rest/pooling/PooledHttpTransportFactory.java
PooledHttpTransportFactory.borrowFrom
private Transport borrowFrom(TransportPool pool, String hostInfo) { if (!pool.getJobPoolingKey().equals(jobKey)) { throw new EsHadoopIllegalArgumentException("PooledTransportFactory found a pool with a different owner than this job. " + "This could be a different job incorrectly ...
java
private Transport borrowFrom(TransportPool pool, String hostInfo) { if (!pool.getJobPoolingKey().equals(jobKey)) { throw new EsHadoopIllegalArgumentException("PooledTransportFactory found a pool with a different owner than this job. " + "This could be a different job incorrectly ...
[ "private", "Transport", "borrowFrom", "(", "TransportPool", "pool", ",", "String", "hostInfo", ")", "{", "if", "(", "!", "pool", ".", "getJobPoolingKey", "(", ")", ".", "equals", "(", "jobKey", ")", ")", "{", "throw", "new", "EsHadoopIllegalArgumentException",...
Creates a Transport using the given TransportPool. @param pool Transport is borrowed from @param hostInfo For logging purposes @return A Transport backed by a pooled resource
[ "Creates", "a", "Transport", "using", "the", "given", "TransportPool", "." ]
f3acaba268ff96efae8eb946088c748c777c22cc
https://github.com/elastic/elasticsearch-hadoop/blob/f3acaba268ff96efae8eb946088c748c777c22cc/mr/src/main/java/org/elasticsearch/hadoop/rest/pooling/PooledHttpTransportFactory.java#L101-L114
14,985
elastic/elasticsearch-hadoop
mr/src/main/java/org/elasticsearch/hadoop/rest/pooling/PooledHttpTransportFactory.java
PooledHttpTransportFactory.cleanPools
synchronized int cleanPools() { int totalConnectionsRemaining = 0; List<String> hostsToRemove = new ArrayList<String>(); for (Map.Entry<String, TransportPool> hostPool : hostPools.entrySet()) { String host = hostPool.getKey(); TransportPool pool = hostPool.getValue(); ...
java
synchronized int cleanPools() { int totalConnectionsRemaining = 0; List<String> hostsToRemove = new ArrayList<String>(); for (Map.Entry<String, TransportPool> hostPool : hostPools.entrySet()) { String host = hostPool.getKey(); TransportPool pool = hostPool.getValue(); ...
[ "synchronized", "int", "cleanPools", "(", ")", "{", "int", "totalConnectionsRemaining", "=", "0", ";", "List", "<", "String", ">", "hostsToRemove", "=", "new", "ArrayList", "<", "String", ">", "(", ")", ";", "for", "(", "Map", ".", "Entry", "<", "String"...
Iterates over the available host pools and asks each one to purge transports older than a certain age. @return Total number of pooled connections still alive in this factory.
[ "Iterates", "over", "the", "available", "host", "pools", "and", "asks", "each", "one", "to", "purge", "transports", "older", "than", "a", "certain", "age", "." ]
f3acaba268ff96efae8eb946088c748c777c22cc
https://github.com/elastic/elasticsearch-hadoop/blob/f3acaba268ff96efae8eb946088c748c777c22cc/mr/src/main/java/org/elasticsearch/hadoop/rest/pooling/PooledHttpTransportFactory.java#L120-L141
14,986
elastic/elasticsearch-hadoop
mr/src/main/java/org/elasticsearch/hadoop/rest/commonshttp/CommonsHttpTransport.java
CommonsHttpTransport.doExecute
private void doExecute(HttpMethod method) throws IOException { long start = System.currentTimeMillis(); try { client.executeMethod(method); afterExecute(method); } finally { stats.netTotalTime += (System.currentTimeMillis() - start); closeAuthSchem...
java
private void doExecute(HttpMethod method) throws IOException { long start = System.currentTimeMillis(); try { client.executeMethod(method); afterExecute(method); } finally { stats.netTotalTime += (System.currentTimeMillis() - start); closeAuthSchem...
[ "private", "void", "doExecute", "(", "HttpMethod", "method", ")", "throws", "IOException", "{", "long", "start", "=", "System", ".", "currentTimeMillis", "(", ")", ";", "try", "{", "client", ".", "executeMethod", "(", "method", ")", ";", "afterExecute", "(",...
Actually perform the request @param method the HTTP method to perform @throws IOException If there is an issue during the method execution
[ "Actually", "perform", "the", "request" ]
f3acaba268ff96efae8eb946088c748c777c22cc
https://github.com/elastic/elasticsearch-hadoop/blob/f3acaba268ff96efae8eb946088c748c777c22cc/mr/src/main/java/org/elasticsearch/hadoop/rest/commonshttp/CommonsHttpTransport.java#L682-L691
14,987
elastic/elasticsearch-hadoop
mr/src/main/java/org/elasticsearch/hadoop/rest/commonshttp/CommonsHttpTransport.java
CommonsHttpTransport.afterExecute
private void afterExecute(HttpMethod method) throws IOException { AuthState hostAuthState = method.getHostAuthState(); if (hostAuthState.isPreemptive() || hostAuthState.isAuthAttempted()) { AuthScheme authScheme = hostAuthState.getAuthScheme(); if (authScheme instanceof SpnegoAu...
java
private void afterExecute(HttpMethod method) throws IOException { AuthState hostAuthState = method.getHostAuthState(); if (hostAuthState.isPreemptive() || hostAuthState.isAuthAttempted()) { AuthScheme authScheme = hostAuthState.getAuthScheme(); if (authScheme instanceof SpnegoAu...
[ "private", "void", "afterExecute", "(", "HttpMethod", "method", ")", "throws", "IOException", "{", "AuthState", "hostAuthState", "=", "method", ".", "getHostAuthState", "(", ")", ";", "if", "(", "hostAuthState", ".", "isPreemptive", "(", ")", "||", "hostAuthStat...
Close any authentication resources that we may still have open and perform any after-response duties that we need to perform. @param method The method that has been executed @throws IOException If any issues arise during post processing
[ "Close", "any", "authentication", "resources", "that", "we", "may", "still", "have", "open", "and", "perform", "any", "after", "-", "response", "duties", "that", "we", "need", "to", "perform", "." ]
f3acaba268ff96efae8eb946088c748c777c22cc
https://github.com/elastic/elasticsearch-hadoop/blob/f3acaba268ff96efae8eb946088c748c777c22cc/mr/src/main/java/org/elasticsearch/hadoop/rest/commonshttp/CommonsHttpTransport.java#L698-L715
14,988
elastic/elasticsearch-hadoop
mr/src/main/java/org/elasticsearch/hadoop/rest/commonshttp/CommonsHttpTransport.java
CommonsHttpTransport.closeAuthSchemeQuietly
private void closeAuthSchemeQuietly(HttpMethod method) { AuthScheme scheme = method.getHostAuthState().getAuthScheme(); if (scheme instanceof Closeable) { try { ((Closeable) scheme).close(); } catch (IOException e) { log.error("Could not close [" +...
java
private void closeAuthSchemeQuietly(HttpMethod method) { AuthScheme scheme = method.getHostAuthState().getAuthScheme(); if (scheme instanceof Closeable) { try { ((Closeable) scheme).close(); } catch (IOException e) { log.error("Could not close [" +...
[ "private", "void", "closeAuthSchemeQuietly", "(", "HttpMethod", "method", ")", "{", "AuthScheme", "scheme", "=", "method", ".", "getHostAuthState", "(", ")", ".", "getAuthScheme", "(", ")", ";", "if", "(", "scheme", "instanceof", "Closeable", ")", "{", "try", ...
Close the underlying authscheme if it is a Closeable object. @param method Executing method @throws IOException If the scheme could not be closed
[ "Close", "the", "underlying", "authscheme", "if", "it", "is", "a", "Closeable", "object", "." ]
f3acaba268ff96efae8eb946088c748c777c22cc
https://github.com/elastic/elasticsearch-hadoop/blob/f3acaba268ff96efae8eb946088c748c777c22cc/mr/src/main/java/org/elasticsearch/hadoop/rest/commonshttp/CommonsHttpTransport.java#L722-L731
14,989
elastic/elasticsearch-hadoop
mr/src/main/java/org/elasticsearch/hadoop/serialization/dto/mapping/MappingUtils.java
MappingUtils.findTypos
static List[] findTypos(Collection<String> fields, Mapping mapping) { Set<String> keys = mapping.flatten().keySet(); // find missing List<String> missing = new ArrayList<String>(fields.size()); for (String field : fields) { if (!keys.contains(field) && !isBuiltIn(field)) { ...
java
static List[] findTypos(Collection<String> fields, Mapping mapping) { Set<String> keys = mapping.flatten().keySet(); // find missing List<String> missing = new ArrayList<String>(fields.size()); for (String field : fields) { if (!keys.contains(field) && !isBuiltIn(field)) { ...
[ "static", "List", "[", "]", "findTypos", "(", "Collection", "<", "String", ">", "fields", ",", "Mapping", "mapping", ")", "{", "Set", "<", "String", ">", "keys", "=", "mapping", ".", "flatten", "(", ")", ".", "keySet", "(", ")", ";", "// find missing",...
return a tuple for proper messages
[ "return", "a", "tuple", "for", "proper", "messages" ]
f3acaba268ff96efae8eb946088c748c777c22cc
https://github.com/elastic/elasticsearch-hadoop/blob/f3acaba268ff96efae8eb946088c748c777c22cc/mr/src/main/java/org/elasticsearch/hadoop/serialization/dto/mapping/MappingUtils.java#L78-L118
14,990
elastic/elasticsearch-hadoop
mr/src/main/java/org/elasticsearch/hadoop/serialization/dto/mapping/MappingUtils.java
MappingUtils.joinParentField
public static String joinParentField(Settings settings) { if (StringUtils.hasText(settings.getMappingJoin())) { return settings.getMappingJoin().concat(".parent"); } return null; }
java
public static String joinParentField(Settings settings) { if (StringUtils.hasText(settings.getMappingJoin())) { return settings.getMappingJoin().concat(".parent"); } return null; }
[ "public", "static", "String", "joinParentField", "(", "Settings", "settings", ")", "{", "if", "(", "StringUtils", ".", "hasText", "(", "settings", ".", "getMappingJoin", "(", ")", ")", ")", "{", "return", "settings", ".", "getMappingJoin", "(", ")", ".", "...
If "es.mapping.join" is set, this returns the field name for the join field's parent sub-field. @param settings to pull info from @return the parent sub-field to pull routing information from.
[ "If", "es", ".", "mapping", ".", "join", "is", "set", "this", "returns", "the", "field", "name", "for", "the", "join", "field", "s", "parent", "sub", "-", "field", "." ]
f3acaba268ff96efae8eb946088c748c777c22cc
https://github.com/elastic/elasticsearch-hadoop/blob/f3acaba268ff96efae8eb946088c748c777c22cc/mr/src/main/java/org/elasticsearch/hadoop/serialization/dto/mapping/MappingUtils.java#L218-L223
14,991
elastic/elasticsearch-hadoop
mr/src/main/java/org/elasticsearch/hadoop/serialization/json/BackportedObjectReader.java
BackportedObjectReader._findRootDeserializer
protected JsonDeserializer<Object> _findRootDeserializer(DeserializationConfig cfg, JavaType valueType) throws JsonMappingException { // Sanity check: must have actual type... if (valueType == null) { throw new JsonMappingException("No value type configured for ObjectReader"); ...
java
protected JsonDeserializer<Object> _findRootDeserializer(DeserializationConfig cfg, JavaType valueType) throws JsonMappingException { // Sanity check: must have actual type... if (valueType == null) { throw new JsonMappingException("No value type configured for ObjectReader"); ...
[ "protected", "JsonDeserializer", "<", "Object", ">", "_findRootDeserializer", "(", "DeserializationConfig", "cfg", ",", "JavaType", "valueType", ")", "throws", "JsonMappingException", "{", "// Sanity check: must have actual type...", "if", "(", "valueType", "==", "null", ...
Method called to locate deserializer for the passed root-level value.
[ "Method", "called", "to", "locate", "deserializer", "for", "the", "passed", "root", "-", "level", "value", "." ]
f3acaba268ff96efae8eb946088c748c777c22cc
https://github.com/elastic/elasticsearch-hadoop/blob/f3acaba268ff96efae8eb946088c748c777c22cc/mr/src/main/java/org/elasticsearch/hadoop/serialization/json/BackportedObjectReader.java#L161-L185
14,992
elastic/elasticsearch-hadoop
hive/src/main/java/org/elasticsearch/hadoop/hive/HiveUtils.java
HiveUtils.columnToAlias
static Collection<String> columnToAlias(Settings settings) { FieldAlias fa = alias(settings); List<String> columnNames = StringUtils.tokenize(settings.getProperty(HiveConstants.COLUMNS), ","); // eliminate virtual columns // we can't use virtual columns since some distro don't have this...
java
static Collection<String> columnToAlias(Settings settings) { FieldAlias fa = alias(settings); List<String> columnNames = StringUtils.tokenize(settings.getProperty(HiveConstants.COLUMNS), ","); // eliminate virtual columns // we can't use virtual columns since some distro don't have this...
[ "static", "Collection", "<", "String", ">", "columnToAlias", "(", "Settings", "settings", ")", "{", "FieldAlias", "fa", "=", "alias", "(", "settings", ")", ";", "List", "<", "String", ">", "columnNames", "=", "StringUtils", ".", "tokenize", "(", "settings", ...
Renders the full collection of field names needed from ES by combining the names of the hive table fields with the user provided name mappings. @param settings Settings to pull hive column names and user name mappings from. @return A collection of ES field names
[ "Renders", "the", "full", "collection", "of", "field", "names", "needed", "from", "ES", "by", "combining", "the", "names", "of", "the", "hive", "table", "fields", "with", "the", "user", "provided", "name", "mappings", "." ]
f3acaba268ff96efae8eb946088c748c777c22cc
https://github.com/elastic/elasticsearch-hadoop/blob/f3acaba268ff96efae8eb946088c748c777c22cc/hive/src/main/java/org/elasticsearch/hadoop/hive/HiveUtils.java#L84-L102
14,993
elastic/elasticsearch-hadoop
hive/src/main/java/org/elasticsearch/hadoop/hive/HiveUtils.java
HiveUtils.discoverJsonFieldName
static String discoverJsonFieldName(Settings settings, FieldAlias alias) { Set<String> virtualColumnsToBeRemoved = new HashSet<String>(HiveConstants.VIRTUAL_COLUMNS.length); Collections.addAll(virtualColumnsToBeRemoved, HiveConstants.VIRTUAL_COLUMNS); List<String> columnNames = StringUtils.toke...
java
static String discoverJsonFieldName(Settings settings, FieldAlias alias) { Set<String> virtualColumnsToBeRemoved = new HashSet<String>(HiveConstants.VIRTUAL_COLUMNS.length); Collections.addAll(virtualColumnsToBeRemoved, HiveConstants.VIRTUAL_COLUMNS); List<String> columnNames = StringUtils.toke...
[ "static", "String", "discoverJsonFieldName", "(", "Settings", "settings", ",", "FieldAlias", "alias", ")", "{", "Set", "<", "String", ">", "virtualColumnsToBeRemoved", "=", "new", "HashSet", "<", "String", ">", "(", "HiveConstants", ".", "VIRTUAL_COLUMNS", ".", ...
Selects an appropriate field from the given Hive table schema to insert JSON data into if the feature is enabled @param settings Settings to read schema information from @return A FieldAlias object that projects the json source field into the select destination field
[ "Selects", "an", "appropriate", "field", "from", "the", "given", "Hive", "table", "schema", "to", "insert", "JSON", "data", "into", "if", "the", "feature", "is", "enabled" ]
f3acaba268ff96efae8eb946088c748c777c22cc
https://github.com/elastic/elasticsearch-hadoop/blob/f3acaba268ff96efae8eb946088c748c777c22cc/hive/src/main/java/org/elasticsearch/hadoop/hive/HiveUtils.java#L138-L166
14,994
elastic/elasticsearch-hadoop
mr/src/main/java/org/elasticsearch/hadoop/mr/security/TokenUtil.java
TokenUtil.obtainEsToken
private static EsToken obtainEsToken(final RestClient client, User user) { // TODO: Should we extend this to basic authentication at some point? KerberosPrincipal principal = user.getKerberosPrincipal(); if (user.isProxyUser()) { principal = user.getRealUserProvider().getUser().getKe...
java
private static EsToken obtainEsToken(final RestClient client, User user) { // TODO: Should we extend this to basic authentication at some point? KerberosPrincipal principal = user.getKerberosPrincipal(); if (user.isProxyUser()) { principal = user.getRealUserProvider().getUser().getKe...
[ "private", "static", "EsToken", "obtainEsToken", "(", "final", "RestClient", "client", ",", "User", "user", ")", "{", "// TODO: Should we extend this to basic authentication at some point?", "KerberosPrincipal", "principal", "=", "user", ".", "getKerberosPrincipal", "(", ")...
Obtain the given user's authentication token from Elasticsearch by performing the getAuthToken operation as the given user, thus ensuring the subject's private credentials available on the thread's access control context for the life of the operation. @param client The Elasticsearch client @param user the user object t...
[ "Obtain", "the", "given", "user", "s", "authentication", "token", "from", "Elasticsearch", "by", "performing", "the", "getAuthToken", "operation", "as", "the", "given", "user", "thus", "ensuring", "the", "subject", "s", "private", "credentials", "available", "on",...
f3acaba268ff96efae8eb946088c748c777c22cc
https://github.com/elastic/elasticsearch-hadoop/blob/f3acaba268ff96efae8eb946088c748c777c22cc/mr/src/main/java/org/elasticsearch/hadoop/mr/security/TokenUtil.java#L67-L80
14,995
elastic/elasticsearch-hadoop
mr/src/main/java/org/elasticsearch/hadoop/mr/security/TokenUtil.java
TokenUtil.obtainToken
public static Token<EsTokenIdentifier> obtainToken(RestClient client, User user) { EsToken esToken = obtainEsToken(client, user); return EsTokenIdentifier.createTokenFrom(esToken); }
java
public static Token<EsTokenIdentifier> obtainToken(RestClient client, User user) { EsToken esToken = obtainEsToken(client, user); return EsTokenIdentifier.createTokenFrom(esToken); }
[ "public", "static", "Token", "<", "EsTokenIdentifier", ">", "obtainToken", "(", "RestClient", "client", ",", "User", "user", ")", "{", "EsToken", "esToken", "=", "obtainEsToken", "(", "client", ",", "user", ")", ";", "return", "EsTokenIdentifier", ".", "create...
Obtain and return an authentication token for the current user. @param client The Elasticsearch client @return the authentication token instance in Hadoop Token format.
[ "Obtain", "and", "return", "an", "authentication", "token", "for", "the", "current", "user", "." ]
f3acaba268ff96efae8eb946088c748c777c22cc
https://github.com/elastic/elasticsearch-hadoop/blob/f3acaba268ff96efae8eb946088c748c777c22cc/mr/src/main/java/org/elasticsearch/hadoop/mr/security/TokenUtil.java#L87-L90
14,996
elastic/elasticsearch-hadoop
mr/src/main/java/org/elasticsearch/hadoop/mr/security/TokenUtil.java
TokenUtil.obtainAndCache
public static void obtainAndCache(RestClient client, User user) throws IOException { EsToken token = obtainEsToken(client, user); if (token == null) { throw new IOException("No token returned for user " + user.getKerberosPrincipal().getName()); } if (LOG.isDebugEnabled()) { ...
java
public static void obtainAndCache(RestClient client, User user) throws IOException { EsToken token = obtainEsToken(client, user); if (token == null) { throw new IOException("No token returned for user " + user.getKerberosPrincipal().getName()); } if (LOG.isDebugEnabled()) { ...
[ "public", "static", "void", "obtainAndCache", "(", "RestClient", "client", ",", "User", "user", ")", "throws", "IOException", "{", "EsToken", "token", "=", "obtainEsToken", "(", "client", ",", "user", ")", ";", "if", "(", "token", "==", "null", ")", "{", ...
Obtain an authentication token for the given user and add it to the user's credentials. @param client The Elasticsearch client @param user The user for obtaining and storing the token @throws IOException If making a remote call to the authentication service fails
[ "Obtain", "an", "authentication", "token", "for", "the", "given", "user", "and", "add", "it", "to", "the", "user", "s", "credentials", "." ]
f3acaba268ff96efae8eb946088c748c777c22cc
https://github.com/elastic/elasticsearch-hadoop/blob/f3acaba268ff96efae8eb946088c748c777c22cc/mr/src/main/java/org/elasticsearch/hadoop/mr/security/TokenUtil.java#L99-L110
14,997
elastic/elasticsearch-hadoop
mr/src/main/java/org/elasticsearch/hadoop/mr/security/TokenUtil.java
TokenUtil.obtainTokenForJob
public static void obtainTokenForJob(final RestClient client, User user, Job job) { Token<EsTokenIdentifier> token = obtainToken(client, user); if (token == null) { throw new EsHadoopException("No token returned for user " + user.getKerberosPrincipal().getName()); } Text clus...
java
public static void obtainTokenForJob(final RestClient client, User user, Job job) { Token<EsTokenIdentifier> token = obtainToken(client, user); if (token == null) { throw new EsHadoopException("No token returned for user " + user.getKerberosPrincipal().getName()); } Text clus...
[ "public", "static", "void", "obtainTokenForJob", "(", "final", "RestClient", "client", ",", "User", "user", ",", "Job", "job", ")", "{", "Token", "<", "EsTokenIdentifier", ">", "token", "=", "obtainToken", "(", "client", ",", "user", ")", ";", "if", "(", ...
Obtain an authentication token on behalf of the given user and add it to the credentials for the given map reduce job. This version always obtains a fresh authentication token instead of checking for existing ones on the current user. @param client The Elasticsearch client @param user The user for whom to obtain the t...
[ "Obtain", "an", "authentication", "token", "on", "behalf", "of", "the", "given", "user", "and", "add", "it", "to", "the", "credentials", "for", "the", "given", "map", "reduce", "job", ".", "This", "version", "always", "obtains", "a", "fresh", "authentication...
f3acaba268ff96efae8eb946088c748c777c22cc
https://github.com/elastic/elasticsearch-hadoop/blob/f3acaba268ff96efae8eb946088c748c777c22cc/mr/src/main/java/org/elasticsearch/hadoop/mr/security/TokenUtil.java#L122-L133
14,998
elastic/elasticsearch-hadoop
mr/src/main/java/org/elasticsearch/hadoop/mr/security/TokenUtil.java
TokenUtil.addTokenForJob
public static void addTokenForJob(final RestClient client, ClusterName clusterName, User user, Job job) { Token<EsTokenIdentifier> token = getAuthToken(clusterName, user); if (token == null) { token = obtainToken(client, user); } job.getCredentials().addToken(token.getService...
java
public static void addTokenForJob(final RestClient client, ClusterName clusterName, User user, Job job) { Token<EsTokenIdentifier> token = getAuthToken(clusterName, user); if (token == null) { token = obtainToken(client, user); } job.getCredentials().addToken(token.getService...
[ "public", "static", "void", "addTokenForJob", "(", "final", "RestClient", "client", ",", "ClusterName", "clusterName", ",", "User", "user", ",", "Job", "job", ")", "{", "Token", "<", "EsTokenIdentifier", ">", "token", "=", "getAuthToken", "(", "clusterName", "...
Retrieves an authentication token from the given user, obtaining a new token if necessary, and adds it to the credentials for the given map reduce job. @param client The Elasticsearch client @param clusterName the name of the cluster you are connecting to @param user The user for whom to obtain the token @param job Th...
[ "Retrieves", "an", "authentication", "token", "from", "the", "given", "user", "obtaining", "a", "new", "token", "if", "necessary", "and", "adds", "it", "to", "the", "credentials", "for", "the", "given", "map", "reduce", "job", "." ]
f3acaba268ff96efae8eb946088c748c777c22cc
https://github.com/elastic/elasticsearch-hadoop/blob/f3acaba268ff96efae8eb946088c748c777c22cc/mr/src/main/java/org/elasticsearch/hadoop/mr/security/TokenUtil.java#L169-L175
14,999
elastic/elasticsearch-hadoop
mr/src/main/java/org/elasticsearch/hadoop/mr/security/TokenUtil.java
TokenUtil.getAuthToken
private static Token<EsTokenIdentifier> getAuthToken(ClusterName clusterName, User user) { EsToken esToken = getEsAuthToken(clusterName, user); if (esToken == null) { return null; } else { return EsTokenIdentifier.createTokenFrom(esToken); } }
java
private static Token<EsTokenIdentifier> getAuthToken(ClusterName clusterName, User user) { EsToken esToken = getEsAuthToken(clusterName, user); if (esToken == null) { return null; } else { return EsTokenIdentifier.createTokenFrom(esToken); } }
[ "private", "static", "Token", "<", "EsTokenIdentifier", ">", "getAuthToken", "(", "ClusterName", "clusterName", ",", "User", "user", ")", "{", "EsToken", "esToken", "=", "getEsAuthToken", "(", "clusterName", ",", "user", ")", ";", "if", "(", "esToken", "==", ...
Get the authentication token of the user for the provided cluster name in its Hadoop Token form. @return null if the user does not have the token, otherwise the auth token for the cluster.
[ "Get", "the", "authentication", "token", "of", "the", "user", "for", "the", "provided", "cluster", "name", "in", "its", "Hadoop", "Token", "form", "." ]
f3acaba268ff96efae8eb946088c748c777c22cc
https://github.com/elastic/elasticsearch-hadoop/blob/f3acaba268ff96efae8eb946088c748c777c22cc/mr/src/main/java/org/elasticsearch/hadoop/mr/security/TokenUtil.java#L200-L207