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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
113,300 | undera/jmeter-plugins | infra/common/src/main/java/kg/apc/charting/GraphPanelChart.java | GraphPanelChart.paintAd | private void paintAd(Graphics2D g) {
Font oldFont = g.getFont();
g.setFont(g.getFont().deriveFont(10F));
g.setColor(axisColor);
Composite oldComposite = g.getComposite();
g.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.7f));
g.drawString(AD_TEXT,
... | java | private void paintAd(Graphics2D g) {
Font oldFont = g.getFont();
g.setFont(g.getFont().deriveFont(10F));
g.setColor(axisColor);
Composite oldComposite = g.getComposite();
g.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.7f));
g.drawString(AD_TEXT,
... | [
"private",
"void",
"paintAd",
"(",
"Graphics2D",
"g",
")",
"{",
"Font",
"oldFont",
"=",
"g",
".",
"getFont",
"(",
")",
";",
"g",
".",
"setFont",
"(",
"g",
".",
"getFont",
"(",
")",
".",
"deriveFont",
"(",
"10F",
")",
")",
";",
"g",
".",
"setColor... | Paint the add the same color of the axis but with transparency | [
"Paint",
"the",
"add",
"the",
"same",
"color",
"of",
"the",
"axis",
"but",
"with",
"transparency"
] | 416d2a77249ab921c7e4134c3e6a9639901ef7e8 | https://github.com/undera/jmeter-plugins/blob/416d2a77249ab921c7e4134c3e6a9639901ef7e8/infra/common/src/main/java/kg/apc/charting/GraphPanelChart.java#L852-L864 |
113,301 | undera/jmeter-plugins | infra/common/src/main/java/kg/apc/charting/GraphPanelChart.java | GraphPanelChart.registerPopup | private void registerPopup(boolean allowCsvExport) {
this.setComponentPopupMenu(popup);
JMenuItem itemCopy = new JMenuItem("Copy Image to Clipboard");
itemCopy.setIcon(new javax.swing.ImageIcon(getClass().getResource("/kg/apc/jmeter/img/copy.png")));
JMenuItem itemSave = new JMenuItem("S... | java | private void registerPopup(boolean allowCsvExport) {
this.setComponentPopupMenu(popup);
JMenuItem itemCopy = new JMenuItem("Copy Image to Clipboard");
itemCopy.setIcon(new javax.swing.ImageIcon(getClass().getResource("/kg/apc/jmeter/img/copy.png")));
JMenuItem itemSave = new JMenuItem("S... | [
"private",
"void",
"registerPopup",
"(",
"boolean",
"allowCsvExport",
")",
"{",
"this",
".",
"setComponentPopupMenu",
"(",
"popup",
")",
";",
"JMenuItem",
"itemCopy",
"=",
"new",
"JMenuItem",
"(",
"\"Copy Image to Clipboard\"",
")",
";",
"itemCopy",
".",
"setIcon"... | Thanks to stephane.hoblingre | [
"Thanks",
"to",
"stephane",
".",
"hoblingre"
] | 416d2a77249ab921c7e4134c3e6a9639901ef7e8 | https://github.com/undera/jmeter-plugins/blob/416d2a77249ab921c7e4134c3e6a9639901ef7e8/infra/common/src/main/java/kg/apc/charting/GraphPanelChart.java#L906-L923 |
113,302 | undera/jmeter-plugins | infra/common/src/main/java/kg/apc/jmeter/graphs/AbstractGraphPanelVisualizer.java | AbstractGraphPanelVisualizer.stateChanged | @Override
public void stateChanged(ChangeEvent e) {
log.debug("getting new collector");
collector = (CorrectedResultCollector) createTestElement();
if (collector instanceof CorrectedResultCollector) {
setUpFiltering((CorrectedResultCollector) collector);
}
collect... | java | @Override
public void stateChanged(ChangeEvent e) {
log.debug("getting new collector");
collector = (CorrectedResultCollector) createTestElement();
if (collector instanceof CorrectedResultCollector) {
setUpFiltering((CorrectedResultCollector) collector);
}
collect... | [
"@",
"Override",
"public",
"void",
"stateChanged",
"(",
"ChangeEvent",
"e",
")",
"{",
"log",
".",
"debug",
"(",
"\"getting new collector\"",
")",
";",
"collector",
"=",
"(",
"CorrectedResultCollector",
")",
"createTestElement",
"(",
")",
";",
"if",
"(",
"colle... | Invoked when the target of the listener has changed its state. This
implementation assumes that the target is the FilePanel, and will update
the result collector for the new filename.
@param e the event that has occurred | [
"Invoked",
"when",
"the",
"target",
"of",
"the",
"listener",
"has",
"changed",
"its",
"state",
".",
"This",
"implementation",
"assumes",
"that",
"the",
"target",
"is",
"the",
"FilePanel",
"and",
"will",
"update",
"the",
"result",
"collector",
"for",
"the",
"... | 416d2a77249ab921c7e4134c3e6a9639901ef7e8 | https://github.com/undera/jmeter-plugins/blob/416d2a77249ab921c7e4134c3e6a9639901ef7e8/infra/common/src/main/java/kg/apc/jmeter/graphs/AbstractGraphPanelVisualizer.java#L265-L273 |
113,303 | undera/jmeter-plugins | plugins/oauth/src/main/java/com/atlantbh/jmeter/plugins/oauth/Parameter.java | Parameter.setValue | @Override
public String setValue(String value) {
String result = this.value;
this.value = value;
calculateCompareKey();
return result;
} | java | @Override
public String setValue(String value) {
String result = this.value;
this.value = value;
calculateCompareKey();
return result;
} | [
"@",
"Override",
"public",
"String",
"setValue",
"(",
"String",
"value",
")",
"{",
"String",
"result",
"=",
"this",
".",
"value",
";",
"this",
".",
"value",
"=",
"value",
";",
"calculateCompareKey",
"(",
")",
";",
"return",
"result",
";",
"}"
] | Property value setter.
@param value New value for the property | [
"Property",
"value",
"setter",
"."
] | 416d2a77249ab921c7e4134c3e6a9639901ef7e8 | https://github.com/undera/jmeter-plugins/blob/416d2a77249ab921c7e4134c3e6a9639901ef7e8/plugins/oauth/src/main/java/com/atlantbh/jmeter/plugins/oauth/Parameter.java#L71-L77 |
113,304 | undera/jmeter-plugins | plugins/casutg/src/main/java/com/blazemeter/jmeter/threads/AbstractThreadStarter.java | AbstractThreadStarter.cloneTree | protected ListedHashTree cloneTree(ListedHashTree tree) {
TreeCloner cloner = new TreeCloner(true);
tree.traverse(cloner);
ListedHashTree clonedTree = cloner.getClonedTree();
if (!clonedTree.isEmpty()) {
Object firstElement = clonedTree.getArray()[0];
Controller s... | java | protected ListedHashTree cloneTree(ListedHashTree tree) {
TreeCloner cloner = new TreeCloner(true);
tree.traverse(cloner);
ListedHashTree clonedTree = cloner.getClonedTree();
if (!clonedTree.isEmpty()) {
Object firstElement = clonedTree.getArray()[0];
Controller s... | [
"protected",
"ListedHashTree",
"cloneTree",
"(",
"ListedHashTree",
"tree",
")",
"{",
"TreeCloner",
"cloner",
"=",
"new",
"TreeCloner",
"(",
"true",
")",
";",
"tree",
".",
"traverse",
"(",
"cloner",
")",
";",
"ListedHashTree",
"clonedTree",
"=",
"cloner",
".",
... | had to copy it from ThreadGroup | [
"had",
"to",
"copy",
"it",
"from",
"ThreadGroup"
] | 416d2a77249ab921c7e4134c3e6a9639901ef7e8 | https://github.com/undera/jmeter-plugins/blob/416d2a77249ab921c7e4134c3e6a9639901ef7e8/plugins/casutg/src/main/java/com/blazemeter/jmeter/threads/AbstractThreadStarter.java#L75-L88 |
113,305 | undera/jmeter-plugins | infra/common/src/main/java/kg/apc/jmeter/vizualizers/MonitoringResultsCollector.java | MonitoringResultsCollector.syncContext | private void syncContext(boolean isInit)
{
// jmeter context synchronisation
JMeterContext current = JMeterContextService.getContext();
JMeterContext ctx = this.getThreadContext();
if (isInit)
{
current.setCurrentSampler(ctx.getCurrentSampler());
current.setEngine(ctx.getEngine());... | java | private void syncContext(boolean isInit)
{
// jmeter context synchronisation
JMeterContext current = JMeterContextService.getContext();
JMeterContext ctx = this.getThreadContext();
if (isInit)
{
current.setCurrentSampler(ctx.getCurrentSampler());
current.setEngine(ctx.getEngine());... | [
"private",
"void",
"syncContext",
"(",
"boolean",
"isInit",
")",
"{",
"// jmeter context synchronisation\r",
"JMeterContext",
"current",
"=",
"JMeterContextService",
".",
"getContext",
"(",
")",
";",
"JMeterContext",
"ctx",
"=",
"this",
".",
"getThreadContext",
"(",
... | Update the worker thread jmeter context with the main thread one
@param isInit if true the context a full copy is done, if false only update is done | [
"Update",
"the",
"worker",
"thread",
"jmeter",
"context",
"with",
"the",
"main",
"thread",
"one"
] | 416d2a77249ab921c7e4134c3e6a9639901ef7e8 | https://github.com/undera/jmeter-plugins/blob/416d2a77249ab921c7e4134c3e6a9639901ef7e8/infra/common/src/main/java/kg/apc/jmeter/vizualizers/MonitoringResultsCollector.java#L94-L113 |
113,306 | undera/jmeter-plugins | infra/common/src/main/java/kg/apc/jmeter/graphs/GraphPanel.java | GraphPanel.replaceRowTab | public void replaceRowTab(String tabLabel, Component object, String toolTipText) {
int index = indexOfComponent(rowsTab);
remove(index);
ImageIcon rowsIcon = createImageIcon("/kg/apc/jmeter/img/checks.png");
insertTab(tabLabel, rowsIcon, object, toolTipText, index);
} | java | public void replaceRowTab(String tabLabel, Component object, String toolTipText) {
int index = indexOfComponent(rowsTab);
remove(index);
ImageIcon rowsIcon = createImageIcon("/kg/apc/jmeter/img/checks.png");
insertTab(tabLabel, rowsIcon, object, toolTipText, index);
} | [
"public",
"void",
"replaceRowTab",
"(",
"String",
"tabLabel",
",",
"Component",
"object",
",",
"String",
"toolTipText",
")",
"{",
"int",
"index",
"=",
"indexOfComponent",
"(",
"rowsTab",
")",
";",
"remove",
"(",
"index",
")",
";",
"ImageIcon",
"rowsIcon",
"=... | Method used only for change row selector tab in Composite Chart
@param tabLabel the new tab label
@param object the new Panel to add in the tab
@param toolTipText the new tooltip text | [
"Method",
"used",
"only",
"for",
"change",
"row",
"selector",
"tab",
"in",
"Composite",
"Chart"
] | 416d2a77249ab921c7e4134c3e6a9639901ef7e8 | https://github.com/undera/jmeter-plugins/blob/416d2a77249ab921c7e4134c3e6a9639901ef7e8/infra/common/src/main/java/kg/apc/jmeter/graphs/GraphPanel.java#L55-L60 |
113,307 | undera/jmeter-plugins | plugins/casutg/src/main/java/com/blazemeter/jmeter/threads/AbstractDynamicThreadGroup.java | AbstractDynamicThreadGroup.stop | @Override
public void stop() {
running = false;
threadStarter.interrupt();
for (DynamicThread thread : threads) {
thread.interrupt();
thread.interruptOSThread();
}
} | java | @Override
public void stop() {
running = false;
threadStarter.interrupt();
for (DynamicThread thread : threads) {
thread.interrupt();
thread.interruptOSThread();
}
} | [
"@",
"Override",
"public",
"void",
"stop",
"(",
")",
"{",
"running",
"=",
"false",
";",
"threadStarter",
".",
"interrupt",
"(",
")",
";",
"for",
"(",
"DynamicThread",
"thread",
":",
"threads",
")",
"{",
"thread",
".",
"interrupt",
"(",
")",
";",
"threa... | Forceful stop of test calls this | [
"Forceful",
"stop",
"of",
"test",
"calls",
"this"
] | 416d2a77249ab921c7e4134c3e6a9639901ef7e8 | https://github.com/undera/jmeter-plugins/blob/416d2a77249ab921c7e4134c3e6a9639901ef7e8/plugins/casutg/src/main/java/com/blazemeter/jmeter/threads/AbstractDynamicThreadGroup.java#L100-L108 |
113,308 | undera/jmeter-plugins | plugins/casutg/src/main/java/com/blazemeter/jmeter/threads/arrivals/ArrivalsThreadStarter.java | ArrivalsThreadStarter.getCurrentRate | protected double getCurrentRate() {
long rampUp = owner.getRampUpSeconds();
long hold = owner.getHoldSeconds();
long steps = owner.getStepsAsLong();
double throughput = owner.getTargetLevelFactored();
double timeOffset = rollingTime / 1000.0 - startTime;
if (timeOffset >... | java | protected double getCurrentRate() {
long rampUp = owner.getRampUpSeconds();
long hold = owner.getHoldSeconds();
long steps = owner.getStepsAsLong();
double throughput = owner.getTargetLevelFactored();
double timeOffset = rollingTime / 1000.0 - startTime;
if (timeOffset >... | [
"protected",
"double",
"getCurrentRate",
"(",
")",
"{",
"long",
"rampUp",
"=",
"owner",
".",
"getRampUpSeconds",
"(",
")",
";",
"long",
"hold",
"=",
"owner",
".",
"getHoldSeconds",
"(",
")",
";",
"long",
"steps",
"=",
"owner",
".",
"getStepsAsLong",
"(",
... | ported from Taurus PBench module | [
"ported",
"from",
"Taurus",
"PBench",
"module"
] | 416d2a77249ab921c7e4134c3e6a9639901ef7e8 | https://github.com/undera/jmeter-plugins/blob/416d2a77249ab921c7e4134c3e6a9639901ef7e8/plugins/casutg/src/main/java/com/blazemeter/jmeter/threads/arrivals/ArrivalsThreadStarter.java#L68-L89 |
113,309 | undera/jmeter-plugins | infra/common/src/main/java/kg/apc/jmeter/JMeterPluginsUtils.java | JMeterPluginsUtils.buildHelpPageUrl | public static String buildHelpPageUrl(String helpPage) {
try {
if (helpPage.matches("[hH][tT][tT][pP][sS]?://.*")) {
log.debug("Help page URL found, skipping building link to "+WIKI_BASE);
return helpPage;
}
} catch (PatternSyntaxException ex) {
... | java | public static String buildHelpPageUrl(String helpPage) {
try {
if (helpPage.matches("[hH][tT][tT][pP][sS]?://.*")) {
log.debug("Help page URL found, skipping building link to "+WIKI_BASE);
return helpPage;
}
} catch (PatternSyntaxException ex) {
... | [
"public",
"static",
"String",
"buildHelpPageUrl",
"(",
"String",
"helpPage",
")",
"{",
"try",
"{",
"if",
"(",
"helpPage",
".",
"matches",
"(",
"\"[hH][tT][tT][pP][sS]?://.*\"",
")",
")",
"{",
"log",
".",
"debug",
"(",
"\"Help page URL found, skipping building link t... | Builds full URL from wiki page name unless a URL is already passed in.
@param helpPage wiki page name (not full URL) or URL to external wiki
@return full URL to helpPage | [
"Builds",
"full",
"URL",
"from",
"wiki",
"page",
"name",
"unless",
"a",
"URL",
"is",
"already",
"passed",
"in",
"."
] | 416d2a77249ab921c7e4134c3e6a9639901ef7e8 | https://github.com/undera/jmeter-plugins/blob/416d2a77249ab921c7e4134c3e6a9639901ef7e8/infra/common/src/main/java/kg/apc/jmeter/JMeterPluginsUtils.java#L175-L189 |
113,310 | undera/jmeter-plugins | infra/common/src/main/java/kg/apc/jmeter/JMeterPluginsUtils.java | JMeterPluginsUtils.addHelpLinkToPanel | public static Component addHelpLinkToPanel(Container panel, String helpPage) {
if (!java.awt.Desktop.isDesktopSupported()) {
return panel;
}
JLabel icon = new JLabel();
icon.setIcon(new javax.swing.ImageIcon(JMeterPluginsUtils.class.getResource("vizualizers/information.png"))... | java | public static Component addHelpLinkToPanel(Container panel, String helpPage) {
if (!java.awt.Desktop.isDesktopSupported()) {
return panel;
}
JLabel icon = new JLabel();
icon.setIcon(new javax.swing.ImageIcon(JMeterPluginsUtils.class.getResource("vizualizers/information.png"))... | [
"public",
"static",
"Component",
"addHelpLinkToPanel",
"(",
"Container",
"panel",
",",
"String",
"helpPage",
")",
"{",
"if",
"(",
"!",
"java",
".",
"awt",
".",
"Desktop",
".",
"isDesktopSupported",
"(",
")",
")",
"{",
"return",
"panel",
";",
"}",
"JLabel",... | Find in panel appropriate place and put hyperlink there. I know that it
is stupid way. But the result is so good!
@param panel - supposed to be result of makeTitlePanel()
@param helpPage wiki page name, or full URL in case of external wiki
@return original panel
@see AbstractJMeterGuiComponent | [
"Find",
"in",
"panel",
"appropriate",
"place",
"and",
"put",
"hyperlink",
"there",
".",
"I",
"know",
"that",
"it",
"is",
"stupid",
"way",
".",
"But",
"the",
"result",
"is",
"so",
"good!"
] | 416d2a77249ab921c7e4134c3e6a9639901ef7e8 | https://github.com/undera/jmeter-plugins/blob/416d2a77249ab921c7e4134c3e6a9639901ef7e8/infra/common/src/main/java/kg/apc/jmeter/JMeterPluginsUtils.java#L200-L251 |
113,311 | undera/jmeter-plugins | infra/common/src/main/java/kg/apc/jmeter/JMeterPluginsUtils.java | JMeterPluginsUtils.initializeProperties | private static void initializeProperties() {
JMeterUtils.loadJMeterProperties(JMeterUtils.getJMeterHome()
+ File.separator
+ "bin" + File.separator
+ "jmeter.properties");
//JMeterUtils.initLogging();
JMeterUtils.initLocale();
Properties ... | java | private static void initializeProperties() {
JMeterUtils.loadJMeterProperties(JMeterUtils.getJMeterHome()
+ File.separator
+ "bin" + File.separator
+ "jmeter.properties");
//JMeterUtils.initLogging();
JMeterUtils.initLocale();
Properties ... | [
"private",
"static",
"void",
"initializeProperties",
"(",
")",
"{",
"JMeterUtils",
".",
"loadJMeterProperties",
"(",
"JMeterUtils",
".",
"getJMeterHome",
"(",
")",
"+",
"File",
".",
"separator",
"+",
"\"bin\"",
"+",
"File",
".",
"separator",
"+",
"\"jmeter.prope... | Had to copy this method from JMeter class 'cause they provide no ways to
re-use this code
@see org.apache.jmeter.JMeter | [
"Had",
"to",
"copy",
"this",
"method",
"from",
"JMeter",
"class",
"cause",
"they",
"provide",
"no",
"ways",
"to",
"re",
"-",
"use",
"this",
"code"
] | 416d2a77249ab921c7e4134c3e6a9639901ef7e8 | https://github.com/undera/jmeter-plugins/blob/416d2a77249ab921c7e4134c3e6a9639901ef7e8/infra/common/src/main/java/kg/apc/jmeter/JMeterPluginsUtils.java#L470-L531 |
113,312 | undera/jmeter-plugins | plugins/casutg/src/main/java/kg/apc/jmeter/threads/AbstractSimpleThreadGroup.java | AbstractSimpleThreadGroup.scheduleThread | public void scheduleThread(JMeterThread thread) {
if(System.currentTimeMillis()-tgStartTime > TOLERANCE) {
tgStartTime = System.currentTimeMillis();
}
scheduleThread(thread, tgStartTime);
} | java | public void scheduleThread(JMeterThread thread) {
if(System.currentTimeMillis()-tgStartTime > TOLERANCE) {
tgStartTime = System.currentTimeMillis();
}
scheduleThread(thread, tgStartTime);
} | [
"public",
"void",
"scheduleThread",
"(",
"JMeterThread",
"thread",
")",
"{",
"if",
"(",
"System",
".",
"currentTimeMillis",
"(",
")",
"-",
"tgStartTime",
">",
"TOLERANCE",
")",
"{",
"tgStartTime",
"=",
"System",
".",
"currentTimeMillis",
"(",
")",
";",
"}",
... | JMeter 2.7 compatibility | [
"JMeter",
"2",
".",
"7",
"compatibility"
] | 416d2a77249ab921c7e4134c3e6a9639901ef7e8 | https://github.com/undera/jmeter-plugins/blob/416d2a77249ab921c7e4134c3e6a9639901ef7e8/plugins/casutg/src/main/java/kg/apc/jmeter/threads/AbstractSimpleThreadGroup.java#L46-L51 |
113,313 | undera/jmeter-plugins | plugins/casutg/src/main/java/com/blazemeter/jmeter/threads/concurrency/ConcurrencyThreadStarter.java | ConcurrencyThreadStarter.checkNeedsPropertiesReloading | void checkNeedsPropertiesReloading(long now) {
if (CACHING_VALIDITY_MS > 0 && now - lastCachedTime > CACHING_VALIDITY_MS) {
this.rampUp = owner.getRampUpSeconds();
this.hold = owner.getHoldSeconds();
this.steps = owner.getStepsAsLong();
this.maxConcurr = owner.get... | java | void checkNeedsPropertiesReloading(long now) {
if (CACHING_VALIDITY_MS > 0 && now - lastCachedTime > CACHING_VALIDITY_MS) {
this.rampUp = owner.getRampUpSeconds();
this.hold = owner.getHoldSeconds();
this.steps = owner.getStepsAsLong();
this.maxConcurr = owner.get... | [
"void",
"checkNeedsPropertiesReloading",
"(",
"long",
"now",
")",
"{",
"if",
"(",
"CACHING_VALIDITY_MS",
">",
"0",
"&&",
"now",
"-",
"lastCachedTime",
">",
"CACHING_VALIDITY_MS",
")",
"{",
"this",
".",
"rampUp",
"=",
"owner",
".",
"getRampUpSeconds",
"(",
")",... | Check if we need to reload properties
@param now Now as Millis | [
"Check",
"if",
"we",
"need",
"to",
"reload",
"properties"
] | 416d2a77249ab921c7e4134c3e6a9639901ef7e8 | https://github.com/undera/jmeter-plugins/blob/416d2a77249ab921c7e4134c3e6a9639901ef7e8/plugins/casutg/src/main/java/com/blazemeter/jmeter/threads/concurrency/ConcurrencyThreadStarter.java#L94-L103 |
113,314 | undera/jmeter-plugins | plugins/casutg/src/main/java/kg/apc/jmeter/threads/SteppingThreadGroupGui.java | SteppingThreadGroupGui.initGui | private void initGui() {
totalThreads.setText("100");
initialDelay.setText("0");
incUserCount.setText("10");
incUserCountBurst.setText("0");
incUserPeriod.setText("30");
flightTime.setText("60");
decUserCount.setText("5");
decUserPeriod.setText("1");
... | java | private void initGui() {
totalThreads.setText("100");
initialDelay.setText("0");
incUserCount.setText("10");
incUserCountBurst.setText("0");
incUserPeriod.setText("30");
flightTime.setText("60");
decUserCount.setText("5");
decUserPeriod.setText("1");
... | [
"private",
"void",
"initGui",
"(",
")",
"{",
"totalThreads",
".",
"setText",
"(",
"\"100\"",
")",
";",
"initialDelay",
".",
"setText",
"(",
"\"0\"",
")",
";",
"incUserCount",
".",
"setText",
"(",
"\"10\"",
")",
";",
"incUserCountBurst",
".",
"setText",
"("... | Initialise the gui field values | [
"Initialise",
"the",
"gui",
"field",
"values"
] | 416d2a77249ab921c7e4134c3e6a9639901ef7e8 | https://github.com/undera/jmeter-plugins/blob/416d2a77249ab921c7e4134c3e6a9639901ef7e8/plugins/casutg/src/main/java/kg/apc/jmeter/threads/SteppingThreadGroupGui.java#L114-L124 |
113,315 | undera/jmeter-plugins | infra/common/src/main/java/kg/apc/jmeter/gui/ComponentBorder.java | ComponentBorder.paintBorder | @Override
public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) {
float x2 = (width - component.getWidth()) * component.getAlignmentX() + x;
float y2 = (height - component.getHeight()) * component.getAlignmentY() + y;
component.setLocation((int) x2, (int) y2);... | java | @Override
public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) {
float x2 = (width - component.getWidth()) * component.getAlignmentX() + x;
float y2 = (height - component.getHeight()) * component.getAlignmentY() + y;
component.setLocation((int) x2, (int) y2);... | [
"@",
"Override",
"public",
"void",
"paintBorder",
"(",
"Component",
"c",
",",
"Graphics",
"g",
",",
"int",
"x",
",",
"int",
"y",
",",
"int",
"width",
",",
"int",
"height",
")",
"{",
"float",
"x2",
"=",
"(",
"width",
"-",
"component",
".",
"getWidth",... | In this case a real component is to be painted. Setting the location
of the component will cause it to be painted at that location. | [
"In",
"this",
"case",
"a",
"real",
"component",
"is",
"to",
"be",
"painted",
".",
"Setting",
"the",
"location",
"of",
"the",
"component",
"will",
"cause",
"it",
"to",
"be",
"painted",
"at",
"that",
"location",
"."
] | 416d2a77249ab921c7e4134c3e6a9639901ef7e8 | https://github.com/undera/jmeter-plugins/blob/416d2a77249ab921c7e4134c3e6a9639901ef7e8/infra/common/src/main/java/kg/apc/jmeter/gui/ComponentBorder.java#L157-L162 |
113,316 | undera/jmeter-plugins | infra/common/src/main/java/kg/apc/jmeter/gui/ComponentBorder.java | ComponentBorder.determineInsetsAndAlignment | private void determineInsetsAndAlignment() {
borderInsets = new Insets(0, 0, 0, 0);
// The insets will only be updated for the edge the component will be
// diplayed on.
//
// The X, Y alignment of the component is controlled by both the edge
// and alignment paramet... | java | private void determineInsetsAndAlignment() {
borderInsets = new Insets(0, 0, 0, 0);
// The insets will only be updated for the edge the component will be
// diplayed on.
//
// The X, Y alignment of the component is controlled by both the edge
// and alignment paramet... | [
"private",
"void",
"determineInsetsAndAlignment",
"(",
")",
"{",
"borderInsets",
"=",
"new",
"Insets",
"(",
"0",
",",
"0",
",",
"0",
",",
"0",
")",
";",
"// The insets will only be updated for the edge the component will be",
"// diplayed on.",
"//",
"// The X, Y ali... | The insets need to be determined so they are included in the preferred
size of the component the Border is attached to.
The alignment of the component is determined here so it doesn't need
to be recalculated every time the Border is painted. | [
"The",
"insets",
"need",
"to",
"be",
"determined",
"so",
"they",
"are",
"included",
"in",
"the",
"preferred",
"size",
"of",
"the",
"component",
"the",
"Border",
"is",
"attached",
"to",
"."
] | 416d2a77249ab921c7e4134c3e6a9639901ef7e8 | https://github.com/undera/jmeter-plugins/blob/416d2a77249ab921c7e4134c3e6a9639901ef7e8/infra/common/src/main/java/kg/apc/jmeter/gui/ComponentBorder.java#L201-L231 |
113,317 | undera/jmeter-plugins | plugins/casutg/src/main/java/com/blazemeter/jmeter/threads/concurrency/ConcurrencyThreadGroup.java | ConcurrencyThreadGroup.waitThreadStopped | public void waitThreadStopped() { // FIXME: method named in confusing way
long sleepTime = threads.isEmpty() ? DEFAULT_TEMPORISATION : MIN_CHECK_TIME;
lock.lock();
try {
condition.await(sleepTime, TimeUnit.MILLISECONDS); // NOSONAR
} catch (InterruptedException e) {
... | java | public void waitThreadStopped() { // FIXME: method named in confusing way
long sleepTime = threads.isEmpty() ? DEFAULT_TEMPORISATION : MIN_CHECK_TIME;
lock.lock();
try {
condition.await(sleepTime, TimeUnit.MILLISECONDS); // NOSONAR
} catch (InterruptedException e) {
... | [
"public",
"void",
"waitThreadStopped",
"(",
")",
"{",
"// FIXME: method named in confusing way",
"long",
"sleepTime",
"=",
"threads",
".",
"isEmpty",
"(",
")",
"?",
"DEFAULT_TEMPORISATION",
":",
"MIN_CHECK_TIME",
";",
"lock",
".",
"lock",
"(",
")",
";",
"try",
"... | If threads is empty we wait on condition for DEFAULT_TEMPORISATION millis to be notified,
otherwise we wait for 1s | [
"If",
"threads",
"is",
"empty",
"we",
"wait",
"on",
"condition",
"for",
"DEFAULT_TEMPORISATION",
"millis",
"to",
"be",
"notified",
"otherwise",
"we",
"wait",
"for",
"1s"
] | 416d2a77249ab921c7e4134c3e6a9639901ef7e8 | https://github.com/undera/jmeter-plugins/blob/416d2a77249ab921c7e4134c3e6a9639901ef7e8/plugins/casutg/src/main/java/com/blazemeter/jmeter/threads/concurrency/ConcurrencyThreadGroup.java#L37-L48 |
113,318 | undera/jmeter-plugins | plugins/perfmon/src/main/java/kg/apc/jmeter/perfmon/PerfMonCollector.java | PerfMonCollector.generateSample | @Override
public void generateSample(double value, String label) {
PerfMonSampleResult res = new PerfMonSampleResult();
res.setSampleLabel(label);
res.setValue(value);
res.setSuccessful(true);
SampleEvent e = new SampleEvent(res, PERFMON);
super.sampleOccurred(e);
... | java | @Override
public void generateSample(double value, String label) {
PerfMonSampleResult res = new PerfMonSampleResult();
res.setSampleLabel(label);
res.setValue(value);
res.setSuccessful(true);
SampleEvent e = new SampleEvent(res, PERFMON);
super.sampleOccurred(e);
... | [
"@",
"Override",
"public",
"void",
"generateSample",
"(",
"double",
"value",
",",
"String",
"label",
")",
"{",
"PerfMonSampleResult",
"res",
"=",
"new",
"PerfMonSampleResult",
"(",
")",
";",
"res",
".",
"setSampleLabel",
"(",
"label",
")",
";",
"res",
".",
... | need floating point precision for memory and cpu | [
"need",
"floating",
"point",
"precision",
"for",
"memory",
"and",
"cpu"
] | 416d2a77249ab921c7e4134c3e6a9639901ef7e8 | https://github.com/undera/jmeter-plugins/blob/416d2a77249ab921c7e4134c3e6a9639901ef7e8/plugins/perfmon/src/main/java/kg/apc/jmeter/perfmon/PerfMonCollector.java#L298-L306 |
113,319 | undera/jmeter-plugins | plugins/perfmon/src/main/java/kg/apc/jmeter/perfmon/PerfMonCollector.java | PerfMonCollector.generate2Samples | @Override
public void generate2Samples(long[] values, String label1, String label2, double dividingFactor) {
if (oldValues.containsKey(label1) && oldValues.containsKey(label2)) {
generateSample(((double) (values[0] - oldValues.get(label1))) / dividingFactor, label1);
generateSample((... | java | @Override
public void generate2Samples(long[] values, String label1, String label2, double dividingFactor) {
if (oldValues.containsKey(label1) && oldValues.containsKey(label2)) {
generateSample(((double) (values[0] - oldValues.get(label1))) / dividingFactor, label1);
generateSample((... | [
"@",
"Override",
"public",
"void",
"generate2Samples",
"(",
"long",
"[",
"]",
"values",
",",
"String",
"label1",
",",
"String",
"label2",
",",
"double",
"dividingFactor",
")",
"{",
"if",
"(",
"oldValues",
".",
"containsKey",
"(",
"label1",
")",
"&&",
"oldV... | float precision required for net io | [
"float",
"precision",
"required",
"for",
"net",
"io"
] | 416d2a77249ab921c7e4134c3e6a9639901ef7e8 | https://github.com/undera/jmeter-plugins/blob/416d2a77249ab921c7e4134c3e6a9639901ef7e8/plugins/perfmon/src/main/java/kg/apc/jmeter/perfmon/PerfMonCollector.java#L326-L334 |
113,320 | undera/jmeter-plugins | tools/table-server/src/main/java/org/jmeterplugins/protocol/http/control/NanoHTTPD.java | NanoHTTPD.stop | public void stop() {
try {
safeClose(myServerSocket);
closeAllConnections();
myThread.join();
} catch (Exception e) {
e.printStackTrace();
}
} | java | public void stop() {
try {
safeClose(myServerSocket);
closeAllConnections();
myThread.join();
} catch (Exception e) {
e.printStackTrace();
}
} | [
"public",
"void",
"stop",
"(",
")",
"{",
"try",
"{",
"safeClose",
"(",
"myServerSocket",
")",
";",
"closeAllConnections",
"(",
")",
";",
"myThread",
".",
"join",
"(",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"e",
".",
"printStackTrace",... | Stop the server. | [
"Stop",
"the",
"server",
"."
] | 416d2a77249ab921c7e4134c3e6a9639901ef7e8 | https://github.com/undera/jmeter-plugins/blob/416d2a77249ab921c7e4134c3e6a9639901ef7e8/tools/table-server/src/main/java/org/jmeterplugins/protocol/http/control/NanoHTTPD.java#L265-L273 |
113,321 | undera/jmeter-plugins | plugins/ffw/src/main/java/kg/apc/jmeter/reporters/FlexibleFileWriter.java | FlexibleFileWriter.compileColumns | private void compileColumns() {
log.debug("Compiling columns string: " + getColumns());
String[] chunks = JMeterPluginsUtils.replaceRNT(getColumns()).split("\\|");
log.debug("Chunks " + chunks.length);
compiledFields = new int[chunks.length];
compiledVars = new int[chunks.length]... | java | private void compileColumns() {
log.debug("Compiling columns string: " + getColumns());
String[] chunks = JMeterPluginsUtils.replaceRNT(getColumns()).split("\\|");
log.debug("Chunks " + chunks.length);
compiledFields = new int[chunks.length];
compiledVars = new int[chunks.length]... | [
"private",
"void",
"compileColumns",
"(",
")",
"{",
"log",
".",
"debug",
"(",
"\"Compiling columns string: \"",
"+",
"getColumns",
"(",
")",
")",
";",
"String",
"[",
"]",
"chunks",
"=",
"JMeterPluginsUtils",
".",
"replaceRNT",
"(",
"getColumns",
"(",
")",
")... | making this once to be efficient and avoid manipulating strings in switch
operators | [
"making",
"this",
"once",
"to",
"be",
"efficient",
"and",
"avoid",
"manipulating",
"strings",
"in",
"switch",
"operators"
] | 416d2a77249ab921c7e4134c3e6a9639901ef7e8 | https://github.com/undera/jmeter-plugins/blob/416d2a77249ab921c7e4134c3e6a9639901ef7e8/plugins/ffw/src/main/java/kg/apc/jmeter/reporters/FlexibleFileWriter.java#L149-L184 |
113,322 | undera/jmeter-plugins | tools/synthesis/src/main/java/kg/apc/jmeter/vizualizers/SynthesisReportGui.java | SynthesisReportGui.createObjectTableModel | static ObjectTableModel createObjectTableModel() {
return new ObjectTableModel(COLUMNS, SamplingStatCalculator.class,
new Functor[]{
new Functor("getLabel"),
new Functor("getCount"),
new Functor("getMeanAsNumber"),
... | java | static ObjectTableModel createObjectTableModel() {
return new ObjectTableModel(COLUMNS, SamplingStatCalculator.class,
new Functor[]{
new Functor("getLabel"),
new Functor("getCount"),
new Functor("getMeanAsNumber"),
... | [
"static",
"ObjectTableModel",
"createObjectTableModel",
"(",
")",
"{",
"return",
"new",
"ObjectTableModel",
"(",
"COLUMNS",
",",
"SamplingStatCalculator",
".",
"class",
",",
"new",
"Functor",
"[",
"]",
"{",
"new",
"Functor",
"(",
"\"getLabel\"",
")",
",",
"new",... | Creates that Table model
@return ObjectTableModel | [
"Creates",
"that",
"Table",
"model"
] | 416d2a77249ab921c7e4134c3e6a9639901ef7e8 | https://github.com/undera/jmeter-plugins/blob/416d2a77249ab921c7e4134c3e6a9639901ef7e8/tools/synthesis/src/main/java/kg/apc/jmeter/vizualizers/SynthesisReportGui.java#L174-L194 |
113,323 | undera/jmeter-plugins | tools/synthesis/src/main/java/kg/apc/jmeter/vizualizers/SynthesisReportGui.java | SynthesisReportGui.getAllTableData | public static List<List<Object>> getAllTableData(ObjectTableModel model, Format[] formats) {
List<List<Object>> data = new ArrayList<>();
if (model.getRowCount() > 0) {
for (int rw = 0; rw < model.getRowCount(); rw++) {
int cols = model.getColumnCount();
List<... | java | public static List<List<Object>> getAllTableData(ObjectTableModel model, Format[] formats) {
List<List<Object>> data = new ArrayList<>();
if (model.getRowCount() > 0) {
for (int rw = 0; rw < model.getRowCount(); rw++) {
int cols = model.getColumnCount();
List<... | [
"public",
"static",
"List",
"<",
"List",
"<",
"Object",
">",
">",
"getAllTableData",
"(",
"ObjectTableModel",
"model",
",",
"Format",
"[",
"]",
"formats",
")",
"{",
"List",
"<",
"List",
"<",
"Object",
">>",
"data",
"=",
"new",
"ArrayList",
"<>",
"(",
"... | We use this method to get the data, since we are using
ObjectTableModel, so the calling getDataVector doesn't
work as expected.
@param model {@link ObjectTableModel}
@param formats Array of {@link Format} array can contain null formatters in this case value is added as is
@return the data from the model | [
"We",
"use",
"this",
"method",
"to",
"get",
"the",
"data",
"since",
"we",
"are",
"using",
"ObjectTableModel",
"so",
"the",
"calling",
"getDataVector",
"doesn",
"t",
"work",
"as",
"expected",
"."
] | 416d2a77249ab921c7e4134c3e6a9639901ef7e8 | https://github.com/undera/jmeter-plugins/blob/416d2a77249ab921c7e4134c3e6a9639901ef7e8/tools/synthesis/src/main/java/kg/apc/jmeter/vizualizers/SynthesisReportGui.java#L418-L436 |
113,324 | undera/jmeter-plugins | tools/synthesis/src/main/java/kg/apc/jmeter/vizualizers/SynthesisReportGui.java | SynthesisReportGui.getAllDataAsTable | public static DefaultTableModel getAllDataAsTable(ObjectTableModel model, Format[] formats, String[] columns) {
final List<List<Object>> table = getAllTableData(model, formats);
final DefaultTableModel tableModel = new DefaultTableModel();
for (String header : columns) {
tableModel... | java | public static DefaultTableModel getAllDataAsTable(ObjectTableModel model, Format[] formats, String[] columns) {
final List<List<Object>> table = getAllTableData(model, formats);
final DefaultTableModel tableModel = new DefaultTableModel();
for (String header : columns) {
tableModel... | [
"public",
"static",
"DefaultTableModel",
"getAllDataAsTable",
"(",
"ObjectTableModel",
"model",
",",
"Format",
"[",
"]",
"formats",
",",
"String",
"[",
"]",
"columns",
")",
"{",
"final",
"List",
"<",
"List",
"<",
"Object",
">",
">",
"table",
"=",
"getAllTabl... | Present data in javax.swing.table.DefaultTableModel form.
@param model {@link ObjectTableModel}
@param formats Array of {@link Format} array can contain null formatters in this case value is added as is
@param columns Columns headers
@return data in table form | [
"Present",
"data",
"in",
"javax",
".",
"swing",
".",
"table",
".",
"DefaultTableModel",
"form",
"."
] | 416d2a77249ab921c7e4134c3e6a9639901ef7e8 | https://github.com/undera/jmeter-plugins/blob/416d2a77249ab921c7e4134c3e6a9639901ef7e8/tools/synthesis/src/main/java/kg/apc/jmeter/vizualizers/SynthesisReportGui.java#L467-L481 |
113,325 | undera/jmeter-plugins | plugins/tst/src/main/java/kg/apc/jmeter/timers/VariableThroughputTimer.java | VariableThroughputTimer.delay | public synchronized long delay() {
while (true) {
long curTimeMs = System.currentTimeMillis();
long millisSinceLastSecond = curTimeMs % 1000;
long nowInMsRoundedAtSec = curTimeMs - millisSinceLastSecond;
checkNextSecond(nowInMsRoundedAtSec);
int delayM... | java | public synchronized long delay() {
while (true) {
long curTimeMs = System.currentTimeMillis();
long millisSinceLastSecond = curTimeMs % 1000;
long nowInMsRoundedAtSec = curTimeMs - millisSinceLastSecond;
checkNextSecond(nowInMsRoundedAtSec);
int delayM... | [
"public",
"synchronized",
"long",
"delay",
"(",
")",
"{",
"while",
"(",
"true",
")",
"{",
"long",
"curTimeMs",
"=",
"System",
".",
"currentTimeMillis",
"(",
")",
";",
"long",
"millisSinceLastSecond",
"=",
"curTimeMs",
"%",
"1000",
";",
"long",
"nowInMsRounde... | Internally handles that delay for caller thread
@return 0 | [
"Internally",
"handles",
"that",
"delay",
"for",
"caller",
"thread"
] | 416d2a77249ab921c7e4134c3e6a9639901ef7e8 | https://github.com/undera/jmeter-plugins/blob/416d2a77249ab921c7e4134c3e6a9639901ef7e8/plugins/tst/src/main/java/kg/apc/jmeter/timers/VariableThroughputTimer.java#L79-L107 |
113,326 | undera/jmeter-plugins | plugins/functions/src/main/java/kg/apc/jmeter/functions/CaseFormat.java | CaseFormat.changeCase | protected String changeCase(String originalString, String mode) {
String targetString = originalString;
// mode is case insensitive, allow upper for example
CaseFormatMode changeCaseMode = CaseFormatMode.get(mode.toUpperCase());
if (changeCaseMode != null) {
switch (changeCaseMode) {
case LOWER_CAMEL_CASE... | java | protected String changeCase(String originalString, String mode) {
String targetString = originalString;
// mode is case insensitive, allow upper for example
CaseFormatMode changeCaseMode = CaseFormatMode.get(mode.toUpperCase());
if (changeCaseMode != null) {
switch (changeCaseMode) {
case LOWER_CAMEL_CASE... | [
"protected",
"String",
"changeCase",
"(",
"String",
"originalString",
",",
"String",
"mode",
")",
"{",
"String",
"targetString",
"=",
"originalString",
";",
"// mode is case insensitive, allow upper for example",
"CaseFormatMode",
"changeCaseMode",
"=",
"CaseFormatMode",
".... | Change case options
@param originalString
@param mode
@return string after change case | [
"Change",
"case",
"options"
] | 416d2a77249ab921c7e4134c3e6a9639901ef7e8 | https://github.com/undera/jmeter-plugins/blob/416d2a77249ab921c7e4134c3e6a9639901ef7e8/plugins/functions/src/main/java/kg/apc/jmeter/functions/CaseFormat.java#L95-L130 |
113,327 | undera/jmeter-plugins | plugins/functions/src/main/java/kg/apc/jmeter/functions/CaseFormat.java | CaseFormat.camelFormat | private static String camelFormat(String str, boolean isFirstCapitalized) {
StringBuilder builder = new StringBuilder(str.length());
String[] tokens = NOT_ALPHANUMERIC_REGEX.split(str);
for (int i = 0; i < tokens.length; i++) {
String lowerCased = StringUtils.lowerCase(tokens[i]);
if (i == 0) {
builder.... | java | private static String camelFormat(String str, boolean isFirstCapitalized) {
StringBuilder builder = new StringBuilder(str.length());
String[] tokens = NOT_ALPHANUMERIC_REGEX.split(str);
for (int i = 0; i < tokens.length; i++) {
String lowerCased = StringUtils.lowerCase(tokens[i]);
if (i == 0) {
builder.... | [
"private",
"static",
"String",
"camelFormat",
"(",
"String",
"str",
",",
"boolean",
"isFirstCapitalized",
")",
"{",
"StringBuilder",
"builder",
"=",
"new",
"StringBuilder",
"(",
"str",
".",
"length",
"(",
")",
")",
";",
"String",
"[",
"]",
"tokens",
"=",
"... | Camel format string
@param str
@param isFirstCapitalized
@return String in camelFormat | [
"Camel",
"format",
"string"
] | 416d2a77249ab921c7e4134c3e6a9639901ef7e8 | https://github.com/undera/jmeter-plugins/blob/416d2a77249ab921c7e4134c3e6a9639901ef7e8/plugins/functions/src/main/java/kg/apc/jmeter/functions/CaseFormat.java#L155-L167 |
113,328 | undera/jmeter-plugins | plugins/functions/src/main/java/kg/apc/jmeter/functions/CaseFormat.java | CaseFormat.caseFormatWithDelimiter | private static String caseFormatWithDelimiter(String str, String delimiter, boolean isAllUpper, boolean isAllLower) {
StringBuilder builder = new StringBuilder(str.length());
String[] tokens = NOT_ALPHANUMERIC_REGEX.split(str);
boolean shouldAddDelimiter = StringUtils.isNotEmpty(delimiter);
for (int i = 0; i < ... | java | private static String caseFormatWithDelimiter(String str, String delimiter, boolean isAllUpper, boolean isAllLower) {
StringBuilder builder = new StringBuilder(str.length());
String[] tokens = NOT_ALPHANUMERIC_REGEX.split(str);
boolean shouldAddDelimiter = StringUtils.isNotEmpty(delimiter);
for (int i = 0; i < ... | [
"private",
"static",
"String",
"caseFormatWithDelimiter",
"(",
"String",
"str",
",",
"String",
"delimiter",
",",
"boolean",
"isAllUpper",
",",
"boolean",
"isAllLower",
")",
"{",
"StringBuilder",
"builder",
"=",
"new",
"StringBuilder",
"(",
"str",
".",
"length",
... | Change case using delimiter between words
@param str
@param delimiter
@param isAllUpper
@param isAllLower
@return string after change case | [
"Change",
"case",
"using",
"delimiter",
"between",
"words"
] | 416d2a77249ab921c7e4134c3e6a9639901ef7e8 | https://github.com/undera/jmeter-plugins/blob/416d2a77249ab921c7e4134c3e6a9639901ef7e8/plugins/functions/src/main/java/kg/apc/jmeter/functions/CaseFormat.java#L178-L197 |
113,329 | undera/jmeter-plugins | plugins/functions/src/main/java/kg/apc/jmeter/functions/CaseFormat.java | CaseFormat.addVariableValue | private final void addVariableValue(String value, String variableName) {
if (StringUtils.isNotEmpty(variableName)) {
JMeterVariables vars = getVariables();
if (vars != null) {
vars.put(variableName, value);
}
}
} | java | private final void addVariableValue(String value, String variableName) {
if (StringUtils.isNotEmpty(variableName)) {
JMeterVariables vars = getVariables();
if (vars != null) {
vars.put(variableName, value);
}
}
} | [
"private",
"final",
"void",
"addVariableValue",
"(",
"String",
"value",
",",
"String",
"variableName",
")",
"{",
"if",
"(",
"StringUtils",
".",
"isNotEmpty",
"(",
"variableName",
")",
")",
"{",
"JMeterVariables",
"vars",
"=",
"getVariables",
"(",
")",
";",
"... | Store value in a variable
@param value value of variable to update
@param String variable name | [
"Store",
"value",
"in",
"a",
"variable"
] | 416d2a77249ab921c7e4134c3e6a9639901ef7e8 | https://github.com/undera/jmeter-plugins/blob/416d2a77249ab921c7e4134c3e6a9639901ef7e8/plugins/functions/src/main/java/kg/apc/jmeter/functions/CaseFormat.java#L242-L249 |
113,330 | JakeWharton/ActionBarSherlock | actionbarsherlock-samples/demos/src/com/actionbarsherlock/sample/demos/ShareActionProviders.java | ShareActionProviders.copyPrivateRawResourceToPubliclyAccessibleFile | private void copyPrivateRawResourceToPubliclyAccessibleFile() {
InputStream inputStream = null;
FileOutputStream outputStream = null;
try {
inputStream = getResources().openRawResource(R.raw.robot);
outputStream = openFileOutput(SHARED_FILE_NAME,
Conte... | java | private void copyPrivateRawResourceToPubliclyAccessibleFile() {
InputStream inputStream = null;
FileOutputStream outputStream = null;
try {
inputStream = getResources().openRawResource(R.raw.robot);
outputStream = openFileOutput(SHARED_FILE_NAME,
Conte... | [
"private",
"void",
"copyPrivateRawResourceToPubliclyAccessibleFile",
"(",
")",
"{",
"InputStream",
"inputStream",
"=",
"null",
";",
"FileOutputStream",
"outputStream",
"=",
"null",
";",
"try",
"{",
"inputStream",
"=",
"getResources",
"(",
")",
".",
"openRawResource",
... | Copies a private raw resource content to a publicly readable
file such that the latter can be shared with other applications. | [
"Copies",
"a",
"private",
"raw",
"resource",
"content",
"to",
"a",
"publicly",
"readable",
"file",
"such",
"that",
"the",
"latter",
"can",
"be",
"shared",
"with",
"other",
"applications",
"."
] | 2c71339e756bcc0b1424c4525680549ba3a2dc97 | https://github.com/JakeWharton/ActionBarSherlock/blob/2c71339e756bcc0b1424c4525680549ba3a2dc97/actionbarsherlock-samples/demos/src/com/actionbarsherlock/sample/demos/ShareActionProviders.java#L98-L128 |
113,331 | JakeWharton/ActionBarSherlock | actionbarsherlock/src/com/actionbarsherlock/internal/view/menu/BaseMenuPresenter.java | BaseMenuPresenter.addItemView | protected void addItemView(View itemView, int childIndex) {
final ViewGroup currentParent = (ViewGroup) itemView.getParent();
if (currentParent != null) {
currentParent.removeView(itemView);
}
((ViewGroup) mMenuView).addView(itemView, childIndex);
} | java | protected void addItemView(View itemView, int childIndex) {
final ViewGroup currentParent = (ViewGroup) itemView.getParent();
if (currentParent != null) {
currentParent.removeView(itemView);
}
((ViewGroup) mMenuView).addView(itemView, childIndex);
} | [
"protected",
"void",
"addItemView",
"(",
"View",
"itemView",
",",
"int",
"childIndex",
")",
"{",
"final",
"ViewGroup",
"currentParent",
"=",
"(",
"ViewGroup",
")",
"itemView",
".",
"getParent",
"(",
")",
";",
"if",
"(",
"currentParent",
"!=",
"null",
")",
... | Add an item view at the given index.
@param itemView View to add
@param childIndex Index within the parent to insert at | [
"Add",
"an",
"item",
"view",
"at",
"the",
"given",
"index",
"."
] | 2c71339e756bcc0b1424c4525680549ba3a2dc97 | https://github.com/JakeWharton/ActionBarSherlock/blob/2c71339e756bcc0b1424c4525680549ba3a2dc97/actionbarsherlock/src/com/actionbarsherlock/internal/view/menu/BaseMenuPresenter.java#L126-L132 |
113,332 | JakeWharton/ActionBarSherlock | actionbarsherlock/src/com/actionbarsherlock/internal/view/menu/BaseMenuPresenter.java | BaseMenuPresenter.createItemView | public MenuView.ItemView createItemView(ViewGroup parent) {
return (MenuView.ItemView) mSystemInflater.inflate(mItemLayoutRes, parent, false);
} | java | public MenuView.ItemView createItemView(ViewGroup parent) {
return (MenuView.ItemView) mSystemInflater.inflate(mItemLayoutRes, parent, false);
} | [
"public",
"MenuView",
".",
"ItemView",
"createItemView",
"(",
"ViewGroup",
"parent",
")",
"{",
"return",
"(",
"MenuView",
".",
"ItemView",
")",
"mSystemInflater",
".",
"inflate",
"(",
"mItemLayoutRes",
",",
"parent",
",",
"false",
")",
";",
"}"
] | Create a new item view that can be re-bound to other item data later.
@return The new item view | [
"Create",
"a",
"new",
"item",
"view",
"that",
"can",
"be",
"re",
"-",
"bound",
"to",
"other",
"item",
"data",
"later",
"."
] | 2c71339e756bcc0b1424c4525680549ba3a2dc97 | https://github.com/JakeWharton/ActionBarSherlock/blob/2c71339e756bcc0b1424c4525680549ba3a2dc97/actionbarsherlock/src/com/actionbarsherlock/internal/view/menu/BaseMenuPresenter.java#L154-L156 |
113,333 | JakeWharton/ActionBarSherlock | actionbarsherlock/src/com/actionbarsherlock/internal/view/menu/BaseMenuPresenter.java | BaseMenuPresenter.getItemView | public View getItemView(MenuItemImpl item, View convertView, ViewGroup parent) {
MenuView.ItemView itemView;
if (convertView instanceof MenuView.ItemView) {
itemView = (MenuView.ItemView) convertView;
} else {
itemView = createItemView(parent);
}
bindItemV... | java | public View getItemView(MenuItemImpl item, View convertView, ViewGroup parent) {
MenuView.ItemView itemView;
if (convertView instanceof MenuView.ItemView) {
itemView = (MenuView.ItemView) convertView;
} else {
itemView = createItemView(parent);
}
bindItemV... | [
"public",
"View",
"getItemView",
"(",
"MenuItemImpl",
"item",
",",
"View",
"convertView",
",",
"ViewGroup",
"parent",
")",
"{",
"MenuView",
".",
"ItemView",
"itemView",
";",
"if",
"(",
"convertView",
"instanceof",
"MenuView",
".",
"ItemView",
")",
"{",
"itemVi... | Prepare an item view for use. See AdapterView for the basic idea at work here.
This may require creating a new item view, but well-behaved implementations will
re-use the view passed as convertView if present. The returned view will be populated
with data from the item parameter.
@param item Item to present
@param con... | [
"Prepare",
"an",
"item",
"view",
"for",
"use",
".",
"See",
"AdapterView",
"for",
"the",
"basic",
"idea",
"at",
"work",
"here",
".",
"This",
"may",
"require",
"creating",
"a",
"new",
"item",
"view",
"but",
"well",
"-",
"behaved",
"implementations",
"will",
... | 2c71339e756bcc0b1424c4525680549ba3a2dc97 | https://github.com/JakeWharton/ActionBarSherlock/blob/2c71339e756bcc0b1424c4525680549ba3a2dc97/actionbarsherlock/src/com/actionbarsherlock/internal/view/menu/BaseMenuPresenter.java#L169-L178 |
113,334 | JakeWharton/ActionBarSherlock | actionbarsherlock/src/com/actionbarsherlock/internal/view/menu/ActionMenuPresenter.java | ActionMenuPresenter.showOverflowMenu | public boolean showOverflowMenu() {
if (mReserveOverflow && !isOverflowMenuShowing() && mMenu != null && mMenuView != null &&
mPostedOpenRunnable == null && !mMenu.getNonActionItems().isEmpty()) {
OverflowPopup popup = new OverflowPopup(mContext, mMenu, mOverflowButton, true);
... | java | public boolean showOverflowMenu() {
if (mReserveOverflow && !isOverflowMenuShowing() && mMenu != null && mMenuView != null &&
mPostedOpenRunnable == null && !mMenu.getNonActionItems().isEmpty()) {
OverflowPopup popup = new OverflowPopup(mContext, mMenu, mOverflowButton, true);
... | [
"public",
"boolean",
"showOverflowMenu",
"(",
")",
"{",
"if",
"(",
"mReserveOverflow",
"&&",
"!",
"isOverflowMenuShowing",
"(",
")",
"&&",
"mMenu",
"!=",
"null",
"&&",
"mMenuView",
"!=",
"null",
"&&",
"mPostedOpenRunnable",
"==",
"null",
"&&",
"!",
"mMenu",
... | Display the overflow menu if one is present.
@return true if the overflow menu was shown, false otherwise. | [
"Display",
"the",
"overflow",
"menu",
"if",
"one",
"is",
"present",
"."
] | 2c71339e756bcc0b1424c4525680549ba3a2dc97 | https://github.com/JakeWharton/ActionBarSherlock/blob/2c71339e756bcc0b1424c4525680549ba3a2dc97/actionbarsherlock/src/com/actionbarsherlock/internal/view/menu/ActionMenuPresenter.java#L297-L312 |
113,335 | JakeWharton/ActionBarSherlock | actionbarsherlock/src/com/actionbarsherlock/internal/view/menu/ActionMenuPresenter.java | ActionMenuPresenter.hideOverflowMenu | public boolean hideOverflowMenu() {
if (mPostedOpenRunnable != null && mMenuView != null) {
((View) mMenuView).removeCallbacks(mPostedOpenRunnable);
mPostedOpenRunnable = null;
return true;
}
MenuPopupHelper popup = mOverflowPopup;
if (popup != null) ... | java | public boolean hideOverflowMenu() {
if (mPostedOpenRunnable != null && mMenuView != null) {
((View) mMenuView).removeCallbacks(mPostedOpenRunnable);
mPostedOpenRunnable = null;
return true;
}
MenuPopupHelper popup = mOverflowPopup;
if (popup != null) ... | [
"public",
"boolean",
"hideOverflowMenu",
"(",
")",
"{",
"if",
"(",
"mPostedOpenRunnable",
"!=",
"null",
"&&",
"mMenuView",
"!=",
"null",
")",
"{",
"(",
"(",
"View",
")",
"mMenuView",
")",
".",
"removeCallbacks",
"(",
"mPostedOpenRunnable",
")",
";",
"mPosted... | Hide the overflow menu if it is currently showing.
@return true if the overflow menu was hidden, false otherwise. | [
"Hide",
"the",
"overflow",
"menu",
"if",
"it",
"is",
"currently",
"showing",
"."
] | 2c71339e756bcc0b1424c4525680549ba3a2dc97 | https://github.com/JakeWharton/ActionBarSherlock/blob/2c71339e756bcc0b1424c4525680549ba3a2dc97/actionbarsherlock/src/com/actionbarsherlock/internal/view/menu/ActionMenuPresenter.java#L319-L332 |
113,336 | JakeWharton/ActionBarSherlock | actionbarsherlock/src/com/actionbarsherlock/widget/SuggestionsAdapter.java | SuggestionsAdapter.changeCursor | @Override
public void changeCursor(Cursor c) {
if (DBG) Log.d(LOG_TAG, "changeCursor(" + c + ")");
if (mClosed) {
Log.w(LOG_TAG, "Tried to change cursor after adapter was closed.");
if (c != null) c.close();
return;
}
try {
super.chan... | java | @Override
public void changeCursor(Cursor c) {
if (DBG) Log.d(LOG_TAG, "changeCursor(" + c + ")");
if (mClosed) {
Log.w(LOG_TAG, "Tried to change cursor after adapter was closed.");
if (c != null) c.close();
return;
}
try {
super.chan... | [
"@",
"Override",
"public",
"void",
"changeCursor",
"(",
"Cursor",
"c",
")",
"{",
"if",
"(",
"DBG",
")",
"Log",
".",
"d",
"(",
"LOG_TAG",
",",
"\"changeCursor(\"",
"+",
"c",
"+",
"\")\"",
")",
";",
"if",
"(",
"mClosed",
")",
"{",
"Log",
".",
"w",
... | Cache columns. | [
"Cache",
"columns",
"."
] | 2c71339e756bcc0b1424c4525680549ba3a2dc97 | https://github.com/JakeWharton/ActionBarSherlock/blob/2c71339e756bcc0b1424c4525680549ba3a2dc97/actionbarsherlock/src/com/actionbarsherlock/widget/SuggestionsAdapter.java#L293-L317 |
113,337 | JakeWharton/ActionBarSherlock | actionbarsherlock/src/com/actionbarsherlock/widget/SuggestionsAdapter.java | SuggestionsAdapter.newView | @Override
public View newView(Context context, Cursor cursor, ViewGroup parent) {
View v = super.newView(context, cursor, parent);
v.setTag(new ChildViewCache(v));
return v;
} | java | @Override
public View newView(Context context, Cursor cursor, ViewGroup parent) {
View v = super.newView(context, cursor, parent);
v.setTag(new ChildViewCache(v));
return v;
} | [
"@",
"Override",
"public",
"View",
"newView",
"(",
"Context",
"context",
",",
"Cursor",
"cursor",
",",
"ViewGroup",
"parent",
")",
"{",
"View",
"v",
"=",
"super",
".",
"newView",
"(",
"context",
",",
"cursor",
",",
"parent",
")",
";",
"v",
".",
"setTag... | Tags the view with cached child view look-ups. | [
"Tags",
"the",
"view",
"with",
"cached",
"child",
"view",
"look",
"-",
"ups",
"."
] | 2c71339e756bcc0b1424c4525680549ba3a2dc97 | https://github.com/JakeWharton/ActionBarSherlock/blob/2c71339e756bcc0b1424c4525680549ba3a2dc97/actionbarsherlock/src/com/actionbarsherlock/widget/SuggestionsAdapter.java#L322-L327 |
113,338 | JakeWharton/ActionBarSherlock | actionbarsherlock/src/com/actionbarsherlock/widget/SuggestionsAdapter.java | SuggestionsAdapter.setViewDrawable | private void setViewDrawable(ImageView v, Drawable drawable, int nullVisibility) {
// Set the icon even if the drawable is null, since we need to clear any
// previous icon.
v.setImageDrawable(drawable);
if (drawable == null) {
v.setVisibility(nullVisibility);
} else... | java | private void setViewDrawable(ImageView v, Drawable drawable, int nullVisibility) {
// Set the icon even if the drawable is null, since we need to clear any
// previous icon.
v.setImageDrawable(drawable);
if (drawable == null) {
v.setVisibility(nullVisibility);
} else... | [
"private",
"void",
"setViewDrawable",
"(",
"ImageView",
"v",
",",
"Drawable",
"drawable",
",",
"int",
"nullVisibility",
")",
"{",
"// Set the icon even if the drawable is null, since we need to clear any",
"// previous icon.",
"v",
".",
"setImageDrawable",
"(",
"drawable",
... | Sets the drawable in an image view, makes sure the view is only visible if there
is a drawable. | [
"Sets",
"the",
"drawable",
"in",
"an",
"image",
"view",
"makes",
"sure",
"the",
"view",
"is",
"only",
"visible",
"if",
"there",
"is",
"a",
"drawable",
"."
] | 2c71339e756bcc0b1424c4525680549ba3a2dc97 | https://github.com/JakeWharton/ActionBarSherlock/blob/2c71339e756bcc0b1424c4525680549ba3a2dc97/actionbarsherlock/src/com/actionbarsherlock/widget/SuggestionsAdapter.java#L460-L478 |
113,339 | JakeWharton/ActionBarSherlock | actionbarsherlock/src/com/actionbarsherlock/widget/SuggestionsAdapter.java | SuggestionsAdapter.getView | @Override
public View getView(int position, View convertView, ViewGroup parent) {
try {
return super.getView(position, convertView, parent);
} catch (RuntimeException e) {
Log.w(LOG_TAG, "Search suggestions cursor threw exception.", e);
// Put exception string in ... | java | @Override
public View getView(int position, View convertView, ViewGroup parent) {
try {
return super.getView(position, convertView, parent);
} catch (RuntimeException e) {
Log.w(LOG_TAG, "Search suggestions cursor threw exception.", e);
// Put exception string in ... | [
"@",
"Override",
"public",
"View",
"getView",
"(",
"int",
"position",
",",
"View",
"convertView",
",",
"ViewGroup",
"parent",
")",
"{",
"try",
"{",
"return",
"super",
".",
"getView",
"(",
"position",
",",
"convertView",
",",
"parent",
")",
";",
"}",
"cat... | This method is overridden purely to provide a bit of protection against
flaky content providers.
@see android.widget.ListAdapter#getView(int, View, ViewGroup) | [
"This",
"method",
"is",
"overridden",
"purely",
"to",
"provide",
"a",
"bit",
"of",
"protection",
"against",
"flaky",
"content",
"providers",
"."
] | 2c71339e756bcc0b1424c4525680549ba3a2dc97 | https://github.com/JakeWharton/ActionBarSherlock/blob/2c71339e756bcc0b1424c4525680549ba3a2dc97/actionbarsherlock/src/com/actionbarsherlock/widget/SuggestionsAdapter.java#L508-L523 |
113,340 | JakeWharton/ActionBarSherlock | actionbarsherlock/src/com/actionbarsherlock/widget/SuggestionsAdapter.java | SuggestionsAdapter.getDrawableFromResourceValue | private Drawable getDrawableFromResourceValue(String drawableId) {
if (drawableId == null || drawableId.length() == 0 || "0".equals(drawableId)) {
return null;
}
try {
// First, see if it's just an integer
int resourceId = Integer.parseInt(drawableId);
... | java | private Drawable getDrawableFromResourceValue(String drawableId) {
if (drawableId == null || drawableId.length() == 0 || "0".equals(drawableId)) {
return null;
}
try {
// First, see if it's just an integer
int resourceId = Integer.parseInt(drawableId);
... | [
"private",
"Drawable",
"getDrawableFromResourceValue",
"(",
"String",
"drawableId",
")",
"{",
"if",
"(",
"drawableId",
"==",
"null",
"||",
"drawableId",
".",
"length",
"(",
")",
"==",
"0",
"||",
"\"0\"",
".",
"equals",
"(",
"drawableId",
")",
")",
"{",
"re... | Gets a drawable given a value provided by a suggestion provider.
This value could be just the string value of a resource id
(e.g., "2130837524"), in which case we will try to retrieve a drawable from
the provider's resources. If the value is not an integer, it is
treated as a Uri and opened with
{@link ContentResolver... | [
"Gets",
"a",
"drawable",
"given",
"a",
"value",
"provided",
"by",
"a",
"suggestion",
"provider",
"."
] | 2c71339e756bcc0b1424c4525680549ba3a2dc97 | https://github.com/JakeWharton/ActionBarSherlock/blob/2c71339e756bcc0b1424c4525680549ba3a2dc97/actionbarsherlock/src/com/actionbarsherlock/widget/SuggestionsAdapter.java#L544-L579 |
113,341 | JakeWharton/ActionBarSherlock | actionbarsherlock/src/com/actionbarsherlock/widget/SuggestionsAdapter.java | SuggestionsAdapter.getActivityIconWithCache | private Drawable getActivityIconWithCache(ComponentName component) {
// First check the icon cache
String componentIconKey = component.flattenToShortString();
// Using containsKey() since we also store null values.
if (mOutsideDrawablesCache.containsKey(componentIconKey)) {
D... | java | private Drawable getActivityIconWithCache(ComponentName component) {
// First check the icon cache
String componentIconKey = component.flattenToShortString();
// Using containsKey() since we also store null values.
if (mOutsideDrawablesCache.containsKey(componentIconKey)) {
D... | [
"private",
"Drawable",
"getActivityIconWithCache",
"(",
"ComponentName",
"component",
")",
"{",
"// First check the icon cache",
"String",
"componentIconKey",
"=",
"component",
".",
"flattenToShortString",
"(",
")",
";",
"// Using containsKey() since we also store null values.",
... | Gets the activity or application icon for an activity.
Uses the local icon cache for fast repeated lookups.
@param component Name of an activity.
@return A drawable, or {@code null} if neither the activity nor the application
has an icon set. | [
"Gets",
"the",
"activity",
"or",
"application",
"icon",
"for",
"an",
"activity",
".",
"Uses",
"the",
"local",
"icon",
"cache",
"for",
"fast",
"repeated",
"lookups",
"."
] | 2c71339e756bcc0b1424c4525680549ba3a2dc97 | https://github.com/JakeWharton/ActionBarSherlock/blob/2c71339e756bcc0b1424c4525680549ba3a2dc97/actionbarsherlock/src/com/actionbarsherlock/widget/SuggestionsAdapter.java#L688-L702 |
113,342 | JakeWharton/ActionBarSherlock | actionbarsherlock/src/com/actionbarsherlock/widget/SuggestionsAdapter.java | SuggestionsAdapter.getActivityIcon | private Drawable getActivityIcon(ComponentName component) {
PackageManager pm = mContext.getPackageManager();
final ActivityInfo activityInfo;
try {
activityInfo = pm.getActivityInfo(component, PackageManager.GET_META_DATA);
} catch (NameNotFoundException ex) {
Lo... | java | private Drawable getActivityIcon(ComponentName component) {
PackageManager pm = mContext.getPackageManager();
final ActivityInfo activityInfo;
try {
activityInfo = pm.getActivityInfo(component, PackageManager.GET_META_DATA);
} catch (NameNotFoundException ex) {
Lo... | [
"private",
"Drawable",
"getActivityIcon",
"(",
"ComponentName",
"component",
")",
"{",
"PackageManager",
"pm",
"=",
"mContext",
".",
"getPackageManager",
"(",
")",
";",
"final",
"ActivityInfo",
"activityInfo",
";",
"try",
"{",
"activityInfo",
"=",
"pm",
".",
"ge... | Gets the activity or application icon for an activity.
@param component Name of an activity.
@return A drawable, or {@code null} if neither the acitivy or the application
have an icon set. | [
"Gets",
"the",
"activity",
"or",
"application",
"icon",
"for",
"an",
"activity",
"."
] | 2c71339e756bcc0b1424c4525680549ba3a2dc97 | https://github.com/JakeWharton/ActionBarSherlock/blob/2c71339e756bcc0b1424c4525680549ba3a2dc97/actionbarsherlock/src/com/actionbarsherlock/widget/SuggestionsAdapter.java#L711-L730 |
113,343 | JakeWharton/ActionBarSherlock | actionbarsherlock/src/com/actionbarsherlock/widget/SuggestionsAdapter.java | SuggestionsAdapter.getColumnString | public static String getColumnString(Cursor cursor, String columnName) {
int col = cursor.getColumnIndex(columnName);
return getStringOrNull(cursor, col);
} | java | public static String getColumnString(Cursor cursor, String columnName) {
int col = cursor.getColumnIndex(columnName);
return getStringOrNull(cursor, col);
} | [
"public",
"static",
"String",
"getColumnString",
"(",
"Cursor",
"cursor",
",",
"String",
"columnName",
")",
"{",
"int",
"col",
"=",
"cursor",
".",
"getColumnIndex",
"(",
"columnName",
")",
";",
"return",
"getStringOrNull",
"(",
"cursor",
",",
"col",
")",
";"... | Gets the value of a string column by name.
@param cursor Cursor to read the value from.
@param columnName The name of the column to read.
@return The value of the given column, or <code>null</null>
if the cursor does not contain the given column. | [
"Gets",
"the",
"value",
"of",
"a",
"string",
"column",
"by",
"name",
"."
] | 2c71339e756bcc0b1424c4525680549ba3a2dc97 | https://github.com/JakeWharton/ActionBarSherlock/blob/2c71339e756bcc0b1424c4525680549ba3a2dc97/actionbarsherlock/src/com/actionbarsherlock/widget/SuggestionsAdapter.java#L740-L743 |
113,344 | JakeWharton/ActionBarSherlock | actionbarsherlock/src/com/actionbarsherlock/internal/widget/IcsAdapterView.java | IcsAdapterView.performItemClick | public boolean performItemClick(View view, int position, long id) {
if (mOnItemClickListener != null) {
playSoundEffect(SoundEffectConstants.CLICK);
if (view != null) {
view.sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_CLICKED);
}
mOnItemCli... | java | public boolean performItemClick(View view, int position, long id) {
if (mOnItemClickListener != null) {
playSoundEffect(SoundEffectConstants.CLICK);
if (view != null) {
view.sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_CLICKED);
}
mOnItemCli... | [
"public",
"boolean",
"performItemClick",
"(",
"View",
"view",
",",
"int",
"position",
",",
"long",
"id",
")",
"{",
"if",
"(",
"mOnItemClickListener",
"!=",
"null",
")",
"{",
"playSoundEffect",
"(",
"SoundEffectConstants",
".",
"CLICK",
")",
";",
"if",
"(",
... | Call the OnItemClickListener, if it is defined.
@param view The view within the AdapterView that was clicked.
@param position The position of the view in the adapter.
@param id The row id of the item that was clicked.
@return True if there was an assigned OnItemClickListener that was
called, false otherwise is returne... | [
"Call",
"the",
"OnItemClickListener",
"if",
"it",
"is",
"defined",
"."
] | 2c71339e756bcc0b1424c4525680549ba3a2dc97 | https://github.com/JakeWharton/ActionBarSherlock/blob/2c71339e756bcc0b1424c4525680549ba3a2dc97/actionbarsherlock/src/com/actionbarsherlock/internal/widget/IcsAdapterView.java#L266-L277 |
113,345 | JakeWharton/ActionBarSherlock | actionbarsherlock/src/com/actionbarsherlock/internal/widget/IcsAdapterView.java | IcsAdapterView.getPositionForView | public int getPositionForView(View view) {
View listItem = view;
try {
View v;
while (!(v = (View) listItem.getParent()).equals(this)) {
listItem = v;
}
} catch (ClassCastException e) {
// We made it up to the window without find th... | java | public int getPositionForView(View view) {
View listItem = view;
try {
View v;
while (!(v = (View) listItem.getParent()).equals(this)) {
listItem = v;
}
} catch (ClassCastException e) {
// We made it up to the window without find th... | [
"public",
"int",
"getPositionForView",
"(",
"View",
"view",
")",
"{",
"View",
"listItem",
"=",
"view",
";",
"try",
"{",
"View",
"v",
";",
"while",
"(",
"!",
"(",
"v",
"=",
"(",
"View",
")",
"listItem",
".",
"getParent",
"(",
")",
")",
".",
"equals"... | Get the position within the adapter's data set for the view, where view is a an adapter item
or a descendant of an adapter item.
@param view an adapter item, or a descendant of an adapter item. This must be visible in this
AdapterView at the time of the call.
@return the position within the adapter's data set of the v... | [
"Get",
"the",
"position",
"within",
"the",
"adapter",
"s",
"data",
"set",
"for",
"the",
"view",
"where",
"view",
"is",
"a",
"an",
"adapter",
"item",
"or",
"a",
"descendant",
"of",
"an",
"adapter",
"item",
"."
] | 2c71339e756bcc0b1424c4525680549ba3a2dc97 | https://github.com/JakeWharton/ActionBarSherlock/blob/2c71339e756bcc0b1424c4525680549ba3a2dc97/actionbarsherlock/src/com/actionbarsherlock/internal/widget/IcsAdapterView.java#L567-L589 |
113,346 | JakeWharton/ActionBarSherlock | actionbarsherlock/src/com/actionbarsherlock/internal/widget/IcsAdapterView.java | IcsAdapterView.getItemAtPosition | public Object getItemAtPosition(int position) {
T adapter = getAdapter();
return (adapter == null || position < 0) ? null : adapter.getItem(position);
} | java | public Object getItemAtPosition(int position) {
T adapter = getAdapter();
return (adapter == null || position < 0) ? null : adapter.getItem(position);
} | [
"public",
"Object",
"getItemAtPosition",
"(",
"int",
"position",
")",
"{",
"T",
"adapter",
"=",
"getAdapter",
"(",
")",
";",
"return",
"(",
"adapter",
"==",
"null",
"||",
"position",
"<",
"0",
")",
"?",
"null",
":",
"adapter",
".",
"getItem",
"(",
"pos... | Gets the data associated with the specified position in the list.
@param position Which data to get
@return The data associated with the specified position in the list | [
"Gets",
"the",
"data",
"associated",
"with",
"the",
"specified",
"position",
"in",
"the",
"list",
"."
] | 2c71339e756bcc0b1424c4525680549ba3a2dc97 | https://github.com/JakeWharton/ActionBarSherlock/blob/2c71339e756bcc0b1424c4525680549ba3a2dc97/actionbarsherlock/src/com/actionbarsherlock/internal/widget/IcsAdapterView.java#L728-L731 |
113,347 | JakeWharton/ActionBarSherlock | actionbarsherlock/src/com/actionbarsherlock/internal/ResourcesCompat.java | ResourcesCompat.loadLogoFromManifest | public static int loadLogoFromManifest(Activity activity) {
int logo = 0;
try {
final String thisPackage = activity.getClass().getName();
if (ActionBarSherlock.DEBUG) Log.i(TAG, "Parsing AndroidManifest.xml for " + thisPackage);
final String packageName = activity.ge... | java | public static int loadLogoFromManifest(Activity activity) {
int logo = 0;
try {
final String thisPackage = activity.getClass().getName();
if (ActionBarSherlock.DEBUG) Log.i(TAG, "Parsing AndroidManifest.xml for " + thisPackage);
final String packageName = activity.ge... | [
"public",
"static",
"int",
"loadLogoFromManifest",
"(",
"Activity",
"activity",
")",
"{",
"int",
"logo",
"=",
"0",
";",
"try",
"{",
"final",
"String",
"thisPackage",
"=",
"activity",
".",
"getClass",
"(",
")",
".",
"getName",
"(",
")",
";",
"if",
"(",
... | Attempt to programmatically load the logo from the manifest file of an
activity by using an XML pull parser. This should allow us to read the
logo attribute regardless of the platform it is being run on.
@param activity Activity instance.
@return Logo resource ID. | [
"Attempt",
"to",
"programmatically",
"load",
"the",
"logo",
"from",
"the",
"manifest",
"file",
"of",
"an",
"activity",
"by",
"using",
"an",
"XML",
"pull",
"parser",
".",
"This",
"should",
"allow",
"us",
"to",
"read",
"the",
"logo",
"attribute",
"regardless",... | 2c71339e756bcc0b1424c4525680549ba3a2dc97 | https://github.com/JakeWharton/ActionBarSherlock/blob/2c71339e756bcc0b1424c4525680549ba3a2dc97/actionbarsherlock/src/com/actionbarsherlock/internal/ResourcesCompat.java#L112-L181 |
113,348 | JakeWharton/ActionBarSherlock | actionbarsherlock/src/com/actionbarsherlock/widget/ShareActionProvider.java | ShareActionProvider.setActivityChooserPolicyIfNeeded | private void setActivityChooserPolicyIfNeeded() {
if (mOnShareTargetSelectedListener == null) {
return;
}
if (mOnChooseActivityListener == null) {
mOnChooseActivityListener = new ShareAcitivityChooserModelPolicy();
}
ActivityChooserModel dataModel = Activi... | java | private void setActivityChooserPolicyIfNeeded() {
if (mOnShareTargetSelectedListener == null) {
return;
}
if (mOnChooseActivityListener == null) {
mOnChooseActivityListener = new ShareAcitivityChooserModelPolicy();
}
ActivityChooserModel dataModel = Activi... | [
"private",
"void",
"setActivityChooserPolicyIfNeeded",
"(",
")",
"{",
"if",
"(",
"mOnShareTargetSelectedListener",
"==",
"null",
")",
"{",
"return",
";",
"}",
"if",
"(",
"mOnChooseActivityListener",
"==",
"null",
")",
"{",
"mOnChooseActivityListener",
"=",
"new",
... | Set the activity chooser policy of the model backed by the current
share history file if needed which is if there is a registered callback. | [
"Set",
"the",
"activity",
"chooser",
"policy",
"of",
"the",
"model",
"backed",
"by",
"the",
"current",
"share",
"history",
"file",
"if",
"needed",
"which",
"is",
"if",
"there",
"is",
"a",
"registered",
"callback",
"."
] | 2c71339e756bcc0b1424c4525680549ba3a2dc97 | https://github.com/JakeWharton/ActionBarSherlock/blob/2c71339e756bcc0b1424c4525680549ba3a2dc97/actionbarsherlock/src/com/actionbarsherlock/widget/ShareActionProvider.java#L292-L301 |
113,349 | JakeWharton/ActionBarSherlock | actionbarsherlock/src/com/actionbarsherlock/widget/ActivityChooserModel.java | ActivityChooserModel.sortActivities | private void sortActivities() {
synchronized (mInstanceLock) {
if (mActivitySorter != null && !mActivites.isEmpty()) {
mActivitySorter.sort(mIntent, mActivites,
Collections.unmodifiableList(mHistoricalRecords));
notifyChanged();
}
... | java | private void sortActivities() {
synchronized (mInstanceLock) {
if (mActivitySorter != null && !mActivites.isEmpty()) {
mActivitySorter.sort(mIntent, mActivites,
Collections.unmodifiableList(mHistoricalRecords));
notifyChanged();
}
... | [
"private",
"void",
"sortActivities",
"(",
")",
"{",
"synchronized",
"(",
"mInstanceLock",
")",
"{",
"if",
"(",
"mActivitySorter",
"!=",
"null",
"&&",
"!",
"mActivites",
".",
"isEmpty",
"(",
")",
")",
"{",
"mActivitySorter",
".",
"sort",
"(",
"mIntent",
","... | Sorts the activities based on history and an intent. If
a sorter is not specified this a default implementation is used.
@see #setActivitySorter(ActivitySorter) | [
"Sorts",
"the",
"activities",
"based",
"on",
"history",
"and",
"an",
"intent",
".",
"If",
"a",
"sorter",
"is",
"not",
"specified",
"this",
"a",
"default",
"implementation",
"is",
"used",
"."
] | 2c71339e756bcc0b1424c4525680549ba3a2dc97 | https://github.com/JakeWharton/ActionBarSherlock/blob/2c71339e756bcc0b1424c4525680549ba3a2dc97/actionbarsherlock/src/com/actionbarsherlock/widget/ActivityChooserModel.java#L614-L622 |
113,350 | JakeWharton/ActionBarSherlock | actionbarsherlock/src/com/actionbarsherlock/widget/ActivityChooserModel.java | ActivityChooserModel.loadActivitiesLocked | private void loadActivitiesLocked() {
mActivites.clear();
if (mIntent != null) {
List<ResolveInfo> resolveInfos =
mContext.getPackageManager().queryIntentActivities(mIntent, 0);
final int resolveInfoCount = resolveInfos.size();
for (int i = 0; i < reso... | java | private void loadActivitiesLocked() {
mActivites.clear();
if (mIntent != null) {
List<ResolveInfo> resolveInfos =
mContext.getPackageManager().queryIntentActivities(mIntent, 0);
final int resolveInfoCount = resolveInfos.size();
for (int i = 0; i < reso... | [
"private",
"void",
"loadActivitiesLocked",
"(",
")",
"{",
"mActivites",
".",
"clear",
"(",
")",
";",
"if",
"(",
"mIntent",
"!=",
"null",
")",
"{",
"List",
"<",
"ResolveInfo",
">",
"resolveInfos",
"=",
"mContext",
".",
"getPackageManager",
"(",
")",
".",
... | Loads the activities. | [
"Loads",
"the",
"activities",
"."
] | 2c71339e756bcc0b1424c4525680549ba3a2dc97 | https://github.com/JakeWharton/ActionBarSherlock/blob/2c71339e756bcc0b1424c4525680549ba3a2dc97/actionbarsherlock/src/com/actionbarsherlock/widget/ActivityChooserModel.java#L710-L724 |
113,351 | JakeWharton/ActionBarSherlock | actionbarsherlock/src/com/actionbarsherlock/widget/SearchView.java | SearchView.onKeyDown | @Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
if (mSearchable == null) {
return false;
}
// if it's an action specified by the searchable activity, launch the
// entered query with the action key
// TODO SearchableInfo.ActionKeyInfo actionKey ... | java | @Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
if (mSearchable == null) {
return false;
}
// if it's an action specified by the searchable activity, launch the
// entered query with the action key
// TODO SearchableInfo.ActionKeyInfo actionKey ... | [
"@",
"Override",
"public",
"boolean",
"onKeyDown",
"(",
"int",
"keyCode",
",",
"KeyEvent",
"event",
")",
"{",
"if",
"(",
"mSearchable",
"==",
"null",
")",
"{",
"return",
"false",
";",
"}",
"// if it's an action specified by the searchable activity, launch the",
"// ... | Handles the key down event for dealing with action keys.
@param keyCode This is the keycode of the typed key, and is the same value as
found in the KeyEvent parameter.
@param event The complete event record for the typed key
@return true if the event was handled here, or false if not. | [
"Handles",
"the",
"key",
"down",
"event",
"for",
"dealing",
"with",
"action",
"keys",
"."
] | 2c71339e756bcc0b1424c4525680549ba3a2dc97 | https://github.com/JakeWharton/ActionBarSherlock/blob/2c71339e756bcc0b1424c4525680549ba3a2dc97/actionbarsherlock/src/com/actionbarsherlock/widget/SearchView.java#L901-L917 |
113,352 | JakeWharton/ActionBarSherlock | actionbarsherlock/src/com/actionbarsherlock/widget/SearchView.java | SearchView.onSuggestionsKey | private boolean onSuggestionsKey(View v, int keyCode, KeyEvent event) {
// guard against possible race conditions (late arrival after dismiss)
if (mSearchable == null) {
return false;
}
if (mSuggestionsAdapter == null) {
return false;
}
if (event.g... | java | private boolean onSuggestionsKey(View v, int keyCode, KeyEvent event) {
// guard against possible race conditions (late arrival after dismiss)
if (mSearchable == null) {
return false;
}
if (mSuggestionsAdapter == null) {
return false;
}
if (event.g... | [
"private",
"boolean",
"onSuggestionsKey",
"(",
"View",
"v",
",",
"int",
"keyCode",
",",
"KeyEvent",
"event",
")",
"{",
"// guard against possible race conditions (late arrival after dismiss)",
"if",
"(",
"mSearchable",
"==",
"null",
")",
"{",
"return",
"false",
";",
... | React to the user typing while in the suggestions list. First, check for
action keys. If not handled, try refocusing regular characters into the
EditText. | [
"React",
"to",
"the",
"user",
"typing",
"while",
"in",
"the",
"suggestions",
"list",
".",
"First",
"check",
"for",
"action",
"keys",
".",
"If",
"not",
"handled",
"try",
"refocusing",
"regular",
"characters",
"into",
"the",
"EditText",
"."
] | 2c71339e756bcc0b1424c4525680549ba3a2dc97 | https://github.com/JakeWharton/ActionBarSherlock/blob/2c71339e756bcc0b1424c4525680549ba3a2dc97/actionbarsherlock/src/com/actionbarsherlock/widget/SearchView.java#L974-L1034 |
113,353 | JakeWharton/ActionBarSherlock | actionbarsherlock/src/com/actionbarsherlock/widget/SearchView.java | SearchView.updateVoiceButton | private void updateVoiceButton(boolean empty) {
int visibility = GONE;
if (mVoiceButtonEnabled && !isIconified() && empty) {
visibility = VISIBLE;
mSubmitButton.setVisibility(GONE);
}
mVoiceButton.setVisibility(visibility);
} | java | private void updateVoiceButton(boolean empty) {
int visibility = GONE;
if (mVoiceButtonEnabled && !isIconified() && empty) {
visibility = VISIBLE;
mSubmitButton.setVisibility(GONE);
}
mVoiceButton.setVisibility(visibility);
} | [
"private",
"void",
"updateVoiceButton",
"(",
"boolean",
"empty",
")",
"{",
"int",
"visibility",
"=",
"GONE",
";",
"if",
"(",
"mVoiceButtonEnabled",
"&&",
"!",
"isIconified",
"(",
")",
"&&",
"empty",
")",
"{",
"visibility",
"=",
"VISIBLE",
";",
"mSubmitButton... | Update the visibility of the voice button. There are actually two voice search modes,
either of which will activate the button.
@param empty whether the search query text field is empty. If it is, then the other
criteria apply to make the voice button visible. | [
"Update",
"the",
"visibility",
"of",
"the",
"voice",
"button",
".",
"There",
"are",
"actually",
"two",
"voice",
"search",
"modes",
"either",
"of",
"which",
"will",
"activate",
"the",
"button",
"."
] | 2c71339e756bcc0b1424c4525680549ba3a2dc97 | https://github.com/JakeWharton/ActionBarSherlock/blob/2c71339e756bcc0b1424c4525680549ba3a2dc97/actionbarsherlock/src/com/actionbarsherlock/widget/SearchView.java#L1147-L1154 |
113,354 | JakeWharton/ActionBarSherlock | actionbarsherlock/src/com/actionbarsherlock/widget/SearchView.java | SearchView.rewriteQueryFromSuggestion | private void rewriteQueryFromSuggestion(int position) {
CharSequence oldQuery = mQueryTextView.getText();
Cursor c = mSuggestionsAdapter.getCursor();
if (c == null) {
return;
}
if (c.moveToPosition(position)) {
// Get the new query from the suggestion.
... | java | private void rewriteQueryFromSuggestion(int position) {
CharSequence oldQuery = mQueryTextView.getText();
Cursor c = mSuggestionsAdapter.getCursor();
if (c == null) {
return;
}
if (c.moveToPosition(position)) {
// Get the new query from the suggestion.
... | [
"private",
"void",
"rewriteQueryFromSuggestion",
"(",
"int",
"position",
")",
"{",
"CharSequence",
"oldQuery",
"=",
"mQueryTextView",
".",
"getText",
"(",
")",
";",
"Cursor",
"c",
"=",
"mSuggestionsAdapter",
".",
"getCursor",
"(",
")",
";",
"if",
"(",
"c",
"... | Query rewriting. | [
"Query",
"rewriting",
"."
] | 2c71339e756bcc0b1424c4525680549ba3a2dc97 | https://github.com/JakeWharton/ActionBarSherlock/blob/2c71339e756bcc0b1424c4525680549ba3a2dc97/actionbarsherlock/src/com/actionbarsherlock/widget/SearchView.java#L1375-L1396 |
113,355 | JakeWharton/ActionBarSherlock | actionbarsherlock/src/com/actionbarsherlock/widget/SearchView.java | SearchView.launchSuggestion | private boolean launchSuggestion(int position, int actionKey, String actionMsg) {
Cursor c = mSuggestionsAdapter.getCursor();
if ((c != null) && c.moveToPosition(position)) {
Intent intent = createIntentFromSuggestion(c, actionKey, actionMsg);
// launch the intent
l... | java | private boolean launchSuggestion(int position, int actionKey, String actionMsg) {
Cursor c = mSuggestionsAdapter.getCursor();
if ((c != null) && c.moveToPosition(position)) {
Intent intent = createIntentFromSuggestion(c, actionKey, actionMsg);
// launch the intent
l... | [
"private",
"boolean",
"launchSuggestion",
"(",
"int",
"position",
",",
"int",
"actionKey",
",",
"String",
"actionMsg",
")",
"{",
"Cursor",
"c",
"=",
"mSuggestionsAdapter",
".",
"getCursor",
"(",
")",
";",
"if",
"(",
"(",
"c",
"!=",
"null",
")",
"&&",
"c"... | Launches an intent based on a suggestion.
@param position The index of the suggestion to create the intent from.
@param actionKey The key code of the action key that was pressed,
or {@link KeyEvent#KEYCODE_UNKNOWN} if none.
@param actionMsg The message for the action key that was pressed,
or <code>null</code> if none.... | [
"Launches",
"an",
"intent",
"based",
"on",
"a",
"suggestion",
"."
] | 2c71339e756bcc0b1424c4525680549ba3a2dc97 | https://github.com/JakeWharton/ActionBarSherlock/blob/2c71339e756bcc0b1424c4525680549ba3a2dc97/actionbarsherlock/src/com/actionbarsherlock/widget/SearchView.java#L1408-L1420 |
113,356 | JakeWharton/ActionBarSherlock | actionbarsherlock/src/com/actionbarsherlock/widget/SearchView.java | SearchView.launchIntent | private void launchIntent(Intent intent) {
if (intent == null) {
return;
}
try {
// If the intent was created from a suggestion, it will always have an explicit
// component here.
getContext().startActivity(intent);
} catch (RuntimeExceptio... | java | private void launchIntent(Intent intent) {
if (intent == null) {
return;
}
try {
// If the intent was created from a suggestion, it will always have an explicit
// component here.
getContext().startActivity(intent);
} catch (RuntimeExceptio... | [
"private",
"void",
"launchIntent",
"(",
"Intent",
"intent",
")",
"{",
"if",
"(",
"intent",
"==",
"null",
")",
"{",
"return",
";",
"}",
"try",
"{",
"// If the intent was created from a suggestion, it will always have an explicit",
"// component here.",
"getContext",
"(",... | Launches an intent, including any special intent handling. | [
"Launches",
"an",
"intent",
"including",
"any",
"special",
"intent",
"handling",
"."
] | 2c71339e756bcc0b1424c4525680549ba3a2dc97 | https://github.com/JakeWharton/ActionBarSherlock/blob/2c71339e756bcc0b1424c4525680549ba3a2dc97/actionbarsherlock/src/com/actionbarsherlock/widget/SearchView.java#L1425-L1436 |
113,357 | JakeWharton/ActionBarSherlock | actionbarsherlock/src/com/actionbarsherlock/widget/SearchView.java | SearchView.createIntent | private Intent createIntent(String action, Uri data, String extraData, String query,
int actionKey, String actionMsg) {
// Now build the Intent
Intent intent = new Intent(action);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
... | java | private Intent createIntent(String action, Uri data, String extraData, String query,
int actionKey, String actionMsg) {
// Now build the Intent
Intent intent = new Intent(action);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
... | [
"private",
"Intent",
"createIntent",
"(",
"String",
"action",
",",
"Uri",
"data",
",",
"String",
"extraData",
",",
"String",
"query",
",",
"int",
"actionKey",
",",
"String",
"actionMsg",
")",
"{",
"// Now build the Intent",
"Intent",
"intent",
"=",
"new",
"Int... | Constructs an intent from the given information and the search dialog state.
@param action Intent action.
@param data Intent data, or <code>null</code>.
@param extraData Data for {@link SearchManager#EXTRA_DATA_KEY} or <code>null</code>.
@param query Intent query, or <code>null</code>.
@param actionKey The key code of... | [
"Constructs",
"an",
"intent",
"from",
"the",
"given",
"information",
"and",
"the",
"search",
"dialog",
"state",
"."
] | 2c71339e756bcc0b1424c4525680549ba3a2dc97 | https://github.com/JakeWharton/ActionBarSherlock/blob/2c71339e756bcc0b1424c4525680549ba3a2dc97/actionbarsherlock/src/com/actionbarsherlock/widget/SearchView.java#L1466-L1493 |
113,358 | JakeWharton/ActionBarSherlock | actionbarsherlock/src/com/actionbarsherlock/widget/SearchView.java | SearchView.createVoiceWebSearchIntent | private Intent createVoiceWebSearchIntent(Intent baseIntent, SearchableInfo searchable) {
Intent voiceIntent = new Intent(baseIntent);
ComponentName searchActivity = searchable.getSearchActivity();
voiceIntent.putExtra(RecognizerIntent.EXTRA_CALLING_PACKAGE, searchActivity == null ? null
... | java | private Intent createVoiceWebSearchIntent(Intent baseIntent, SearchableInfo searchable) {
Intent voiceIntent = new Intent(baseIntent);
ComponentName searchActivity = searchable.getSearchActivity();
voiceIntent.putExtra(RecognizerIntent.EXTRA_CALLING_PACKAGE, searchActivity == null ? null
... | [
"private",
"Intent",
"createVoiceWebSearchIntent",
"(",
"Intent",
"baseIntent",
",",
"SearchableInfo",
"searchable",
")",
"{",
"Intent",
"voiceIntent",
"=",
"new",
"Intent",
"(",
"baseIntent",
")",
";",
"ComponentName",
"searchActivity",
"=",
"searchable",
".",
"get... | Create and return an Intent that can launch the voice search activity for web search. | [
"Create",
"and",
"return",
"an",
"Intent",
"that",
"can",
"launch",
"the",
"voice",
"search",
"activity",
"for",
"web",
"search",
"."
] | 2c71339e756bcc0b1424c4525680549ba3a2dc97 | https://github.com/JakeWharton/ActionBarSherlock/blob/2c71339e756bcc0b1424c4525680549ba3a2dc97/actionbarsherlock/src/com/actionbarsherlock/widget/SearchView.java#L1498-L1504 |
113,359 | JakeWharton/ActionBarSherlock | actionbarsherlock/src/com/actionbarsherlock/widget/SearchView.java | SearchView.createVoiceAppSearchIntent | private Intent createVoiceAppSearchIntent(Intent baseIntent, SearchableInfo searchable) {
ComponentName searchActivity = searchable.getSearchActivity();
// create the necessary intent to set up a search-and-forward operation
// in the voice search system. We have to keep the bundle separate,
... | java | private Intent createVoiceAppSearchIntent(Intent baseIntent, SearchableInfo searchable) {
ComponentName searchActivity = searchable.getSearchActivity();
// create the necessary intent to set up a search-and-forward operation
// in the voice search system. We have to keep the bundle separate,
... | [
"private",
"Intent",
"createVoiceAppSearchIntent",
"(",
"Intent",
"baseIntent",
",",
"SearchableInfo",
"searchable",
")",
"{",
"ComponentName",
"searchActivity",
"=",
"searchable",
".",
"getSearchActivity",
"(",
")",
";",
"// create the necessary intent to set up a search-and... | Create and return an Intent that can launch the voice search activity, perform a specific
voice transcription, and forward the results to the searchable activity.
@param baseIntent The voice app search intent to start from
@return A completely-configured intent ready to send to the voice search activity | [
"Create",
"and",
"return",
"an",
"Intent",
"that",
"can",
"launch",
"the",
"voice",
"search",
"activity",
"perform",
"a",
"specific",
"voice",
"transcription",
"and",
"forward",
"the",
"results",
"to",
"the",
"searchable",
"activity",
"."
] | 2c71339e756bcc0b1424c4525680549ba3a2dc97 | https://github.com/JakeWharton/ActionBarSherlock/blob/2c71339e756bcc0b1424c4525680549ba3a2dc97/actionbarsherlock/src/com/actionbarsherlock/widget/SearchView.java#L1513-L1566 |
113,360 | JakeWharton/ActionBarSherlock | actionbarsherlock-samples/fragments/src/com/actionbarsherlock/sample/fragments/FragmentMenuSupport.java | FragmentMenuSupport.updateFragmentVisibility | void updateFragmentVisibility() {
FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
if (mCheckBox1.isChecked()) ft.show(mFragment1);
else ft.hide(mFragment1);
if (mCheckBox2.isChecked()) ft.show(mFragment2);
else ft.hide(mFragment2);
ft.commit();
... | java | void updateFragmentVisibility() {
FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
if (mCheckBox1.isChecked()) ft.show(mFragment1);
else ft.hide(mFragment1);
if (mCheckBox2.isChecked()) ft.show(mFragment2);
else ft.hide(mFragment2);
ft.commit();
... | [
"void",
"updateFragmentVisibility",
"(",
")",
"{",
"FragmentTransaction",
"ft",
"=",
"getSupportFragmentManager",
"(",
")",
".",
"beginTransaction",
"(",
")",
";",
"if",
"(",
"mCheckBox1",
".",
"isChecked",
"(",
")",
")",
"ft",
".",
"show",
"(",
"mFragment1",
... | Update fragment visibility based on current check box state. | [
"Update",
"fragment",
"visibility",
"based",
"on",
"current",
"check",
"box",
"state",
"."
] | 2c71339e756bcc0b1424c4525680549ba3a2dc97 | https://github.com/JakeWharton/ActionBarSherlock/blob/2c71339e756bcc0b1424c4525680549ba3a2dc97/actionbarsherlock-samples/fragments/src/com/actionbarsherlock/sample/fragments/FragmentMenuSupport.java#L87-L94 |
113,361 | JakeWharton/ActionBarSherlock | actionbarsherlock/src/com/actionbarsherlock/internal/widget/IcsProgressBar.java | IcsProgressBar.tileifyIndeterminate | private Drawable tileifyIndeterminate(Drawable drawable) {
if (drawable instanceof AnimationDrawable) {
AnimationDrawable background = (AnimationDrawable) drawable;
final int N = background.getNumberOfFrames();
AnimationDrawable newBg = new AnimationDrawable();
ne... | java | private Drawable tileifyIndeterminate(Drawable drawable) {
if (drawable instanceof AnimationDrawable) {
AnimationDrawable background = (AnimationDrawable) drawable;
final int N = background.getNumberOfFrames();
AnimationDrawable newBg = new AnimationDrawable();
ne... | [
"private",
"Drawable",
"tileifyIndeterminate",
"(",
"Drawable",
"drawable",
")",
"{",
"if",
"(",
"drawable",
"instanceof",
"AnimationDrawable",
")",
"{",
"AnimationDrawable",
"background",
"=",
"(",
"AnimationDrawable",
")",
"drawable",
";",
"final",
"int",
"N",
"... | Convert a AnimationDrawable for use as a barberpole animation.
Each frame of the animation is wrapped in a ClipDrawable and
given a tiling BitmapShader. | [
"Convert",
"a",
"AnimationDrawable",
"for",
"use",
"as",
"a",
"barberpole",
"animation",
".",
"Each",
"frame",
"of",
"the",
"animation",
"is",
"wrapped",
"in",
"a",
"ClipDrawable",
"and",
"given",
"a",
"tiling",
"BitmapShader",
"."
] | 2c71339e756bcc0b1424c4525680549ba3a2dc97 | https://github.com/JakeWharton/ActionBarSherlock/blob/2c71339e756bcc0b1424c4525680549ba3a2dc97/actionbarsherlock/src/com/actionbarsherlock/internal/widget/IcsProgressBar.java#L406-L422 |
113,362 | JakeWharton/ActionBarSherlock | actionbarsherlock/src/com/actionbarsherlock/internal/widget/IcsSpinner.java | IcsSpinner.setGravity | public void setGravity(int gravity) {
if (mGravity != gravity) {
if ((gravity & Gravity.HORIZONTAL_GRAVITY_MASK) == 0) {
gravity |= Gravity.LEFT;
}
mGravity = gravity;
requestLayout();
}
} | java | public void setGravity(int gravity) {
if (mGravity != gravity) {
if ((gravity & Gravity.HORIZONTAL_GRAVITY_MASK) == 0) {
gravity |= Gravity.LEFT;
}
mGravity = gravity;
requestLayout();
}
} | [
"public",
"void",
"setGravity",
"(",
"int",
"gravity",
")",
"{",
"if",
"(",
"mGravity",
"!=",
"gravity",
")",
"{",
"if",
"(",
"(",
"gravity",
"&",
"Gravity",
".",
"HORIZONTAL_GRAVITY_MASK",
")",
"==",
"0",
")",
"{",
"gravity",
"|=",
"Gravity",
".",
"LE... | Describes how the selected item view is positioned. Currently only the horizontal component
is used. The default is determined by the current theme.
@param gravity See {@link android.view.Gravity}
@attr ref android.R.styleable#Spinner_gravity | [
"Describes",
"how",
"the",
"selected",
"item",
"view",
"is",
"positioned",
".",
"Currently",
"only",
"the",
"horizontal",
"component",
"is",
"used",
".",
"The",
"default",
"is",
"determined",
"by",
"the",
"current",
"theme",
"."
] | 2c71339e756bcc0b1424c4525680549ba3a2dc97 | https://github.com/JakeWharton/ActionBarSherlock/blob/2c71339e756bcc0b1424c4525680549ba3a2dc97/actionbarsherlock/src/com/actionbarsherlock/internal/widget/IcsSpinner.java#L160-L168 |
113,363 | JakeWharton/ActionBarSherlock | actionbarsherlock/src/com/actionbarsherlock/internal/widget/IcsSpinner.java | IcsSpinner.setUpChild | private void setUpChild(View child) {
// Respect layout params that are already in the view. Otherwise
// make some up...
ViewGroup.LayoutParams lp = child.getLayoutParams();
if (lp == null) {
lp = generateDefaultLayoutParams();
}
addViewInLayout(child, 0, l... | java | private void setUpChild(View child) {
// Respect layout params that are already in the view. Otherwise
// make some up...
ViewGroup.LayoutParams lp = child.getLayoutParams();
if (lp == null) {
lp = generateDefaultLayoutParams();
}
addViewInLayout(child, 0, l... | [
"private",
"void",
"setUpChild",
"(",
"View",
"child",
")",
"{",
"// Respect layout params that are already in the view. Otherwise",
"// make some up...",
"ViewGroup",
".",
"LayoutParams",
"lp",
"=",
"child",
".",
"getLayoutParams",
"(",
")",
";",
"if",
"(",
"lp",
"==... | Helper for makeAndAddView to set the position of a view
and fill out its layout paramters.
@param child The view to position | [
"Helper",
"for",
"makeAndAddView",
"to",
"set",
"the",
"position",
"of",
"a",
"view",
"and",
"fill",
"out",
"its",
"layout",
"paramters",
"."
] | 2c71339e756bcc0b1424c4525680549ba3a2dc97 | https://github.com/JakeWharton/ActionBarSherlock/blob/2c71339e756bcc0b1424c4525680549ba3a2dc97/actionbarsherlock/src/com/actionbarsherlock/internal/widget/IcsSpinner.java#L342-L381 |
113,364 | JakeWharton/ActionBarSherlock | actionbarsherlock/src/com/actionbarsherlock/internal/view/menu/ActionMenuView.java | ActionMenuView.measureChildForCells | static int measureChildForCells(View child, int cellSize, int cellsRemaining,
int parentHeightMeasureSpec, int parentHeightPadding) {
final LayoutParams lp = (LayoutParams) child.getLayoutParams();
final int childHeightSize = MeasureSpec.getSize(parentHeightMeasureSpec) -
pa... | java | static int measureChildForCells(View child, int cellSize, int cellsRemaining,
int parentHeightMeasureSpec, int parentHeightPadding) {
final LayoutParams lp = (LayoutParams) child.getLayoutParams();
final int childHeightSize = MeasureSpec.getSize(parentHeightMeasureSpec) -
pa... | [
"static",
"int",
"measureChildForCells",
"(",
"View",
"child",
",",
"int",
"cellSize",
",",
"int",
"cellsRemaining",
",",
"int",
"parentHeightMeasureSpec",
",",
"int",
"parentHeightPadding",
")",
"{",
"final",
"LayoutParams",
"lp",
"=",
"(",
"LayoutParams",
")",
... | Measure a child view to fit within cell-based formatting. The child's width
will be measured to a whole multiple of cellSize.
<p>Sets the expandable and cellsUsed fields of LayoutParams.
@param child Child to measure
@param cellSize Size of one cell
@param cellsRemaining Number of cells remaining that this view can e... | [
"Measure",
"a",
"child",
"view",
"to",
"fit",
"within",
"cell",
"-",
"based",
"formatting",
".",
"The",
"child",
"s",
"width",
"will",
"be",
"measured",
"to",
"a",
"whole",
"multiple",
"of",
"cellSize",
"."
] | 2c71339e756bcc0b1424c4525680549ba3a2dc97 | https://github.com/JakeWharton/ActionBarSherlock/blob/2c71339e756bcc0b1424c4525680549ba3a2dc97/actionbarsherlock/src/com/actionbarsherlock/internal/view/menu/ActionMenuView.java#L347-L377 |
113,365 | JakeWharton/ActionBarSherlock | actionbarsherlock/src/com/actionbarsherlock/internal/nineoldandroids/animation/ValueAnimator.java | ValueAnimator.setValues | public void setValues(PropertyValuesHolder... values) {
int numValues = values.length;
mValues = values;
mValuesMap = new HashMap<String, PropertyValuesHolder>(numValues);
for (int i = 0; i < numValues; ++i) {
PropertyValuesHolder valuesHolder = values[i];
mValues... | java | public void setValues(PropertyValuesHolder... values) {
int numValues = values.length;
mValues = values;
mValuesMap = new HashMap<String, PropertyValuesHolder>(numValues);
for (int i = 0; i < numValues; ++i) {
PropertyValuesHolder valuesHolder = values[i];
mValues... | [
"public",
"void",
"setValues",
"(",
"PropertyValuesHolder",
"...",
"values",
")",
"{",
"int",
"numValues",
"=",
"values",
".",
"length",
";",
"mValues",
"=",
"values",
";",
"mValuesMap",
"=",
"new",
"HashMap",
"<",
"String",
",",
"PropertyValuesHolder",
">",
... | Sets the values, per property, being animated between. This function is called internally
by the constructors of ValueAnimator that take a list of values. But an ValueAnimator can
be constructed without values and this method can be called to set the values manually
instead.
@param values The set of values, per proper... | [
"Sets",
"the",
"values",
"per",
"property",
"being",
"animated",
"between",
".",
"This",
"function",
"is",
"called",
"internally",
"by",
"the",
"constructors",
"of",
"ValueAnimator",
"that",
"take",
"a",
"list",
"of",
"values",
".",
"But",
"an",
"ValueAnimator... | 2c71339e756bcc0b1424c4525680549ba3a2dc97 | https://github.com/JakeWharton/ActionBarSherlock/blob/2c71339e756bcc0b1424c4525680549ba3a2dc97/actionbarsherlock/src/com/actionbarsherlock/internal/nineoldandroids/animation/ValueAnimator.java#L456-L466 |
113,366 | JakeWharton/ActionBarSherlock | actionbarsherlock/src/com/actionbarsherlock/internal/nineoldandroids/animation/PropertyValuesHolder.java | PropertyValuesHolder.setupValue | private void setupValue(Object target, Keyframe kf) {
//if (mProperty != null) {
// kf.setValue(mProperty.get(target));
//}
try {
if (mGetter == null) {
Class targetClass = target.getClass();
setupGetter(targetClass);
}
... | java | private void setupValue(Object target, Keyframe kf) {
//if (mProperty != null) {
// kf.setValue(mProperty.get(target));
//}
try {
if (mGetter == null) {
Class targetClass = target.getClass();
setupGetter(targetClass);
}
... | [
"private",
"void",
"setupValue",
"(",
"Object",
"target",
",",
"Keyframe",
"kf",
")",
"{",
"//if (mProperty != null) {",
"// kf.setValue(mProperty.get(target));",
"//}",
"try",
"{",
"if",
"(",
"mGetter",
"==",
"null",
")",
"{",
"Class",
"targetClass",
"=",
"tar... | Utility function to set the value stored in a particular Keyframe. The value used is
whatever the value is for the property name specified in the keyframe on the target object.
@param target The target object from which the current value should be extracted.
@param kf The keyframe which holds the property name and val... | [
"Utility",
"function",
"to",
"set",
"the",
"value",
"stored",
"in",
"a",
"particular",
"Keyframe",
".",
"The",
"value",
"used",
"is",
"whatever",
"the",
"value",
"is",
"for",
"the",
"property",
"name",
"specified",
"in",
"the",
"keyframe",
"on",
"the",
"ta... | 2c71339e756bcc0b1424c4525680549ba3a2dc97 | https://github.com/JakeWharton/ActionBarSherlock/blob/2c71339e756bcc0b1424c4525680549ba3a2dc97/actionbarsherlock/src/com/actionbarsherlock/internal/nineoldandroids/animation/PropertyValuesHolder.java#L532-L547 |
113,367 | JakeWharton/ActionBarSherlock | actionbarsherlock/src/com/actionbarsherlock/internal/nineoldandroids/animation/PropertyValuesHolder.java | PropertyValuesHolder.setAnimatedValue | void setAnimatedValue(Object target) {
//if (mProperty != null) {
// mProperty.set(target, getAnimatedValue());
//}
if (mSetter != null) {
try {
mTmpValueArray[0] = getAnimatedValue();
mSetter.invoke(target, mTmpValueArray);
} ca... | java | void setAnimatedValue(Object target) {
//if (mProperty != null) {
// mProperty.set(target, getAnimatedValue());
//}
if (mSetter != null) {
try {
mTmpValueArray[0] = getAnimatedValue();
mSetter.invoke(target, mTmpValueArray);
} ca... | [
"void",
"setAnimatedValue",
"(",
"Object",
"target",
")",
"{",
"//if (mProperty != null) {",
"// mProperty.set(target, getAnimatedValue());",
"//}",
"if",
"(",
"mSetter",
"!=",
"null",
")",
"{",
"try",
"{",
"mTmpValueArray",
"[",
"0",
"]",
"=",
"getAnimatedValue",
... | Internal function to set the value on the target object, using the setter set up
earlier on this PropertyValuesHolder object. This function is called by ObjectAnimator
to handle turning the value calculated by ValueAnimator into a value set on the object
according to the name of the property.
@param target The target o... | [
"Internal",
"function",
"to",
"set",
"the",
"value",
"on",
"the",
"target",
"object",
"using",
"the",
"setter",
"set",
"up",
"earlier",
"on",
"this",
"PropertyValuesHolder",
"object",
".",
"This",
"function",
"is",
"called",
"by",
"ObjectAnimator",
"to",
"hand... | 2c71339e756bcc0b1424c4525680549ba3a2dc97 | https://github.com/JakeWharton/ActionBarSherlock/blob/2c71339e756bcc0b1424c4525680549ba3a2dc97/actionbarsherlock/src/com/actionbarsherlock/internal/nineoldandroids/animation/PropertyValuesHolder.java#L595-L609 |
113,368 | JakeWharton/ActionBarSherlock | actionbarsherlock/src/com/actionbarsherlock/internal/view/menu/MenuBuilder.java | MenuBuilder.removeMenuPresenter | public void removeMenuPresenter(MenuPresenter presenter) {
for (WeakReference<MenuPresenter> ref : mPresenters) {
final MenuPresenter item = ref.get();
if (item == null || item == presenter) {
mPresenters.remove(ref);
}
}
} | java | public void removeMenuPresenter(MenuPresenter presenter) {
for (WeakReference<MenuPresenter> ref : mPresenters) {
final MenuPresenter item = ref.get();
if (item == null || item == presenter) {
mPresenters.remove(ref);
}
}
} | [
"public",
"void",
"removeMenuPresenter",
"(",
"MenuPresenter",
"presenter",
")",
"{",
"for",
"(",
"WeakReference",
"<",
"MenuPresenter",
">",
"ref",
":",
"mPresenters",
")",
"{",
"final",
"MenuPresenter",
"item",
"=",
"ref",
".",
"get",
"(",
")",
";",
"if",
... | Remove a presenter from this menu. That presenter will no longer
receive notifications of updates to this menu's data.
@param presenter The presenter to remove | [
"Remove",
"a",
"presenter",
"from",
"this",
"menu",
".",
"That",
"presenter",
"will",
"no",
"longer",
"receive",
"notifications",
"of",
"updates",
"to",
"this",
"menu",
"s",
"data",
"."
] | 2c71339e756bcc0b1424c4525680549ba3a2dc97 | https://github.com/JakeWharton/ActionBarSherlock/blob/2c71339e756bcc0b1424c4525680549ba3a2dc97/actionbarsherlock/src/com/actionbarsherlock/internal/view/menu/MenuBuilder.java#L230-L237 |
113,369 | JakeWharton/ActionBarSherlock | actionbarsherlock/src/com/actionbarsherlock/internal/view/menu/MenuBuilder.java | MenuBuilder.close | final void close(boolean allMenusAreClosing) {
if (mIsClosing) return;
mIsClosing = true;
for (WeakReference<MenuPresenter> ref : mPresenters) {
final MenuPresenter presenter = ref.get();
if (presenter == null) {
mPresenters.remove(ref);
} els... | java | final void close(boolean allMenusAreClosing) {
if (mIsClosing) return;
mIsClosing = true;
for (WeakReference<MenuPresenter> ref : mPresenters) {
final MenuPresenter presenter = ref.get();
if (presenter == null) {
mPresenters.remove(ref);
} els... | [
"final",
"void",
"close",
"(",
"boolean",
"allMenusAreClosing",
")",
"{",
"if",
"(",
"mIsClosing",
")",
"return",
";",
"mIsClosing",
"=",
"true",
";",
"for",
"(",
"WeakReference",
"<",
"MenuPresenter",
">",
"ref",
":",
"mPresenters",
")",
"{",
"final",
"Me... | Closes the visible menu.
@param allMenusAreClosing Whether the menus are completely closing (true),
or whether there is another menu coming in this menu's place
(false). For example, if the menu is closing because a
sub menu is about to be shown, <var>allMenusAreClosing</var>
is false. | [
"Closes",
"the",
"visible",
"menu",
"."
] | 2c71339e756bcc0b1424c4525680549ba3a2dc97 | https://github.com/JakeWharton/ActionBarSherlock/blob/2c71339e756bcc0b1424c4525680549ba3a2dc97/actionbarsherlock/src/com/actionbarsherlock/internal/view/menu/MenuBuilder.java#L918-L931 |
113,370 | JakeWharton/ActionBarSherlock | actionbarsherlock/src/com/actionbarsherlock/internal/view/menu/MenuBuilder.java | MenuBuilder.onItemsChanged | void onItemsChanged(boolean structureChanged) {
if (!mPreventDispatchingItemsChanged) {
if (structureChanged) {
mIsVisibleItemsStale = true;
mIsActionItemsStale = true;
}
dispatchPresenterUpdate(structureChanged);
} else {
... | java | void onItemsChanged(boolean structureChanged) {
if (!mPreventDispatchingItemsChanged) {
if (structureChanged) {
mIsVisibleItemsStale = true;
mIsActionItemsStale = true;
}
dispatchPresenterUpdate(structureChanged);
} else {
... | [
"void",
"onItemsChanged",
"(",
"boolean",
"structureChanged",
")",
"{",
"if",
"(",
"!",
"mPreventDispatchingItemsChanged",
")",
"{",
"if",
"(",
"structureChanged",
")",
"{",
"mIsVisibleItemsStale",
"=",
"true",
";",
"mIsActionItemsStale",
"=",
"true",
";",
"}",
... | Called when an item is added or removed.
@param structureChanged true if the menu structure changed,
false if only item properties changed.
(Visibility is a structural property since it affects layout.) | [
"Called",
"when",
"an",
"item",
"is",
"added",
"or",
"removed",
"."
] | 2c71339e756bcc0b1424c4525680549ba3a2dc97 | https://github.com/JakeWharton/ActionBarSherlock/blob/2c71339e756bcc0b1424c4525680549ba3a2dc97/actionbarsherlock/src/com/actionbarsherlock/internal/view/menu/MenuBuilder.java#L945-L956 |
113,371 | JakeWharton/ActionBarSherlock | actionbarsherlock/src/com/actionbarsherlock/ActionBarSherlock.java | ActionBarSherlock.registerImplementation | public static void registerImplementation(Class<? extends ActionBarSherlock> implementationClass) {
if (!implementationClass.isAnnotationPresent(Implementation.class)) {
throw new IllegalArgumentException("Class " + implementationClass.getSimpleName() + " is not annotated with @Implementation");
... | java | public static void registerImplementation(Class<? extends ActionBarSherlock> implementationClass) {
if (!implementationClass.isAnnotationPresent(Implementation.class)) {
throw new IllegalArgumentException("Class " + implementationClass.getSimpleName() + " is not annotated with @Implementation");
... | [
"public",
"static",
"void",
"registerImplementation",
"(",
"Class",
"<",
"?",
"extends",
"ActionBarSherlock",
">",
"implementationClass",
")",
"{",
"if",
"(",
"!",
"implementationClass",
".",
"isAnnotationPresent",
"(",
"Implementation",
".",
"class",
")",
")",
"{... | Register an ActionBarSherlock implementation.
@param implementationClass Target implementation class which extends
{@link ActionBarSherlock}. This class must also be annotated with
{@link Implementation}. | [
"Register",
"an",
"ActionBarSherlock",
"implementation",
"."
] | 2c71339e756bcc0b1424c4525680549ba3a2dc97 | https://github.com/JakeWharton/ActionBarSherlock/blob/2c71339e756bcc0b1424c4525680549ba3a2dc97/actionbarsherlock/src/com/actionbarsherlock/ActionBarSherlock.java#L122-L133 |
113,372 | JakeWharton/ActionBarSherlock | actionbarsherlock/src/com/actionbarsherlock/ActionBarSherlock.java | ActionBarSherlock.callbackCreateOptionsMenu | protected final boolean callbackCreateOptionsMenu(Menu menu) {
if (DEBUG) Log.d(TAG, "[callbackCreateOptionsMenu] menu: " + menu);
boolean result = true;
if (mActivity instanceof OnCreatePanelMenuListener) {
OnCreatePanelMenuListener listener = (OnCreatePanelMenuListener)mActiv... | java | protected final boolean callbackCreateOptionsMenu(Menu menu) {
if (DEBUG) Log.d(TAG, "[callbackCreateOptionsMenu] menu: " + menu);
boolean result = true;
if (mActivity instanceof OnCreatePanelMenuListener) {
OnCreatePanelMenuListener listener = (OnCreatePanelMenuListener)mActiv... | [
"protected",
"final",
"boolean",
"callbackCreateOptionsMenu",
"(",
"Menu",
"menu",
")",
"{",
"if",
"(",
"DEBUG",
")",
"Log",
".",
"d",
"(",
"TAG",
",",
"\"[callbackCreateOptionsMenu] menu: \"",
"+",
"menu",
")",
";",
"boolean",
"result",
"=",
"true",
";",
"i... | Internal method to trigger the menu creation process.
@return {@code true} if menu creation should proceed. | [
"Internal",
"method",
"to",
"trigger",
"the",
"menu",
"creation",
"process",
"."
] | 2c71339e756bcc0b1424c4525680549ba3a2dc97 | https://github.com/JakeWharton/ActionBarSherlock/blob/2c71339e756bcc0b1424c4525680549ba3a2dc97/actionbarsherlock/src/com/actionbarsherlock/ActionBarSherlock.java#L554-L568 |
113,373 | JakeWharton/ActionBarSherlock | actionbarsherlock/src/com/actionbarsherlock/ActionBarSherlock.java | ActionBarSherlock.callbackPrepareOptionsMenu | protected final boolean callbackPrepareOptionsMenu(Menu menu) {
if (DEBUG) Log.d(TAG, "[callbackPrepareOptionsMenu] menu: " + menu);
boolean result = true;
if (mActivity instanceof OnPreparePanelListener) {
OnPreparePanelListener listener = (OnPreparePanelListener)mActivity;
... | java | protected final boolean callbackPrepareOptionsMenu(Menu menu) {
if (DEBUG) Log.d(TAG, "[callbackPrepareOptionsMenu] menu: " + menu);
boolean result = true;
if (mActivity instanceof OnPreparePanelListener) {
OnPreparePanelListener listener = (OnPreparePanelListener)mActivity;
... | [
"protected",
"final",
"boolean",
"callbackPrepareOptionsMenu",
"(",
"Menu",
"menu",
")",
"{",
"if",
"(",
"DEBUG",
")",
"Log",
".",
"d",
"(",
"TAG",
",",
"\"[callbackPrepareOptionsMenu] menu: \"",
"+",
"menu",
")",
";",
"boolean",
"result",
"=",
"true",
";",
... | Internal method to trigger the menu preparation process.
@return {@code true} if menu preparation should proceed. | [
"Internal",
"method",
"to",
"trigger",
"the",
"menu",
"preparation",
"process",
"."
] | 2c71339e756bcc0b1424c4525680549ba3a2dc97 | https://github.com/JakeWharton/ActionBarSherlock/blob/2c71339e756bcc0b1424c4525680549ba3a2dc97/actionbarsherlock/src/com/actionbarsherlock/ActionBarSherlock.java#L575-L589 |
113,374 | JakeWharton/ActionBarSherlock | actionbarsherlock/src/com/actionbarsherlock/ActionBarSherlock.java | ActionBarSherlock.callbackOptionsItemSelected | protected final boolean callbackOptionsItemSelected(MenuItem item) {
if (DEBUG) Log.d(TAG, "[callbackOptionsItemSelected] item: " + item.getTitleCondensed());
boolean result = false;
if (mActivity instanceof OnMenuItemSelectedListener) {
OnMenuItemSelectedListener listener = (O... | java | protected final boolean callbackOptionsItemSelected(MenuItem item) {
if (DEBUG) Log.d(TAG, "[callbackOptionsItemSelected] item: " + item.getTitleCondensed());
boolean result = false;
if (mActivity instanceof OnMenuItemSelectedListener) {
OnMenuItemSelectedListener listener = (O... | [
"protected",
"final",
"boolean",
"callbackOptionsItemSelected",
"(",
"MenuItem",
"item",
")",
"{",
"if",
"(",
"DEBUG",
")",
"Log",
".",
"d",
"(",
"TAG",
",",
"\"[callbackOptionsItemSelected] item: \"",
"+",
"item",
".",
"getTitleCondensed",
"(",
")",
")",
";",
... | Internal method for dispatching options menu selection to the owning
activity callback.
@param item Selected options menu item.
@return {@code true} if the item selection was handled in the callback. | [
"Internal",
"method",
"for",
"dispatching",
"options",
"menu",
"selection",
"to",
"the",
"owning",
"activity",
"callback",
"."
] | 2c71339e756bcc0b1424c4525680549ba3a2dc97 | https://github.com/JakeWharton/ActionBarSherlock/blob/2c71339e756bcc0b1424c4525680549ba3a2dc97/actionbarsherlock/src/com/actionbarsherlock/ActionBarSherlock.java#L598-L612 |
113,375 | JakeWharton/ActionBarSherlock | actionbarsherlock/src/com/actionbarsherlock/ActionBarSherlock.java | ActionBarSherlock.setContentView | public void setContentView(View view) {
if (DEBUG) Log.d(TAG, "[setContentView] view: " + view);
setContentView(view, new ViewGroup.LayoutParams(MATCH_PARENT, MATCH_PARENT));
} | java | public void setContentView(View view) {
if (DEBUG) Log.d(TAG, "[setContentView] view: " + view);
setContentView(view, new ViewGroup.LayoutParams(MATCH_PARENT, MATCH_PARENT));
} | [
"public",
"void",
"setContentView",
"(",
"View",
"view",
")",
"{",
"if",
"(",
"DEBUG",
")",
"Log",
".",
"d",
"(",
"TAG",
",",
"\"[setContentView] view: \"",
"+",
"view",
")",
";",
"setContentView",
"(",
"view",
",",
"new",
"ViewGroup",
".",
"LayoutParams",... | Set the content of the activity inside the action bar.
@param view The desired content to display. | [
"Set",
"the",
"content",
"of",
"the",
"activity",
"inside",
"the",
"action",
"bar",
"."
] | 2c71339e756bcc0b1424c4525680549ba3a2dc97 | https://github.com/JakeWharton/ActionBarSherlock/blob/2c71339e756bcc0b1424c4525680549ba3a2dc97/actionbarsherlock/src/com/actionbarsherlock/ActionBarSherlock.java#L669-L673 |
113,376 | JakeWharton/ActionBarSherlock | actionbarsherlock/src/com/actionbarsherlock/ActionBarSherlock.java | ActionBarSherlock.setTitle | public void setTitle(int resId) {
if (DEBUG) Log.d(TAG, "[setTitle] resId: " + resId);
setTitle(mActivity.getString(resId));
} | java | public void setTitle(int resId) {
if (DEBUG) Log.d(TAG, "[setTitle] resId: " + resId);
setTitle(mActivity.getString(resId));
} | [
"public",
"void",
"setTitle",
"(",
"int",
"resId",
")",
"{",
"if",
"(",
"DEBUG",
")",
"Log",
".",
"d",
"(",
"TAG",
",",
"\"[setTitle] resId: \"",
"+",
"resId",
")",
";",
"setTitle",
"(",
"mActivity",
".",
"getString",
"(",
"resId",
")",
")",
";",
"}"... | Change the title associated with this activity. | [
"Change",
"the",
"title",
"associated",
"with",
"this",
"activity",
"."
] | 2c71339e756bcc0b1424c4525680549ba3a2dc97 | https://github.com/JakeWharton/ActionBarSherlock/blob/2c71339e756bcc0b1424c4525680549ba3a2dc97/actionbarsherlock/src/com/actionbarsherlock/ActionBarSherlock.java#L701-L705 |
113,377 | JakeWharton/ActionBarSherlock | actionbarsherlock/src/com/actionbarsherlock/ActionBarSherlock.java | ActionBarSherlock.getMenuInflater | public MenuInflater getMenuInflater() {
if (DEBUG) Log.d(TAG, "[getMenuInflater]");
// Make sure that action views can get an appropriate theme.
if (mMenuInflater == null) {
if (getActionBar() != null) {
mMenuInflater = new MenuInflater(getThemedContext(), mAct... | java | public MenuInflater getMenuInflater() {
if (DEBUG) Log.d(TAG, "[getMenuInflater]");
// Make sure that action views can get an appropriate theme.
if (mMenuInflater == null) {
if (getActionBar() != null) {
mMenuInflater = new MenuInflater(getThemedContext(), mAct... | [
"public",
"MenuInflater",
"getMenuInflater",
"(",
")",
"{",
"if",
"(",
"DEBUG",
")",
"Log",
".",
"d",
"(",
"TAG",
",",
"\"[getMenuInflater]\"",
")",
";",
"// Make sure that action views can get an appropriate theme.\r",
"if",
"(",
"mMenuInflater",
"==",
"null",
")",... | Get a menu inflater instance which supports the newer menu attributes.
@return Menu inflater instance. | [
"Get",
"a",
"menu",
"inflater",
"instance",
"which",
"supports",
"the",
"newer",
"menu",
"attributes",
"."
] | 2c71339e756bcc0b1424c4525680549ba3a2dc97 | https://github.com/JakeWharton/ActionBarSherlock/blob/2c71339e756bcc0b1424c4525680549ba3a2dc97/actionbarsherlock/src/com/actionbarsherlock/ActionBarSherlock.java#L770-L782 |
113,378 | JakeWharton/ActionBarSherlock | actionbarsherlock/src/com/actionbarsherlock/internal/widget/IcsAbsSpinner.java | IcsAbsSpinner.setAdapter | @Override
public void setAdapter(SpinnerAdapter adapter) {
if (null != mAdapter) {
mAdapter.unregisterDataSetObserver(mDataSetObserver);
resetList();
}
mAdapter = adapter;
mOldSelectedPosition = INVALID_POSITION;
mOldSelectedRowId = INVALID_ROW_ID;
... | java | @Override
public void setAdapter(SpinnerAdapter adapter) {
if (null != mAdapter) {
mAdapter.unregisterDataSetObserver(mDataSetObserver);
resetList();
}
mAdapter = adapter;
mOldSelectedPosition = INVALID_POSITION;
mOldSelectedRowId = INVALID_ROW_ID;
... | [
"@",
"Override",
"public",
"void",
"setAdapter",
"(",
"SpinnerAdapter",
"adapter",
")",
"{",
"if",
"(",
"null",
"!=",
"mAdapter",
")",
"{",
"mAdapter",
".",
"unregisterDataSetObserver",
"(",
"mDataSetObserver",
")",
";",
"resetList",
"(",
")",
";",
"}",
"mAd... | The Adapter is used to provide the data which backs this Spinner.
It also provides methods to transform spinner items based on their position
relative to the selected item.
@param adapter The SpinnerAdapter to use for this Spinner | [
"The",
"Adapter",
"is",
"used",
"to",
"provide",
"the",
"data",
"which",
"backs",
"this",
"Spinner",
".",
"It",
"also",
"provides",
"methods",
"to",
"transform",
"spinner",
"items",
"based",
"on",
"their",
"position",
"relative",
"to",
"the",
"selected",
"it... | 2c71339e756bcc0b1424c4525680549ba3a2dc97 | https://github.com/JakeWharton/ActionBarSherlock/blob/2c71339e756bcc0b1424c4525680549ba3a2dc97/actionbarsherlock/src/com/actionbarsherlock/internal/widget/IcsAbsSpinner.java#L102-L140 |
113,379 | JakeWharton/ActionBarSherlock | actionbarsherlock/src/com/actionbarsherlock/internal/widget/IcsAbsSpinner.java | IcsAbsSpinner.resetList | void resetList() {
mDataChanged = false;
mNeedSync = false;
removeAllViewsInLayout();
mOldSelectedPosition = INVALID_POSITION;
mOldSelectedRowId = INVALID_ROW_ID;
setSelectedPositionInt(INVALID_POSITION);
setNextSelectedPositionInt(INVALID_POSITION);
inv... | java | void resetList() {
mDataChanged = false;
mNeedSync = false;
removeAllViewsInLayout();
mOldSelectedPosition = INVALID_POSITION;
mOldSelectedRowId = INVALID_ROW_ID;
setSelectedPositionInt(INVALID_POSITION);
setNextSelectedPositionInt(INVALID_POSITION);
inv... | [
"void",
"resetList",
"(",
")",
"{",
"mDataChanged",
"=",
"false",
";",
"mNeedSync",
"=",
"false",
";",
"removeAllViewsInLayout",
"(",
")",
";",
"mOldSelectedPosition",
"=",
"INVALID_POSITION",
";",
"mOldSelectedRowId",
"=",
"INVALID_ROW_ID",
";",
"setSelectedPositio... | Clear out all children from the list | [
"Clear",
"out",
"all",
"children",
"from",
"the",
"list"
] | 2c71339e756bcc0b1424c4525680549ba3a2dc97 | https://github.com/JakeWharton/ActionBarSherlock/blob/2c71339e756bcc0b1424c4525680549ba3a2dc97/actionbarsherlock/src/com/actionbarsherlock/internal/widget/IcsAbsSpinner.java#L145-L156 |
113,380 | JakeWharton/ActionBarSherlock | actionbarsherlock/src/com/actionbarsherlock/internal/widget/IcsAbsSpinner.java | IcsAbsSpinner.setSelection | public void setSelection(int position, boolean animate) {
// Animate only if requested position is already on screen somewhere
boolean shouldAnimate = animate && mFirstPosition <= position &&
position <= mFirstPosition + getChildCount() - 1;
setSelectionInt(position, shouldAnimat... | java | public void setSelection(int position, boolean animate) {
// Animate only if requested position is already on screen somewhere
boolean shouldAnimate = animate && mFirstPosition <= position &&
position <= mFirstPosition + getChildCount() - 1;
setSelectionInt(position, shouldAnimat... | [
"public",
"void",
"setSelection",
"(",
"int",
"position",
",",
"boolean",
"animate",
")",
"{",
"// Animate only if requested position is already on screen somewhere",
"boolean",
"shouldAnimate",
"=",
"animate",
"&&",
"mFirstPosition",
"<=",
"position",
"&&",
"position",
"... | Jump directly to a specific item in the adapter data. | [
"Jump",
"directly",
"to",
"a",
"specific",
"item",
"in",
"the",
"adapter",
"data",
"."
] | 2c71339e756bcc0b1424c4525680549ba3a2dc97 | https://github.com/JakeWharton/ActionBarSherlock/blob/2c71339e756bcc0b1424c4525680549ba3a2dc97/actionbarsherlock/src/com/actionbarsherlock/internal/widget/IcsAbsSpinner.java#L278-L283 |
113,381 | JakeWharton/ActionBarSherlock | actionbarsherlock/src/com/actionbarsherlock/internal/widget/IcsAbsSpinner.java | IcsAbsSpinner.setSelectionInt | void setSelectionInt(int position, boolean animate) {
if (position != mOldSelectedPosition) {
mBlockLayoutRequests = true;
int delta = position - mSelectedPosition;
setNextSelectedPositionInt(position);
layout(delta, animate);
mBlockLayoutRequests = f... | java | void setSelectionInt(int position, boolean animate) {
if (position != mOldSelectedPosition) {
mBlockLayoutRequests = true;
int delta = position - mSelectedPosition;
setNextSelectedPositionInt(position);
layout(delta, animate);
mBlockLayoutRequests = f... | [
"void",
"setSelectionInt",
"(",
"int",
"position",
",",
"boolean",
"animate",
")",
"{",
"if",
"(",
"position",
"!=",
"mOldSelectedPosition",
")",
"{",
"mBlockLayoutRequests",
"=",
"true",
";",
"int",
"delta",
"=",
"position",
"-",
"mSelectedPosition",
";",
"se... | Makes the item at the supplied position selected.
@param position Position to select
@param animate Should the transition be animated | [
"Makes",
"the",
"item",
"at",
"the",
"supplied",
"position",
"selected",
"."
] | 2c71339e756bcc0b1424c4525680549ba3a2dc97 | https://github.com/JakeWharton/ActionBarSherlock/blob/2c71339e756bcc0b1424c4525680549ba3a2dc97/actionbarsherlock/src/com/actionbarsherlock/internal/widget/IcsAbsSpinner.java#L300-L308 |
113,382 | JakeWharton/ActionBarSherlock | actionbarsherlock/src/com/actionbarsherlock/internal/widget/IcsAbsSpinner.java | IcsAbsSpinner.pointToPosition | public int pointToPosition(int x, int y) {
Rect frame = mTouchFrame;
if (frame == null) {
mTouchFrame = new Rect();
frame = mTouchFrame;
}
final int count = getChildCount();
for (int i = count - 1; i >= 0; i--) {
View child = getChildAt(i);
... | java | public int pointToPosition(int x, int y) {
Rect frame = mTouchFrame;
if (frame == null) {
mTouchFrame = new Rect();
frame = mTouchFrame;
}
final int count = getChildCount();
for (int i = count - 1; i >= 0; i--) {
View child = getChildAt(i);
... | [
"public",
"int",
"pointToPosition",
"(",
"int",
"x",
",",
"int",
"y",
")",
"{",
"Rect",
"frame",
"=",
"mTouchFrame",
";",
"if",
"(",
"frame",
"==",
"null",
")",
"{",
"mTouchFrame",
"=",
"new",
"Rect",
"(",
")",
";",
"frame",
"=",
"mTouchFrame",
";",
... | Maps a point to a position in the list.
@param x X in local coordinate
@param y Y in local coordinate
@return The position of the item which contains the specified point, or
{@link #INVALID_POSITION} if the point does not intersect an item. | [
"Maps",
"a",
"point",
"to",
"a",
"position",
"in",
"the",
"list",
"."
] | 2c71339e756bcc0b1424c4525680549ba3a2dc97 | https://github.com/JakeWharton/ActionBarSherlock/blob/2c71339e756bcc0b1424c4525680549ba3a2dc97/actionbarsherlock/src/com/actionbarsherlock/internal/widget/IcsAbsSpinner.java#L352-L370 |
113,383 | JakeWharton/ActionBarSherlock | actionbarsherlock/src/com/actionbarsherlock/internal/widget/IcsLinearLayout.java | IcsLinearLayout.setDividerDrawable | public void setDividerDrawable(Drawable divider) {
if (divider == mDivider) {
return;
}
//Fix for issue #379
if (divider instanceof ColorDrawable && Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) {
divider = new IcsColorDrawable((ColorDrawable) divider);
... | java | public void setDividerDrawable(Drawable divider) {
if (divider == mDivider) {
return;
}
//Fix for issue #379
if (divider instanceof ColorDrawable && Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) {
divider = new IcsColorDrawable((ColorDrawable) divider);
... | [
"public",
"void",
"setDividerDrawable",
"(",
"Drawable",
"divider",
")",
"{",
"if",
"(",
"divider",
"==",
"mDivider",
")",
"{",
"return",
";",
"}",
"//Fix for issue #379",
"if",
"(",
"divider",
"instanceof",
"ColorDrawable",
"&&",
"Build",
".",
"VERSION",
".",... | Set a drawable to be used as a divider between items.
@param divider Drawable that will divide each item.
@see #setShowDividers(int) | [
"Set",
"a",
"drawable",
"to",
"be",
"used",
"as",
"a",
"divider",
"between",
"items",
"."
] | 2c71339e756bcc0b1424c4525680549ba3a2dc97 | https://github.com/JakeWharton/ActionBarSherlock/blob/2c71339e756bcc0b1424c4525680549ba3a2dc97/actionbarsherlock/src/com/actionbarsherlock/internal/widget/IcsLinearLayout.java#L95-L115 |
113,384 | JakeWharton/ActionBarSherlock | actionbarsherlock/src/com/actionbarsherlock/internal/widget/IcsLinearLayout.java | IcsLinearLayout.hasDividerBeforeChildAt | protected boolean hasDividerBeforeChildAt(int childIndex) {
if (childIndex == 0) {
return (mShowDividers & SHOW_DIVIDER_BEGINNING) != 0;
} else if (childIndex == getChildCount()) {
return (mShowDividers & SHOW_DIVIDER_END) != 0;
} else if ((mShowDividers & SHOW_DIVIDER_MI... | java | protected boolean hasDividerBeforeChildAt(int childIndex) {
if (childIndex == 0) {
return (mShowDividers & SHOW_DIVIDER_BEGINNING) != 0;
} else if (childIndex == getChildCount()) {
return (mShowDividers & SHOW_DIVIDER_END) != 0;
} else if ((mShowDividers & SHOW_DIVIDER_MI... | [
"protected",
"boolean",
"hasDividerBeforeChildAt",
"(",
"int",
"childIndex",
")",
"{",
"if",
"(",
"childIndex",
"==",
"0",
")",
"{",
"return",
"(",
"mShowDividers",
"&",
"SHOW_DIVIDER_BEGINNING",
")",
"!=",
"0",
";",
"}",
"else",
"if",
"(",
"childIndex",
"==... | Determines where to position dividers between children.
@param childIndex Index of child to check for preceding divider
@return true if there should be a divider before the child at childIndex
@hide Pending API consideration. Currently only used internally by the system. | [
"Determines",
"where",
"to",
"position",
"dividers",
"between",
"children",
"."
] | 2c71339e756bcc0b1424c4525680549ba3a2dc97 | https://github.com/JakeWharton/ActionBarSherlock/blob/2c71339e756bcc0b1424c4525680549ba3a2dc97/actionbarsherlock/src/com/actionbarsherlock/internal/widget/IcsLinearLayout.java#L263-L279 |
113,385 | JakeWharton/ActionBarSherlock | actionbarsherlock/src/com/actionbarsherlock/widget/ActivityChooserView.java | ActivityChooserView.showPopupUnchecked | private void showPopupUnchecked(int maxActivityCount) {
if (mAdapter.getDataModel() == null) {
throw new IllegalStateException("No data model. Did you call #setDataModel?");
}
getViewTreeObserver().addOnGlobalLayoutListener(mOnGlobalLayoutListener);
final boolean defaultAct... | java | private void showPopupUnchecked(int maxActivityCount) {
if (mAdapter.getDataModel() == null) {
throw new IllegalStateException("No data model. Did you call #setDataModel?");
}
getViewTreeObserver().addOnGlobalLayoutListener(mOnGlobalLayoutListener);
final boolean defaultAct... | [
"private",
"void",
"showPopupUnchecked",
"(",
"int",
"maxActivityCount",
")",
"{",
"if",
"(",
"mAdapter",
".",
"getDataModel",
"(",
")",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"\"No data model. Did you call #setDataModel?\"",
")",
";",... | Shows the popup no matter if it was already showing.
@param maxActivityCount The max number of activities to display. | [
"Shows",
"the",
"popup",
"no",
"matter",
"if",
"it",
"was",
"already",
"showing",
"."
] | 2c71339e756bcc0b1424c4525680549ba3a2dc97 | https://github.com/JakeWharton/ActionBarSherlock/blob/2c71339e756bcc0b1424c4525680549ba3a2dc97/actionbarsherlock/src/com/actionbarsherlock/widget/ActivityChooserView.java#L329-L366 |
113,386 | JakeWharton/ActionBarSherlock | actionbarsherlock/src/com/actionbarsherlock/widget/ActivityChooserView.java | ActivityChooserView.dismissPopup | public boolean dismissPopup() {
if (isShowingPopup()) {
getListPopupWindow().dismiss();
ViewTreeObserver viewTreeObserver = getViewTreeObserver();
if (viewTreeObserver.isAlive()) {
viewTreeObserver.removeGlobalOnLayoutListener(mOnGlobalLayoutListener);
... | java | public boolean dismissPopup() {
if (isShowingPopup()) {
getListPopupWindow().dismiss();
ViewTreeObserver viewTreeObserver = getViewTreeObserver();
if (viewTreeObserver.isAlive()) {
viewTreeObserver.removeGlobalOnLayoutListener(mOnGlobalLayoutListener);
... | [
"public",
"boolean",
"dismissPopup",
"(",
")",
"{",
"if",
"(",
"isShowingPopup",
"(",
")",
")",
"{",
"getListPopupWindow",
"(",
")",
".",
"dismiss",
"(",
")",
";",
"ViewTreeObserver",
"viewTreeObserver",
"=",
"getViewTreeObserver",
"(",
")",
";",
"if",
"(",
... | Dismisses the popup window with activities.
@return True if dismissed, false if already dismissed. | [
"Dismisses",
"the",
"popup",
"window",
"with",
"activities",
"."
] | 2c71339e756bcc0b1424c4525680549ba3a2dc97 | https://github.com/JakeWharton/ActionBarSherlock/blob/2c71339e756bcc0b1424c4525680549ba3a2dc97/actionbarsherlock/src/com/actionbarsherlock/widget/ActivityChooserView.java#L373-L382 |
113,387 | JakeWharton/ActionBarSherlock | actionbarsherlock/src/com/actionbarsherlock/widget/ActivityChooserView.java | ActivityChooserView.getListPopupWindow | private IcsListPopupWindow getListPopupWindow() {
if (mListPopupWindow == null) {
mListPopupWindow = new IcsListPopupWindow(getContext());
mListPopupWindow.setAdapter(mAdapter);
mListPopupWindow.setAnchorView(ActivityChooserView.this);
mListPopupWindow.setModal(tr... | java | private IcsListPopupWindow getListPopupWindow() {
if (mListPopupWindow == null) {
mListPopupWindow = new IcsListPopupWindow(getContext());
mListPopupWindow.setAdapter(mAdapter);
mListPopupWindow.setAnchorView(ActivityChooserView.this);
mListPopupWindow.setModal(tr... | [
"private",
"IcsListPopupWindow",
"getListPopupWindow",
"(",
")",
"{",
"if",
"(",
"mListPopupWindow",
"==",
"null",
")",
"{",
"mListPopupWindow",
"=",
"new",
"IcsListPopupWindow",
"(",
"getContext",
"(",
")",
")",
";",
"mListPopupWindow",
".",
"setAdapter",
"(",
... | Gets the list popup window which is lazily initialized.
@return The popup. | [
"Gets",
"the",
"list",
"popup",
"window",
"which",
"is",
"lazily",
"initialized",
"."
] | 2c71339e756bcc0b1424c4525680549ba3a2dc97 | https://github.com/JakeWharton/ActionBarSherlock/blob/2c71339e756bcc0b1424c4525680549ba3a2dc97/actionbarsherlock/src/com/actionbarsherlock/widget/ActivityChooserView.java#L493-L503 |
113,388 | JakeWharton/ActionBarSherlock | actionbarsherlock/src/com/actionbarsherlock/widget/ActivityChooserView.java | ActivityChooserView.updateAppearance | private void updateAppearance() {
// Expand overflow button.
if (mAdapter.getCount() > 0) {
mExpandActivityOverflowButton.setEnabled(true);
} else {
mExpandActivityOverflowButton.setEnabled(false);
}
// Default activity button.
final int activityCo... | java | private void updateAppearance() {
// Expand overflow button.
if (mAdapter.getCount() > 0) {
mExpandActivityOverflowButton.setEnabled(true);
} else {
mExpandActivityOverflowButton.setEnabled(false);
}
// Default activity button.
final int activityCo... | [
"private",
"void",
"updateAppearance",
"(",
")",
"{",
"// Expand overflow button.",
"if",
"(",
"mAdapter",
".",
"getCount",
"(",
")",
">",
"0",
")",
"{",
"mExpandActivityOverflowButton",
".",
"setEnabled",
"(",
"true",
")",
";",
"}",
"else",
"{",
"mExpandActiv... | Updates the buttons state. | [
"Updates",
"the",
"buttons",
"state",
"."
] | 2c71339e756bcc0b1424c4525680549ba3a2dc97 | https://github.com/JakeWharton/ActionBarSherlock/blob/2c71339e756bcc0b1424c4525680549ba3a2dc97/actionbarsherlock/src/com/actionbarsherlock/widget/ActivityChooserView.java#L508-L542 |
113,389 | JakeWharton/ActionBarSherlock | actionbarsherlock/src/com/actionbarsherlock/internal/view/menu/MenuItemImpl.java | MenuItemImpl.invoke | public boolean invoke() {
if (mClickListener != null &&
mClickListener.onMenuItemClick(this)) {
return true;
}
if (mMenu.dispatchMenuItemSelected(mMenu.getRootMenu(), this)) {
return true;
}
if (mItemCallback != null) {
mItemCallb... | java | public boolean invoke() {
if (mClickListener != null &&
mClickListener.onMenuItemClick(this)) {
return true;
}
if (mMenu.dispatchMenuItemSelected(mMenu.getRootMenu(), this)) {
return true;
}
if (mItemCallback != null) {
mItemCallb... | [
"public",
"boolean",
"invoke",
"(",
")",
"{",
"if",
"(",
"mClickListener",
"!=",
"null",
"&&",
"mClickListener",
".",
"onMenuItemClick",
"(",
"this",
")",
")",
"{",
"return",
"true",
";",
"}",
"if",
"(",
"mMenu",
".",
"dispatchMenuItemSelected",
"(",
"mMen... | Invokes the item by calling various listeners or callbacks.
@return true if the invocation was handled, false otherwise | [
"Invokes",
"the",
"item",
"by",
"calling",
"various",
"listeners",
"or",
"callbacks",
"."
] | 2c71339e756bcc0b1424c4525680549ba3a2dc97 | https://github.com/JakeWharton/ActionBarSherlock/blob/2c71339e756bcc0b1424c4525680549ba3a2dc97/actionbarsherlock/src/com/actionbarsherlock/internal/view/menu/MenuItemImpl.java#L142-L171 |
113,390 | VerbalExpressions/JavaVerbalExpressions | src/main/java/ru/lanwen/verbalregex/VerbalExpression.java | VerbalExpression.getText | public String getText(final String toTest, final int group) {
Matcher m = pattern.matcher(toTest);
StringBuilder result = new StringBuilder();
while (m.find()) {
result.append(m.group(group));
}
return result.toString();
} | java | public String getText(final String toTest, final int group) {
Matcher m = pattern.matcher(toTest);
StringBuilder result = new StringBuilder();
while (m.find()) {
result.append(m.group(group));
}
return result.toString();
} | [
"public",
"String",
"getText",
"(",
"final",
"String",
"toTest",
",",
"final",
"int",
"group",
")",
"{",
"Matcher",
"m",
"=",
"pattern",
".",
"matcher",
"(",
"toTest",
")",
";",
"StringBuilder",
"result",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"whil... | Extract exact group from string
@param toTest - string to extract from
@param group - group to extract
@return extracted group
@since 1.1 | [
"Extract",
"exact",
"group",
"from",
"string"
] | 4ee34e6c96ea2cf8335e3b425afa44c535229347 | https://github.com/VerbalExpressions/JavaVerbalExpressions/blob/4ee34e6c96ea2cf8335e3b425afa44c535229347/src/main/java/ru/lanwen/verbalregex/VerbalExpression.java#L742-L749 |
113,391 | VerbalExpressions/JavaVerbalExpressions | src/main/java/ru/lanwen/verbalregex/VerbalExpression.java | VerbalExpression.getTextGroups | public List<String> getTextGroups(final String toTest, final int group) {
List<String> groups = new ArrayList<>();
Matcher m = pattern.matcher(toTest);
while (m.find()) {
groups.add(m.group(group));
}
return groups;
} | java | public List<String> getTextGroups(final String toTest, final int group) {
List<String> groups = new ArrayList<>();
Matcher m = pattern.matcher(toTest);
while (m.find()) {
groups.add(m.group(group));
}
return groups;
} | [
"public",
"List",
"<",
"String",
">",
"getTextGroups",
"(",
"final",
"String",
"toTest",
",",
"final",
"int",
"group",
")",
"{",
"List",
"<",
"String",
">",
"groups",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"Matcher",
"m",
"=",
"pattern",
".",
... | Extract exact group from string and add it to list
Example:
String text = "SampleHelloWorldString";
VerbalExpression regex = regex().capt().oneOf("Hello", "World").endCapt().maybe("String").build();
list = regex.getTextGroups(text, 0) //result: "Hello", "WorldString"
list = regex.getTextGroups(text, 1) //result: "Hell... | [
"Extract",
"exact",
"group",
"from",
"string",
"and",
"add",
"it",
"to",
"list"
] | 4ee34e6c96ea2cf8335e3b425afa44c535229347 | https://github.com/VerbalExpressions/JavaVerbalExpressions/blob/4ee34e6c96ea2cf8335e3b425afa44c535229347/src/main/java/ru/lanwen/verbalregex/VerbalExpression.java#L783-L790 |
113,392 | VerbalExpressions/JavaVerbalExpressions | src/main/java/ru/lanwen/verbalregex/VerbalExpression.java | VerbalExpression.regex | public static Builder regex(final Builder pBuilder) {
Builder builder = new Builder();
//Using created StringBuilder
builder.prefixes.append(pBuilder.prefixes);
builder.source.append(pBuilder.source);
builder.suffixes.append(pBuilder.suffixes);
builder.modifiers = pBuild... | java | public static Builder regex(final Builder pBuilder) {
Builder builder = new Builder();
//Using created StringBuilder
builder.prefixes.append(pBuilder.prefixes);
builder.source.append(pBuilder.source);
builder.suffixes.append(pBuilder.suffixes);
builder.modifiers = pBuild... | [
"public",
"static",
"Builder",
"regex",
"(",
"final",
"Builder",
"pBuilder",
")",
"{",
"Builder",
"builder",
"=",
"new",
"Builder",
"(",
")",
";",
"//Using created StringBuilder",
"builder",
".",
"prefixes",
".",
"append",
"(",
"pBuilder",
".",
"prefixes",
")"... | Creates new instance of VerbalExpression builder from cloned builder
@param pBuilder - instance to clone
@return new VerbalExpression.Builder copied from passed
@since 1.1 | [
"Creates",
"new",
"instance",
"of",
"VerbalExpression",
"builder",
"from",
"cloned",
"builder"
] | 4ee34e6c96ea2cf8335e3b425afa44c535229347 | https://github.com/VerbalExpressions/JavaVerbalExpressions/blob/4ee34e6c96ea2cf8335e3b425afa44c535229347/src/main/java/ru/lanwen/verbalregex/VerbalExpression.java#L804-L814 |
113,393 | jmrozanec/cron-utils | src/main/java/com/cronutils/model/field/constraint/FieldConstraintsBuilder.java | FieldConstraintsBuilder.forField | public FieldConstraintsBuilder forField(final CronFieldName field) {
switch (field) {
case SECOND:
case MINUTE:
endRange = 59;
return this;
case HOUR:
endRange = 23;
return this;
case DAY_OF_WEEK:
... | java | public FieldConstraintsBuilder forField(final CronFieldName field) {
switch (field) {
case SECOND:
case MINUTE:
endRange = 59;
return this;
case HOUR:
endRange = 23;
return this;
case DAY_OF_WEEK:
... | [
"public",
"FieldConstraintsBuilder",
"forField",
"(",
"final",
"CronFieldName",
"field",
")",
"{",
"switch",
"(",
"field",
")",
"{",
"case",
"SECOND",
":",
"case",
"MINUTE",
":",
"endRange",
"=",
"59",
";",
"return",
"this",
";",
"case",
"HOUR",
":",
"endR... | Creates range constraints according to CronFieldName parameter.
@param field - CronFieldName
@return FieldConstraintsBuilder instance | [
"Creates",
"range",
"constraints",
"according",
"to",
"CronFieldName",
"parameter",
"."
] | adac5ec8fd9160b082f9762a6eedea0715731170 | https://github.com/jmrozanec/cron-utils/blob/adac5ec8fd9160b082f9762a6eedea0715731170/src/main/java/com/cronutils/model/field/constraint/FieldConstraintsBuilder.java#L53-L82 |
113,394 | jmrozanec/cron-utils | src/main/java/com/cronutils/model/field/constraint/FieldConstraintsBuilder.java | FieldConstraintsBuilder.daysOfWeekMapping | private static Map<String, Integer> daysOfWeekMapping() {
final Map<String, Integer> stringMapping = new HashMap<>();
stringMapping.put("MON", 1);
stringMapping.put("TUE", 2);
stringMapping.put("WED", 3);
stringMapping.put("THU", 4);
stringMapping.put("FRI", 5);
s... | java | private static Map<String, Integer> daysOfWeekMapping() {
final Map<String, Integer> stringMapping = new HashMap<>();
stringMapping.put("MON", 1);
stringMapping.put("TUE", 2);
stringMapping.put("WED", 3);
stringMapping.put("THU", 4);
stringMapping.put("FRI", 5);
s... | [
"private",
"static",
"Map",
"<",
"String",
",",
"Integer",
">",
"daysOfWeekMapping",
"(",
")",
"{",
"final",
"Map",
"<",
"String",
",",
"Integer",
">",
"stringMapping",
"=",
"new",
"HashMap",
"<>",
"(",
")",
";",
"stringMapping",
".",
"put",
"(",
"\"MON\... | Creates days of week mapping.
@return Map where strings are weekday names in EEE format and integers correspond to their 1-7 mappings | [
"Creates",
"days",
"of",
"week",
"mapping",
"."
] | adac5ec8fd9160b082f9762a6eedea0715731170 | https://github.com/jmrozanec/cron-utils/blob/adac5ec8fd9160b082f9762a6eedea0715731170/src/main/java/com/cronutils/model/field/constraint/FieldConstraintsBuilder.java#L195-L205 |
113,395 | jmrozanec/cron-utils | src/main/java/com/cronutils/model/field/constraint/FieldConstraintsBuilder.java | FieldConstraintsBuilder.monthsMapping | private static Map<String, Integer> monthsMapping() {
final Map<String, Integer> stringMapping = new HashMap<>();
stringMapping.put("JAN", 1);
stringMapping.put("FEB", 2);
stringMapping.put("MAR", 3);
stringMapping.put("APR", 4);
stringMapping.put("MAY", 5);
strin... | java | private static Map<String, Integer> monthsMapping() {
final Map<String, Integer> stringMapping = new HashMap<>();
stringMapping.put("JAN", 1);
stringMapping.put("FEB", 2);
stringMapping.put("MAR", 3);
stringMapping.put("APR", 4);
stringMapping.put("MAY", 5);
strin... | [
"private",
"static",
"Map",
"<",
"String",
",",
"Integer",
">",
"monthsMapping",
"(",
")",
"{",
"final",
"Map",
"<",
"String",
",",
"Integer",
">",
"stringMapping",
"=",
"new",
"HashMap",
"<>",
"(",
")",
";",
"stringMapping",
".",
"put",
"(",
"\"JAN\"",
... | Creates months mapping.
@return Map where strings month names in EEE format, and integers correspond to their 1-12 mappings | [
"Creates",
"months",
"mapping",
"."
] | adac5ec8fd9160b082f9762a6eedea0715731170 | https://github.com/jmrozanec/cron-utils/blob/adac5ec8fd9160b082f9762a6eedea0715731170/src/main/java/com/cronutils/model/field/constraint/FieldConstraintsBuilder.java#L212-L227 |
113,396 | jmrozanec/cron-utils | src/main/java/com/cronutils/utils/Preconditions.java | Preconditions.checkNotNullNorEmpty | public static String checkNotNullNorEmpty(final String reference, final Object errorMessage) {
if (reference == null) {
throw new NullPointerException(String.valueOf(errorMessage));
}
if (reference.isEmpty()) {
throw new IllegalArgumentException(String.valueOf(errorMessag... | java | public static String checkNotNullNorEmpty(final String reference, final Object errorMessage) {
if (reference == null) {
throw new NullPointerException(String.valueOf(errorMessage));
}
if (reference.isEmpty()) {
throw new IllegalArgumentException(String.valueOf(errorMessag... | [
"public",
"static",
"String",
"checkNotNullNorEmpty",
"(",
"final",
"String",
"reference",
",",
"final",
"Object",
"errorMessage",
")",
"{",
"if",
"(",
"reference",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
"String",
".",
"valueOf",
... | Ensures that a string reference passed as a parameter to the calling method is not null.
nor empty.
@param reference a string reference
@param errorMessage the exception message to use if the check fails; will be converted to a
string using {@link String#valueOf(Object)}
@return the non-null reference that was vali... | [
"Ensures",
"that",
"a",
"string",
"reference",
"passed",
"as",
"a",
"parameter",
"to",
"the",
"calling",
"method",
"is",
"not",
"null",
".",
"nor",
"empty",
"."
] | adac5ec8fd9160b082f9762a6eedea0715731170 | https://github.com/jmrozanec/cron-utils/blob/adac5ec8fd9160b082f9762a6eedea0715731170/src/main/java/com/cronutils/utils/Preconditions.java#L201-L209 |
113,397 | jmrozanec/cron-utils | src/main/java/com/cronutils/mapper/CronMapper.java | CronMapper.map | public Cron map(final Cron cron) {
Preconditions.checkNotNull(cron, "Cron must not be null");
final List<CronField> fields = new ArrayList<>();
for (final CronFieldName name : CronFieldName.values()) {
if (mappings.containsKey(name)) {
fields.add(mappings.get(name).ap... | java | public Cron map(final Cron cron) {
Preconditions.checkNotNull(cron, "Cron must not be null");
final List<CronField> fields = new ArrayList<>();
for (final CronFieldName name : CronFieldName.values()) {
if (mappings.containsKey(name)) {
fields.add(mappings.get(name).ap... | [
"public",
"Cron",
"map",
"(",
"final",
"Cron",
"cron",
")",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"cron",
",",
"\"Cron must not be null\"",
")",
";",
"final",
"List",
"<",
"CronField",
">",
"fields",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
... | Maps given cron to target cron definition.
@param cron - Instance to be mapped;
if null a NullPointerException will be raised
@return new Cron instance, never null; | [
"Maps",
"given",
"cron",
"to",
"target",
"cron",
"definition",
"."
] | adac5ec8fd9160b082f9762a6eedea0715731170 | https://github.com/jmrozanec/cron-utils/blob/adac5ec8fd9160b082f9762a6eedea0715731170/src/main/java/com/cronutils/mapper/CronMapper.java#L75-L84 |
113,398 | jmrozanec/cron-utils | src/main/java/com/cronutils/mapper/CronMapper.java | CronMapper.fromCron4jToQuartz | public static CronMapper fromCron4jToQuartz() {
return new CronMapper(
CronDefinitionBuilder.instanceDefinitionFor(CronType.CRON4J),
CronDefinitionBuilder.instanceDefinitionFor(CronType.QUARTZ),
setQuestionMark()
);
} | java | public static CronMapper fromCron4jToQuartz() {
return new CronMapper(
CronDefinitionBuilder.instanceDefinitionFor(CronType.CRON4J),
CronDefinitionBuilder.instanceDefinitionFor(CronType.QUARTZ),
setQuestionMark()
);
} | [
"public",
"static",
"CronMapper",
"fromCron4jToQuartz",
"(",
")",
"{",
"return",
"new",
"CronMapper",
"(",
"CronDefinitionBuilder",
".",
"instanceDefinitionFor",
"(",
"CronType",
".",
"CRON4J",
")",
",",
"CronDefinitionBuilder",
".",
"instanceDefinitionFor",
"(",
"Cro... | Creates a CronMapper that maps a cron4j expression to a quartz expression.
@return a CronMapper for mapping from cron4j to quartz | [
"Creates",
"a",
"CronMapper",
"that",
"maps",
"a",
"cron4j",
"expression",
"to",
"a",
"quartz",
"expression",
"."
] | adac5ec8fd9160b082f9762a6eedea0715731170 | https://github.com/jmrozanec/cron-utils/blob/adac5ec8fd9160b082f9762a6eedea0715731170/src/main/java/com/cronutils/mapper/CronMapper.java#L90-L96 |
113,399 | jmrozanec/cron-utils | src/main/java/com/cronutils/mapper/CronMapper.java | CronMapper.buildMappings | private void buildMappings(final CronDefinition from, final CronDefinition to) {
final Map<CronFieldName, FieldDefinition> sourceFieldDefinitions = getFieldDefinitions(from);
final Map<CronFieldName, FieldDefinition> destFieldDefinitions = getFieldDefinitions(to);
boolean startedDestMapping = fa... | java | private void buildMappings(final CronDefinition from, final CronDefinition to) {
final Map<CronFieldName, FieldDefinition> sourceFieldDefinitions = getFieldDefinitions(from);
final Map<CronFieldName, FieldDefinition> destFieldDefinitions = getFieldDefinitions(to);
boolean startedDestMapping = fa... | [
"private",
"void",
"buildMappings",
"(",
"final",
"CronDefinition",
"from",
",",
"final",
"CronDefinition",
"to",
")",
"{",
"final",
"Map",
"<",
"CronFieldName",
",",
"FieldDefinition",
">",
"sourceFieldDefinitions",
"=",
"getFieldDefinitions",
"(",
"from",
")",
"... | Builds functions that map the fields from source CronDefinition to target.
@param from - source CronDefinition
@param to - target CronDefinition | [
"Builds",
"functions",
"that",
"map",
"the",
"fields",
"from",
"source",
"CronDefinition",
"to",
"target",
"."
] | adac5ec8fd9160b082f9762a6eedea0715731170 | https://github.com/jmrozanec/cron-utils/blob/adac5ec8fd9160b082f9762a6eedea0715731170/src/main/java/com/cronutils/mapper/CronMapper.java#L163-L199 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.