content
stringlengths
40
137k
"public String getRowSelectionScript() {\n if (currentData == null)\n return null;\n List<Integer> indexToUpdate;\n if (!hasOnRender && (bgColorScript != null || (getRowSelectedStyle() != null && getRowSelectedStyle().getAttributeCount() > 0)) && (indexToUpdate = getIndexToUpdate()) != null) {\n int firstRow = table.getCurrentPage() * table.getRowsPerPage();\n int lastRow = firstRow + table.getViewSize() - 1;\n int[] newSelectedIndexes = getSelectedIndexes();\n AppendingStringBuffer sab = new AppendingStringBuffer();\n for (int rowIdx : indexToUpdate) {\n if (rowIdx >= firstRow && rowIdx <= lastRow) {\n ListItem<IRecordInternal> selectedListItem = (ListItem<IRecordInternal>) table.get(Integer.toString(rowIdx));\n if (selectedListItem != null) {\n String selectedId = selectedListItem.getMarkupId();\n boolean isSelected = Arrays.binarySearch(newSelectedIndexes, rowIdx) >= 0;\n Object selectedColor = getListItemBgColor(selectedListItem, isSelected);\n Object selectedFgColor = getListItemFgColor(selectedListItem, isSelected);\n Object selectedFont = getListItemFont(selectedListItem, isSelected);\n Object selectedBorder = getListItemBorder(selectedListItem, isSelected);\n selectedColor = (selectedColor == null ? \"String_Node_Str\" : selectedColor.toString());\n selectedFgColor = (selectedFgColor == null) ? \"String_Node_Str\" : selectedFgColor.toString();\n String fstyle = \"String_Node_Str\", fweight = \"String_Node_Str\", fsize = \"String_Node_Str\", ffamily = \"String_Node_Str\";\n if (selectedFont != null) {\n Pair<String, String>[] fontCSSProps = PersistHelper.createFontCSSProperties(selectedFont.toString());\n for (Pair<String, String> fontCSSProp : fontCSSProps) {\n if (fontCSSProp != null) {\n String key = fontCSSProp.getLeft();\n String value = fontCSSProp.getRight();\n if (value == null)\n value = \"String_Node_Str\";\n if (\"String_Node_Str\".equals(key))\n fstyle = value;\n else if (\"String_Node_Str\".equals(key))\n fweight = value;\n else if (\"String_Node_Str\".equals(key))\n fsize = value;\n else if (\"String_Node_Str\".equals(key))\n ffamily = value;\n }\n }\n }\n String bstyle = \"String_Node_Str\", bwidth = \"String_Node_Str\", bcolor = \"String_Node_Str\";\n if (selectedBorder != null) {\n Properties borderProperties = new Properties();\n ComponentFactoryHelper.createBorderCSSProperties(selectedBorder.toString(), borderProperties);\n bstyle = borderProperties.getProperty(\"String_Node_Str\");\n if (bstyle == null)\n bstyle = \"String_Node_Str\";\n bwidth = borderProperties.getProperty(\"String_Node_Str\");\n bwidth = getFirstToken(bwidth);\n bcolor = borderProperties.getProperty(\"String_Node_Str\");\n if (bcolor == null)\n bcolor = \"String_Node_Str\";\n }\n sab.append(\"String_Node_Str\").append(selectedId).append(\"String_Node_Str\").append(selectedColor).append(\"String_Node_Str\").append(selectedFgColor).append(\"String_Node_Str\").append(fstyle).append(\"String_Node_Str\").append(fweight).append(\"String_Node_Str\").append(fsize).append(\"String_Node_Str\").append(ffamily).append(\"String_Node_Str\").append(bstyle).append(\"String_Node_Str\").append(bwidth).append(\"String_Node_Str\").append(bcolor).append(\"String_Node_Str\");\n }\n }\n }\n String rowSelectionScript = sab.toString();\n if (rowSelectionScript.length() > 0)\n return rowSelectionScript;\n }\n return null;\n}\n"
"public String submit(String openid, String name, Long stuId, String gender, String nationality, Long tel, String email, String introduce, String description) {\n Optional<ApplicationForm> optional = joinService.queryForm(openid);\n if (optional.isPresent() && optional.get().getName() == null) {\n ApplicationForm applicationForm = optional.get();\n applicationForm.setOpenid(openid);\n applicationForm.setDescription(description);\n applicationForm.setName(name);\n applicationForm.setIntroduce(introduce);\n applicationForm.setTel(tel);\n applicationForm.setEmail(email);\n applicationForm.setCreateDate(new Date());\n applicationForm.setStuId(stuId);\n applicationForm.setGender(gender);\n applicationForm.setNationality(nationality);\n joinService.submit(applicationForm);\n }\n return \"String_Node_Str\";\n}\n"
"public void run() {\n while (true) {\n try {\n Thread.sleep(10);\n } catch (Exception e) {\n }\n while (!packets.isEmpty()) {\n SendRequest r = packets.remove();\n for (EntityPlayerMP player : (List<EntityPlayerMP>) MinecraftServer.getServer().getConfigurationManager().playerEntityList) {\n if (r.isValid(player)) {\n NetHandlerPlayServer handler = player.playerNetServerHandler;\n if (handler == null) {\n continue;\n }\n NetworkManager manager = handler.netManager;\n if (manager == null || !manager.isChannelOpen()) {\n continue;\n }\n manager.scheduleOutboundPacket(r.source.channels.get(Side.SERVER).generatePacketFrom(r.packet));\n }\n }\n }\n }\n}\n"
"protected void onPreExecute() {\n if (maxId == null) {\n mStatusAdapter.clear();\n }\n}\n"
"public void testUpdateSeatAllocation() {\n Assert.assertEquals(2, reservationManager.getBookingState().getReserved().size());\n Assert.assertEquals(1, reservationManager.getBookingState().getReserved().get(0).getStartSeat());\n Assert.assertEquals(10, reservationManager.getBookingState().getReserved().get(0).getEndSeat());\n Assert.assertEquals(1, reservationManager.getBookingState().getReserved().size());\n success = reservationManager.updateSeatReservation((long) 3, (long) 100, 15);\n Assert.assertEquals(1, reservationManager.getBookingState().getReserved().size());\n Assert.assertEquals(1, reservationManager.getBookingState().getReserved().get(0).getStartSeat());\n Assert.assertEquals(15, reservationManager.getBookingState().getReserved().get(0).getEndSeat());\n Assert.assertEquals((long) 1, reservationManager.getBookingState().getReserved().get(0).getKey().getRowId(), 0);\n success = reservationManager.findContiguousSeats((long) 3, (long) 100, 50);\n Assert.assertEquals((long) 2, reservationManager.getBookingState().getReserved().get(1).getKey().getRowId(), 0);\n Assert.assertEquals(1, reservationManager.getBookingState().getReserved().get(1).getStartSeat());\n Assert.assertEquals(50, reservationManager.getBookingState().getReserved().get(1).getEndSeat());\n}\n"
"public void onMultiAdvertiseCallback(int status, boolean isStart, AdvertiseSettings settings) {\n synchronized (this) {\n if (isStart) {\n if (status == AdvertiseCallback.ADVERTISE_SUCCESS) {\n mAdvertiseCallback.onStartSuccess(settings);\n mIsAdvertising = true;\n } else {\n postStartFailure(mAdvertiseCallback, status);\n }\n } else {\n try {\n mBluetoothGatt.unregisterClient(mClientIf);\n mClientIf = -1;\n mIsAdvertising = false;\n } catch (RemoteException e) {\n Log.e(TAG, \"String_Node_Str\", e);\n }\n }\n notifyAll();\n }\n}\n"
"public String getXWikiEclipseId() {\n return String.format(\"String_Node_Str\", getDataManager().getName(), getId(), getAuthor());\n}\n"
"protected synchronized IStatus run(IProgressMonitor monitor) {\n if (tailing) {\n remove = stream.shouldCloseStream();\n if (!remove) {\n try {\n stream.write(monitor);\n } catch (CoreException e) {\n remove = true;\n CloudFoundryPlugin.logError(e);\n }\n }\n if (activeStreams != null && !activeStreams.isEmpty()) {\n schedule(sampleInterval);\n } else {\n stopTailing();\n }\n }\n return Status.OK_STATUS;\n}\n"
"public Result execute(ShellContext context) throws Exception {\n Shell shell = context.getProvider();\n FileResource<?> currentResource = shell.getCurrentResource();\n Iterable<String> value = arguments.getValue();\n Iterator<String> it = value == null ? Collections.<String>emptyList().iterator() : value.iterator();\n final Result result;\n if (it.hasNext()) {\n String newPath = it.next();\n final List<Resource<?>> newResource = new PathspecParser(resourceFactory, currentResource, newPath).resolve();\n if (newResource.isEmpty() || !newResource.get(0).exists()) {\n result = Results.fail(newPath + \"String_Node_Str\");\n } else {\n FileResource<?> newFileResource = newResource.get(0).reify(FileResource.class);\n if (newFileResource == null) {\n result = Results.fail(newPath + \"String_Node_Str\");\n } else {\n shell.setCurrentResource(newFileResource);\n result = Results.success();\n }\n }\n } else {\n result = Results.success();\n }\n return result;\n}\n"
"private void checkTaskExecution() {\n final Iterator<Task> it = this.runningTasks.values().iterator();\n while (it.hasNext()) {\n final Task task = it.next();\n if (task.isTerminated()) {\n task.markAsFailed();\n }\n }\n final Iterator<Task> it2 = failedTasks.iterator();\n while (it2.hasNext()) {\n it2.next().markAsFailed();\n }\n}\n"