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
partition
stringclasses
1 value
kuali/kc-s2sgen
coeus-s2sgen-impl/src/main/java/org/kuali/coeus/s2sgen/impl/generate/support/RRBudgetV1_0Generator.java
RRBudgetV1_0Generator.getCumulativeTravels
private CumulativeTravels getCumulativeTravels( BudgetSummaryDto budgetSummaryData) { CumulativeTravels cumulativeTravels = CumulativeTravels.Factory .newInstance(); if (budgetSummaryData.getCumDomesticTravel() != null) { cumulativeTravels .setCumulativeDomesticTravelCosts(budgetSummaryData .getCumDomesticTravel().bigDecimalValue()); } if (budgetSummaryData.getCumForeignTravel() != null) { cumulativeTravels.setCumulativeForeignTravelCosts(budgetSummaryData .getCumForeignTravel().bigDecimalValue()); } if (budgetSummaryData.getCumTravel() != null) { cumulativeTravels .setCumulativeTotalFundsRequestedTravel(budgetSummaryData .getCumTravel().bigDecimalValue()); } return cumulativeTravels; }
java
private CumulativeTravels getCumulativeTravels( BudgetSummaryDto budgetSummaryData) { CumulativeTravels cumulativeTravels = CumulativeTravels.Factory .newInstance(); if (budgetSummaryData.getCumDomesticTravel() != null) { cumulativeTravels .setCumulativeDomesticTravelCosts(budgetSummaryData .getCumDomesticTravel().bigDecimalValue()); } if (budgetSummaryData.getCumForeignTravel() != null) { cumulativeTravels.setCumulativeForeignTravelCosts(budgetSummaryData .getCumForeignTravel().bigDecimalValue()); } if (budgetSummaryData.getCumTravel() != null) { cumulativeTravels .setCumulativeTotalFundsRequestedTravel(budgetSummaryData .getCumTravel().bigDecimalValue()); } return cumulativeTravels; }
[ "private", "CumulativeTravels", "getCumulativeTravels", "(", "BudgetSummaryDto", "budgetSummaryData", ")", "{", "CumulativeTravels", "cumulativeTravels", "=", "CumulativeTravels", ".", "Factory", ".", "newInstance", "(", ")", ";", "if", "(", "budgetSummaryData", ".", "g...
This method gets CumulativeTravels details,CumulativeTotalFundsRequestedTravel,CumulativeDomesticTravelCosts and CumulativeForeignTravelCosts based on BudgetSummaryInfo for the RRBudget. @param budgetSummaryData (BudgetSummaryInfo) budget summary info entry. @return CumulativeTravels details corresponding to the BudgetSummaryInfo object.
[ "This", "method", "gets", "CumulativeTravels", "details", "CumulativeTotalFundsRequestedTravel", "CumulativeDomesticTravelCosts", "and", "CumulativeForeignTravelCosts", "based", "on", "BudgetSummaryInfo", "for", "the", "RRBudget", "." ]
2886380e1e3cb8bdd732ba99b2afa6ffc630bb37
https://github.com/kuali/kc-s2sgen/blob/2886380e1e3cb8bdd732ba99b2afa6ffc630bb37/coeus-s2sgen-impl/src/main/java/org/kuali/coeus/s2sgen/impl/generate/support/RRBudgetV1_0Generator.java#L382-L401
train
kuali/kc-s2sgen
coeus-s2sgen-impl/src/main/java/org/kuali/coeus/s2sgen/impl/generate/support/RRBudgetV1_0Generator.java
RRBudgetV1_0Generator.getOtherPersonnel
private OtherPersonnel getOtherPersonnel(BudgetPeriodDto periodInfo) { OtherPersonnel otherPersonnel = OtherPersonnel.Factory.newInstance(); int OtherpersonalCount = 0; List<OtherPersonnelDataType> otherPersonnelList = new ArrayList<>(); OtherPersonnelDataType otherPersonnelDataTypeArray[] = new OtherPersonnelDataType[1]; if (periodInfo != null) { for (OtherPersonnelDto otherPersonnelInfo : periodInfo .getOtherPersonnel()) { if (OTHERPERSONNEL_POSTDOC.equals(otherPersonnelInfo .getPersonnelType())) { otherPersonnel .setPostDocAssociates(getPostDocAssociates(otherPersonnelInfo)); } else if (OTHERPERSONNEL_GRADUATE.equals(otherPersonnelInfo .getPersonnelType())) { otherPersonnel .setGraduateStudents(getGraduateStudents(otherPersonnelInfo)); } else if (OTHERPERSONNEL_UNDERGRADUATE .equals(otherPersonnelInfo.getPersonnelType())) { otherPersonnel .setUndergraduateStudents(getUndergraduateStudents(otherPersonnelInfo)); } else if (OTHERPERSONNEL_SECRETARIAL.equals(otherPersonnelInfo .getPersonnelType())) { otherPersonnel .setSecretarialClerical(getSecretarialClerical(otherPersonnelInfo)); } else if (OtherpersonalCount < OTHERPERSONNEL_MAX_ALLOWED) {// Max // allowed // is 6 OtherPersonnelDataType otherPersonnelDataType = OtherPersonnelDataType.Factory .newInstance(); otherPersonnelDataType .setNumberOfPersonnel(otherPersonnelInfo .getNumberPersonnel()); otherPersonnelDataType.setProjectRole(otherPersonnelInfo .getRole()); otherPersonnelDataType .setCompensation(getSectBCompensationDataType(otherPersonnelInfo .getCompensation())); otherPersonnelList.add(otherPersonnelDataType); OtherpersonalCount++; } } otherPersonnelDataTypeArray = otherPersonnelList .toArray(otherPersonnelDataTypeArray); otherPersonnel.setOtherArray(otherPersonnelDataTypeArray); if (periodInfo.getOtherPersonnelTotalNumber() != null) { otherPersonnel.setOtherPersonnelTotalNumber(periodInfo .getOtherPersonnelTotalNumber().intValue()); } if (periodInfo.getTotalOtherPersonnelFunds() != null) { otherPersonnel.setTotalOtherPersonnelFund(periodInfo .getTotalOtherPersonnelFunds().bigDecimalValue()); } } return otherPersonnel; }
java
private OtherPersonnel getOtherPersonnel(BudgetPeriodDto periodInfo) { OtherPersonnel otherPersonnel = OtherPersonnel.Factory.newInstance(); int OtherpersonalCount = 0; List<OtherPersonnelDataType> otherPersonnelList = new ArrayList<>(); OtherPersonnelDataType otherPersonnelDataTypeArray[] = new OtherPersonnelDataType[1]; if (periodInfo != null) { for (OtherPersonnelDto otherPersonnelInfo : periodInfo .getOtherPersonnel()) { if (OTHERPERSONNEL_POSTDOC.equals(otherPersonnelInfo .getPersonnelType())) { otherPersonnel .setPostDocAssociates(getPostDocAssociates(otherPersonnelInfo)); } else if (OTHERPERSONNEL_GRADUATE.equals(otherPersonnelInfo .getPersonnelType())) { otherPersonnel .setGraduateStudents(getGraduateStudents(otherPersonnelInfo)); } else if (OTHERPERSONNEL_UNDERGRADUATE .equals(otherPersonnelInfo.getPersonnelType())) { otherPersonnel .setUndergraduateStudents(getUndergraduateStudents(otherPersonnelInfo)); } else if (OTHERPERSONNEL_SECRETARIAL.equals(otherPersonnelInfo .getPersonnelType())) { otherPersonnel .setSecretarialClerical(getSecretarialClerical(otherPersonnelInfo)); } else if (OtherpersonalCount < OTHERPERSONNEL_MAX_ALLOWED) {// Max // allowed // is 6 OtherPersonnelDataType otherPersonnelDataType = OtherPersonnelDataType.Factory .newInstance(); otherPersonnelDataType .setNumberOfPersonnel(otherPersonnelInfo .getNumberPersonnel()); otherPersonnelDataType.setProjectRole(otherPersonnelInfo .getRole()); otherPersonnelDataType .setCompensation(getSectBCompensationDataType(otherPersonnelInfo .getCompensation())); otherPersonnelList.add(otherPersonnelDataType); OtherpersonalCount++; } } otherPersonnelDataTypeArray = otherPersonnelList .toArray(otherPersonnelDataTypeArray); otherPersonnel.setOtherArray(otherPersonnelDataTypeArray); if (periodInfo.getOtherPersonnelTotalNumber() != null) { otherPersonnel.setOtherPersonnelTotalNumber(periodInfo .getOtherPersonnelTotalNumber().intValue()); } if (periodInfo.getTotalOtherPersonnelFunds() != null) { otherPersonnel.setTotalOtherPersonnelFund(periodInfo .getTotalOtherPersonnelFunds().bigDecimalValue()); } } return otherPersonnel; }
[ "private", "OtherPersonnel", "getOtherPersonnel", "(", "BudgetPeriodDto", "periodInfo", ")", "{", "OtherPersonnel", "otherPersonnel", "=", "OtherPersonnel", ".", "Factory", ".", "newInstance", "(", ")", ";", "int", "OtherpersonalCount", "=", "0", ";", "List", "<", ...
This method gets OtherPersonnel informations like PostDocAssociates,GraduateStudents,UndergraduateStudents SecretarialClerical based on PersonnelType and also gets NumberOfPersonnel, ProjectRole,Compensation OtherPersonnelTotalNumber and TotalOtherPersonnelFund based on BudgetPeriodInfo for the RRBudget. @param periodInfo (BudgetPeriodInfo) budget period entry. @return OtherPersonnel details corresponding to the BudgetPeriodInfo object.
[ "This", "method", "gets", "OtherPersonnel", "informations", "like", "PostDocAssociates", "GraduateStudents", "UndergraduateStudents", "SecretarialClerical", "based", "on", "PersonnelType", "and", "also", "gets", "NumberOfPersonnel", "ProjectRole", "Compensation", "OtherPersonne...
2886380e1e3cb8bdd732ba99b2afa6ffc630bb37
https://github.com/kuali/kc-s2sgen/blob/2886380e1e3cb8bdd732ba99b2afa6ffc630bb37/coeus-s2sgen-impl/src/main/java/org/kuali/coeus/s2sgen/impl/generate/support/RRBudgetV1_0Generator.java#L760-L815
train
kuali/kc-s2sgen
coeus-s2sgen-impl/src/main/java/org/kuali/coeus/s2sgen/impl/generate/support/RRBudgetV1_0Generator.java
RRBudgetV1_0Generator.getEquipment
private Equipment getEquipment(BudgetPeriodDto periodInfo) { Equipment equipment = Equipment.Factory.newInstance(); NarrativeContract extraEquipmentNarr = null; if (periodInfo != null && periodInfo.getEquipment() != null && periodInfo.getEquipment().size() > 0) { // Evaluating Equipments. List<EquipmentList> equipmentArrayList = new ArrayList<>(); ScaleTwoDecimal totalFund = ScaleTwoDecimal.ZERO; for (CostDto costInfo : periodInfo.getEquipment().get(0) .getEquipmentList()) { EquipmentList equipmentList = EquipmentList.Factory .newInstance(); equipmentList.setEquipmentItem(costInfo.getDescription()); if (costInfo.getCost() != null) { equipmentList.setFundsRequested(costInfo.getCost() .bigDecimalValue()); } totalFund = totalFund.add(costInfo.getCost()); equipmentArrayList.add(equipmentList); } // Evaluating Extra Equipments. List<CostDto> extraEquipmentArrayList = new ArrayList<>(); ScaleTwoDecimal totalExtraEquipFund = ScaleTwoDecimal.ZERO; for(CostDto costInfo:periodInfo.getEquipment().get(0).getExtraEquipmentList()){ extraEquipmentArrayList.add(costInfo); totalExtraEquipFund = totalExtraEquipFund.add(costInfo.getCost()); } EquipmentList[] equipmentArray = new EquipmentList[0]; equipmentArray = equipmentArrayList.toArray(equipmentArray); equipment.setEquipmentListArray(equipmentArray); TotalFundForAttachedEquipment totalFundForAttachedEquipment = TotalFundForAttachedEquipment.Factory .newInstance(); totalFundForAttachedEquipment.setTotalFundForAttachedEquipmentExist(YesNoDataType.YES); totalFundForAttachedEquipment.setBigDecimalValue(periodInfo.getEquipment().get(0) .getTotalExtraFund().bigDecimalValue()); totalFund = totalFund.add(totalExtraEquipFund); equipment.setTotalFundForAttachedEquipment(totalFundForAttachedEquipment); equipment.setTotalFund(totalFund.bigDecimalValue()); extraEquipmentNarr = saveAdditionalEquipments(periodInfo,extraEquipmentArrayList); } if(extraEquipmentNarr!=null){ AdditionalEquipmentsAttachment equipmentAttachment = AdditionalEquipmentsAttachment.Factory .newInstance(); FileLocation fileLocation = FileLocation.Factory.newInstance(); equipmentAttachment.setFileLocation(fileLocation); String contentId = createContentId(extraEquipmentNarr); fileLocation.setHref(contentId); equipmentAttachment.setFileLocation(fileLocation); equipmentAttachment.setFileName(extraEquipmentNarr.getNarrativeAttachment().getName()); equipmentAttachment .setMimeType(InfastructureConstants.CONTENT_TYPE_OCTET_STREAM); equipmentAttachment.setHashValue(getHashValue(extraEquipmentNarr .getNarrativeAttachment().getData())); AttachmentData attachmentData = new AttachmentData(); attachmentData.setContent(extraEquipmentNarr .getNarrativeAttachment().getData()); attachmentData.setContentId(contentId); attachmentData .setContentType(InfastructureConstants.CONTENT_TYPE_OCTET_STREAM); attachmentData.setFileName(extraEquipmentNarr.getNarrativeAttachment().getName()); addAttachment(attachmentData); equipmentAttachment .setTotalFundForAttachedEquipmentExist(YesNoDataType.YES); equipment .setAdditionalEquipmentsAttachment(equipmentAttachment); } return equipment; }
java
private Equipment getEquipment(BudgetPeriodDto periodInfo) { Equipment equipment = Equipment.Factory.newInstance(); NarrativeContract extraEquipmentNarr = null; if (periodInfo != null && periodInfo.getEquipment() != null && periodInfo.getEquipment().size() > 0) { // Evaluating Equipments. List<EquipmentList> equipmentArrayList = new ArrayList<>(); ScaleTwoDecimal totalFund = ScaleTwoDecimal.ZERO; for (CostDto costInfo : periodInfo.getEquipment().get(0) .getEquipmentList()) { EquipmentList equipmentList = EquipmentList.Factory .newInstance(); equipmentList.setEquipmentItem(costInfo.getDescription()); if (costInfo.getCost() != null) { equipmentList.setFundsRequested(costInfo.getCost() .bigDecimalValue()); } totalFund = totalFund.add(costInfo.getCost()); equipmentArrayList.add(equipmentList); } // Evaluating Extra Equipments. List<CostDto> extraEquipmentArrayList = new ArrayList<>(); ScaleTwoDecimal totalExtraEquipFund = ScaleTwoDecimal.ZERO; for(CostDto costInfo:periodInfo.getEquipment().get(0).getExtraEquipmentList()){ extraEquipmentArrayList.add(costInfo); totalExtraEquipFund = totalExtraEquipFund.add(costInfo.getCost()); } EquipmentList[] equipmentArray = new EquipmentList[0]; equipmentArray = equipmentArrayList.toArray(equipmentArray); equipment.setEquipmentListArray(equipmentArray); TotalFundForAttachedEquipment totalFundForAttachedEquipment = TotalFundForAttachedEquipment.Factory .newInstance(); totalFundForAttachedEquipment.setTotalFundForAttachedEquipmentExist(YesNoDataType.YES); totalFundForAttachedEquipment.setBigDecimalValue(periodInfo.getEquipment().get(0) .getTotalExtraFund().bigDecimalValue()); totalFund = totalFund.add(totalExtraEquipFund); equipment.setTotalFundForAttachedEquipment(totalFundForAttachedEquipment); equipment.setTotalFund(totalFund.bigDecimalValue()); extraEquipmentNarr = saveAdditionalEquipments(periodInfo,extraEquipmentArrayList); } if(extraEquipmentNarr!=null){ AdditionalEquipmentsAttachment equipmentAttachment = AdditionalEquipmentsAttachment.Factory .newInstance(); FileLocation fileLocation = FileLocation.Factory.newInstance(); equipmentAttachment.setFileLocation(fileLocation); String contentId = createContentId(extraEquipmentNarr); fileLocation.setHref(contentId); equipmentAttachment.setFileLocation(fileLocation); equipmentAttachment.setFileName(extraEquipmentNarr.getNarrativeAttachment().getName()); equipmentAttachment .setMimeType(InfastructureConstants.CONTENT_TYPE_OCTET_STREAM); equipmentAttachment.setHashValue(getHashValue(extraEquipmentNarr .getNarrativeAttachment().getData())); AttachmentData attachmentData = new AttachmentData(); attachmentData.setContent(extraEquipmentNarr .getNarrativeAttachment().getData()); attachmentData.setContentId(contentId); attachmentData .setContentType(InfastructureConstants.CONTENT_TYPE_OCTET_STREAM); attachmentData.setFileName(extraEquipmentNarr.getNarrativeAttachment().getName()); addAttachment(attachmentData); equipmentAttachment .setTotalFundForAttachedEquipmentExist(YesNoDataType.YES); equipment .setAdditionalEquipmentsAttachment(equipmentAttachment); } return equipment; }
[ "private", "Equipment", "getEquipment", "(", "BudgetPeriodDto", "periodInfo", ")", "{", "Equipment", "equipment", "=", "Equipment", ".", "Factory", ".", "newInstance", "(", ")", ";", "NarrativeContract", "extraEquipmentNarr", "=", "null", ";", "if", "(", "periodIn...
This method gets Equipment details such as EquipmentItem,FundsRequested,TotalFundForAttachedEquipment, TotalFund and AdditionalEquipmentsAttachment based on BudgetPeriodInfo for the RRBudget. @param periodInfo (BudgetPeriodInfo) budget period entry. @return Equipment costs corresponding to the BudgetPeriodInfo object.
[ "This", "method", "gets", "Equipment", "details", "such", "as", "EquipmentItem", "FundsRequested", "TotalFundForAttachedEquipment", "TotalFund", "and", "AdditionalEquipmentsAttachment", "based", "on", "BudgetPeriodInfo", "for", "the", "RRBudget", "." ]
2886380e1e3cb8bdd732ba99b2afa6ffc630bb37
https://github.com/kuali/kc-s2sgen/blob/2886380e1e3cb8bdd732ba99b2afa6ffc630bb37/coeus-s2sgen-impl/src/main/java/org/kuali/coeus/s2sgen/impl/generate/support/RRBudgetV1_0Generator.java#L929-L997
train
kuali/kc-s2sgen
coeus-s2sgen-impl/src/main/java/org/kuali/coeus/s2sgen/impl/generate/support/RRBudgetV1_0Generator.java
RRBudgetV1_0Generator.getTravel
private Travel getTravel(BudgetPeriodDto periodInfo) { Travel travel = Travel.Factory.newInstance(); if (periodInfo != null) { if (periodInfo.getDomesticTravelCost() != null) { travel.setDomesticTravelCost(periodInfo.getDomesticTravelCost() .bigDecimalValue()); } if (periodInfo.getForeignTravelCost() != null) { travel.setForeignTravelCost(periodInfo.getForeignTravelCost() .bigDecimalValue()); } if (periodInfo.getTotalTravelCost() != null) { travel.setTotalTravelCost(periodInfo.getTotalTravelCost() .bigDecimalValue()); } } return travel; }
java
private Travel getTravel(BudgetPeriodDto periodInfo) { Travel travel = Travel.Factory.newInstance(); if (periodInfo != null) { if (periodInfo.getDomesticTravelCost() != null) { travel.setDomesticTravelCost(periodInfo.getDomesticTravelCost() .bigDecimalValue()); } if (periodInfo.getForeignTravelCost() != null) { travel.setForeignTravelCost(periodInfo.getForeignTravelCost() .bigDecimalValue()); } if (periodInfo.getTotalTravelCost() != null) { travel.setTotalTravelCost(periodInfo.getTotalTravelCost() .bigDecimalValue()); } } return travel; }
[ "private", "Travel", "getTravel", "(", "BudgetPeriodDto", "periodInfo", ")", "{", "Travel", "travel", "=", "Travel", ".", "Factory", ".", "newInstance", "(", ")", ";", "if", "(", "periodInfo", "!=", "null", ")", "{", "if", "(", "periodInfo", ".", "getDomes...
This method gets Travel cost information including DomesticTravelCost,ForeignTravelCost and TotalTravelCost in the BudgetYearDataType based on BudgetPeriodInfo for the RRBudget. @param periodInfo (BudgetPeriodInfo) budget period entry. @return Travel travel cost corresponding to the BudgetPeriodInfo object.
[ "This", "method", "gets", "Travel", "cost", "information", "including", "DomesticTravelCost", "ForeignTravelCost", "and", "TotalTravelCost", "in", "the", "BudgetYearDataType", "based", "on", "BudgetPeriodInfo", "for", "the", "RRBudget", "." ]
2886380e1e3cb8bdd732ba99b2afa6ffc630bb37
https://github.com/kuali/kc-s2sgen/blob/2886380e1e3cb8bdd732ba99b2afa6ffc630bb37/coeus-s2sgen-impl/src/main/java/org/kuali/coeus/s2sgen/impl/generate/support/RRBudgetV1_0Generator.java#L1008-L1026
train
kuali/kc-s2sgen
coeus-s2sgen-impl/src/main/java/org/kuali/coeus/s2sgen/impl/generate/support/RRBudgetV1_0Generator.java
RRBudgetV1_0Generator.getParticipantTraineeSupportCosts
private ParticipantTraineeSupportCosts getParticipantTraineeSupportCosts( BudgetPeriodDto periodInfo) { ParticipantTraineeSupportCosts traineeSupportCosts = ParticipantTraineeSupportCosts.Factory .newInstance(); if (periodInfo != null) { traineeSupportCosts.setTuitionFeeHealthInsurance(periodInfo .getPartTuition().bigDecimalValue()); traineeSupportCosts.setStipends(periodInfo.getpartStipendCost() .bigDecimalValue()); traineeSupportCosts.setTravel(periodInfo.getpartTravelCost() .bigDecimalValue()); traineeSupportCosts.setSubsistence(periodInfo.getPartSubsistence() .bigDecimalValue()); traineeSupportCosts.setOther(getOtherPTSupportCosts(periodInfo)); traineeSupportCosts.setParticipantTraineeNumber(periodInfo .getparticipantCount()); traineeSupportCosts .setTotalCost(traineeSupportCosts .getTuitionFeeHealthInsurance() .add( traineeSupportCosts .getStipends() .add( traineeSupportCosts .getTravel() .add( traineeSupportCosts .getSubsistence() .add( traineeSupportCosts .getOther() .getCost()))))); } return traineeSupportCosts; }
java
private ParticipantTraineeSupportCosts getParticipantTraineeSupportCosts( BudgetPeriodDto periodInfo) { ParticipantTraineeSupportCosts traineeSupportCosts = ParticipantTraineeSupportCosts.Factory .newInstance(); if (periodInfo != null) { traineeSupportCosts.setTuitionFeeHealthInsurance(periodInfo .getPartTuition().bigDecimalValue()); traineeSupportCosts.setStipends(periodInfo.getpartStipendCost() .bigDecimalValue()); traineeSupportCosts.setTravel(periodInfo.getpartTravelCost() .bigDecimalValue()); traineeSupportCosts.setSubsistence(periodInfo.getPartSubsistence() .bigDecimalValue()); traineeSupportCosts.setOther(getOtherPTSupportCosts(periodInfo)); traineeSupportCosts.setParticipantTraineeNumber(periodInfo .getparticipantCount()); traineeSupportCosts .setTotalCost(traineeSupportCosts .getTuitionFeeHealthInsurance() .add( traineeSupportCosts .getStipends() .add( traineeSupportCosts .getTravel() .add( traineeSupportCosts .getSubsistence() .add( traineeSupportCosts .getOther() .getCost()))))); } return traineeSupportCosts; }
[ "private", "ParticipantTraineeSupportCosts", "getParticipantTraineeSupportCosts", "(", "BudgetPeriodDto", "periodInfo", ")", "{", "ParticipantTraineeSupportCosts", "traineeSupportCosts", "=", "ParticipantTraineeSupportCosts", ".", "Factory", ".", "newInstance", "(", ")", ";", "...
This method gets ParticipantTraineeSupportCosts details in BudgetYearDataType such as TuitionFeeHealthInsurance Stipends,Subsistence,Travel,Other,ParticipantTraineeNumber and TotalCost based on the BudgetPeriodInfo for the RRBudget. @param periodInfo (BudgetPeriodInfo) budget period entry. @return ParticipantTraineeSupportCosts corresponding to the BudgetPeriodInfo object.
[ "This", "method", "gets", "ParticipantTraineeSupportCosts", "details", "in", "BudgetYearDataType", "such", "as", "TuitionFeeHealthInsurance", "Stipends", "Subsistence", "Travel", "Other", "ParticipantTraineeNumber", "and", "TotalCost", "based", "on", "the", "BudgetPeriodInfo"...
2886380e1e3cb8bdd732ba99b2afa6ffc630bb37
https://github.com/kuali/kc-s2sgen/blob/2886380e1e3cb8bdd732ba99b2afa6ffc630bb37/coeus-s2sgen-impl/src/main/java/org/kuali/coeus/s2sgen/impl/generate/support/RRBudgetV1_0Generator.java#L1039-L1073
train
carewebframework/carewebframework-core
org.carewebframework.ui-parent/org.carewebframework.ui.core/src/main/java/org/carewebframework/ui/xml/XMLViewer.java
XMLViewer.showXML
public static Window showXML(Document document, BaseUIComponent parent) { Map<String, Object> args = Collections.singletonMap("document", document); boolean modal = parent == null; Window dialog = PopupDialog.show(XMLConstants.VIEW_DIALOG, args, modal, modal, modal, null); if (parent != null) { dialog.setParent(parent); } return dialog; }
java
public static Window showXML(Document document, BaseUIComponent parent) { Map<String, Object> args = Collections.singletonMap("document", document); boolean modal = parent == null; Window dialog = PopupDialog.show(XMLConstants.VIEW_DIALOG, args, modal, modal, modal, null); if (parent != null) { dialog.setParent(parent); } return dialog; }
[ "public", "static", "Window", "showXML", "(", "Document", "document", ",", "BaseUIComponent", "parent", ")", "{", "Map", "<", "String", ",", "Object", ">", "args", "=", "Collections", ".", "singletonMap", "(", "\"document\"", ",", "document", ")", ";", "bool...
Show the dialog, loading the specified document. @param document The XML document. @param parent If specified, show viewer in embedded mode. Otherwise, show as modal dialog. @return The dialog.
[ "Show", "the", "dialog", "loading", "the", "specified", "document", "." ]
fa3252d4f7541dbe151b92c3d4f6f91433cd1673
https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.ui-parent/org.carewebframework.ui.core/src/main/java/org/carewebframework/ui/xml/XMLViewer.java#L59-L69
train
carewebframework/carewebframework-core
org.carewebframework.ui-parent/org.carewebframework.ui.core/src/main/java/org/carewebframework/ui/xml/XMLViewer.java
XMLViewer.showCWF
public static Window showCWF(BaseComponent root, String... excludedProperties) { Window window = showXML(CWF2XML.toDocument(root, excludedProperties)); window.setTitle("CWF Markup"); return window; }
java
public static Window showCWF(BaseComponent root, String... excludedProperties) { Window window = showXML(CWF2XML.toDocument(root, excludedProperties)); window.setTitle("CWF Markup"); return window; }
[ "public", "static", "Window", "showCWF", "(", "BaseComponent", "root", ",", "String", "...", "excludedProperties", ")", "{", "Window", "window", "=", "showXML", "(", "CWF2XML", ".", "toDocument", "(", "root", ",", "excludedProperties", ")", ")", ";", "window",...
Display the CWF markup for the component tree rooted at root. @param root Root component of tree. @param excludedProperties Excluded properties. @return The dialog.
[ "Display", "the", "CWF", "markup", "for", "the", "component", "tree", "rooted", "at", "root", "." ]
fa3252d4f7541dbe151b92c3d4f6f91433cd1673
https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.ui-parent/org.carewebframework.ui.core/src/main/java/org/carewebframework/ui/xml/XMLViewer.java#L89-L93
train
carewebframework/carewebframework-core
org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/FrameworkUtil.java
FrameworkUtil.setAttribute
public static void setAttribute(String key, Object value) { assertInitialized(); getAppFramework().setAttribute(key, value); }
java
public static void setAttribute(String key, Object value) { assertInitialized(); getAppFramework().setAttribute(key, value); }
[ "public", "static", "void", "setAttribute", "(", "String", "key", ",", "Object", "value", ")", "{", "assertInitialized", "(", ")", ";", "getAppFramework", "(", ")", ".", "setAttribute", "(", "key", ",", "value", ")", ";", "}" ]
Stores an arbitrary named attribute in the attribute cache. @param key Attribute name. @param value Attribute value. If null, value is removed from cache. @throws IllegalStateException if AppFramework is not initialized
[ "Stores", "an", "arbitrary", "named", "attribute", "in", "the", "attribute", "cache", "." ]
fa3252d4f7541dbe151b92c3d4f6f91433cd1673
https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/FrameworkUtil.java#L74-L77
train
carewebframework/carewebframework-core
org.carewebframework.shell/src/main/java/org/carewebframework/shell/plugins/PluginController.java
PluginController.afterInitialized
@Override public void afterInitialized(BaseComponent comp) { super.afterInitialized(comp); PluginContainer container = comp.getAncestor(PluginContainer.class, true); plugin = (ElementPlugin) ElementUI.getAssociatedElement(container); }
java
@Override public void afterInitialized(BaseComponent comp) { super.afterInitialized(comp); PluginContainer container = comp.getAncestor(PluginContainer.class, true); plugin = (ElementPlugin) ElementUI.getAssociatedElement(container); }
[ "@", "Override", "public", "void", "afterInitialized", "(", "BaseComponent", "comp", ")", "{", "super", ".", "afterInitialized", "(", "comp", ")", ";", "PluginContainer", "container", "=", "comp", ".", "getAncestor", "(", "PluginContainer", ".", "class", ",", ...
Wire controller from toolbar components first, then from plugin.
[ "Wire", "controller", "from", "toolbar", "components", "first", "then", "from", "plugin", "." ]
fa3252d4f7541dbe151b92c3d4f6f91433cd1673
https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.shell/src/main/java/org/carewebframework/shell/plugins/PluginController.java#L49-L54
train
carewebframework/carewebframework-core
org.carewebframework.shell/src/main/java/org/carewebframework/shell/plugins/PluginController.java
PluginController.attachController
public void attachController(BaseComponent comp, IAutoWired controller) { plugin.tryRegisterListener(controller, true); comp.wireController(controller); }
java
public void attachController(BaseComponent comp, IAutoWired controller) { plugin.tryRegisterListener(controller, true); comp.wireController(controller); }
[ "public", "void", "attachController", "(", "BaseComponent", "comp", ",", "IAutoWired", "controller", ")", "{", "plugin", ".", "tryRegisterListener", "(", "controller", ",", "true", ")", ";", "comp", ".", "wireController", "(", "controller", ")", ";", "}" ]
Attaches a controller to the specified component and registers any recognized listeners to the plugin. @param comp Target component. @param controller Controller to attach.
[ "Attaches", "a", "controller", "to", "the", "specified", "component", "and", "registers", "any", "recognized", "listeners", "to", "the", "plugin", "." ]
fa3252d4f7541dbe151b92c3d4f6f91433cd1673
https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.shell/src/main/java/org/carewebframework/shell/plugins/PluginController.java#L96-L99
train
carewebframework/carewebframework-core
org.carewebframework.shell/src/main/java/org/carewebframework/shell/plugins/PluginController.java
PluginController.removeThread
@Override protected IAbortable removeThread(IAbortable thread) { super.removeThread(thread); if (!hasActiveThreads()) { showBusy(null); } return thread; }
java
@Override protected IAbortable removeThread(IAbortable thread) { super.removeThread(thread); if (!hasActiveThreads()) { showBusy(null); } return thread; }
[ "@", "Override", "protected", "IAbortable", "removeThread", "(", "IAbortable", "thread", ")", "{", "super", ".", "removeThread", "(", "thread", ")", ";", "if", "(", "!", "hasActiveThreads", "(", ")", ")", "{", "showBusy", "(", "null", ")", ";", "}", "ret...
Remove a thread from the active list. Clears the busy state if this was the last active thread. @param thread Thread to remove. @return The thread that was removed.
[ "Remove", "a", "thread", "from", "the", "active", "list", ".", "Clears", "the", "busy", "state", "if", "this", "was", "the", "last", "active", "thread", "." ]
fa3252d4f7541dbe151b92c3d4f6f91433cd1673
https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.shell/src/main/java/org/carewebframework/shell/plugins/PluginController.java#L112-L121
train
carewebframework/carewebframework-core
org.carewebframework.plugin-parent/org.carewebframework.plugin.infopanel/src/main/java/org/carewebframework/plugin/infopanel/controller/ActionListener.java
ActionListener.bindActionListeners
public static void bindActionListeners(IActionTarget target, List<ActionListener> actionListeners) { if (actionListeners != null) { for (ActionListener actionListener : actionListeners) { actionListener.bind(target); } } }
java
public static void bindActionListeners(IActionTarget target, List<ActionListener> actionListeners) { if (actionListeners != null) { for (ActionListener actionListener : actionListeners) { actionListener.bind(target); } } }
[ "public", "static", "void", "bindActionListeners", "(", "IActionTarget", "target", ",", "List", "<", "ActionListener", ">", "actionListeners", ")", "{", "if", "(", "actionListeners", "!=", "null", ")", "{", "for", "(", "ActionListener", "actionListener", ":", "a...
Binds the action listeners to the specified target. @param target The target to be bound to the created listeners. @param actionListeners The action listeners to be bound.
[ "Binds", "the", "action", "listeners", "to", "the", "specified", "target", "." ]
fa3252d4f7541dbe151b92c3d4f6f91433cd1673
https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.plugin-parent/org.carewebframework.plugin.infopanel/src/main/java/org/carewebframework/plugin/infopanel/controller/ActionListener.java#L57-L63
train
carewebframework/carewebframework-core
org.carewebframework.plugin-parent/org.carewebframework.plugin.infopanel/src/main/java/org/carewebframework/plugin/infopanel/controller/ActionListener.java
ActionListener.unbindActionListeners
public static void unbindActionListeners(IActionTarget target, List<ActionListener> actionListeners) { if (actionListeners != null) { for (ActionListener listener : actionListeners) { listener.unbind(target); } } }
java
public static void unbindActionListeners(IActionTarget target, List<ActionListener> actionListeners) { if (actionListeners != null) { for (ActionListener listener : actionListeners) { listener.unbind(target); } } }
[ "public", "static", "void", "unbindActionListeners", "(", "IActionTarget", "target", ",", "List", "<", "ActionListener", ">", "actionListeners", ")", "{", "if", "(", "actionListeners", "!=", "null", ")", "{", "for", "(", "ActionListener", "listener", ":", "actio...
Unbinds all action listeners from the specified target. @param target The action target. @param actionListeners List of action listeners.
[ "Unbinds", "all", "action", "listeners", "from", "the", "specified", "target", "." ]
fa3252d4f7541dbe151b92c3d4f6f91433cd1673
https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.plugin-parent/org.carewebframework.plugin.infopanel/src/main/java/org/carewebframework/plugin/infopanel/controller/ActionListener.java#L71-L77
train
carewebframework/carewebframework-core
org.carewebframework.plugin-parent/org.carewebframework.plugin.infopanel/src/main/java/org/carewebframework/plugin/infopanel/controller/ActionListener.java
ActionListener.eventCallback
@Override public void eventCallback(String eventName, Object eventData) { for (IActionTarget target : new ArrayList<>(targets)) { try { target.doAction(action); } catch (Throwable t) { } } }
java
@Override public void eventCallback(String eventName, Object eventData) { for (IActionTarget target : new ArrayList<>(targets)) { try { target.doAction(action); } catch (Throwable t) { } } }
[ "@", "Override", "public", "void", "eventCallback", "(", "String", "eventName", ",", "Object", "eventData", ")", "{", "for", "(", "IActionTarget", "target", ":", "new", "ArrayList", "<>", "(", "targets", ")", ")", "{", "try", "{", "target", ".", "doAction"...
This is the callback for the generic event that is monitored by this listener. It will result in the invocation of the doAction method of each bound action target.
[ "This", "is", "the", "callback", "for", "the", "generic", "event", "that", "is", "monitored", "by", "this", "listener", ".", "It", "will", "result", "in", "the", "invocation", "of", "the", "doAction", "method", "of", "each", "bound", "action", "target", "....
fa3252d4f7541dbe151b92c3d4f6f91433cd1673
https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.plugin-parent/org.carewebframework.plugin.infopanel/src/main/java/org/carewebframework/plugin/infopanel/controller/ActionListener.java#L88-L97
train
carewebframework/carewebframework-core
org.carewebframework.plugin-parent/org.carewebframework.plugin.infopanel/src/main/java/org/carewebframework/plugin/infopanel/controller/ActionListener.java
ActionListener.bind
private void bind(IActionTarget target) { if (targets.isEmpty()) { getEventManager().subscribe(eventName, this); } targets.add(target); }
java
private void bind(IActionTarget target) { if (targets.isEmpty()) { getEventManager().subscribe(eventName, this); } targets.add(target); }
[ "private", "void", "bind", "(", "IActionTarget", "target", ")", "{", "if", "(", "targets", ".", "isEmpty", "(", ")", ")", "{", "getEventManager", "(", ")", ".", "subscribe", "(", "eventName", ",", "this", ")", ";", "}", "targets", ".", "add", "(", "t...
Binds the specified action target to this event listener. @param target The action target to bind.
[ "Binds", "the", "specified", "action", "target", "to", "this", "event", "listener", "." ]
fa3252d4f7541dbe151b92c3d4f6f91433cd1673
https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.plugin-parent/org.carewebframework.plugin.infopanel/src/main/java/org/carewebframework/plugin/infopanel/controller/ActionListener.java#L104-L110
train
carewebframework/carewebframework-core
org.carewebframework.plugin-parent/org.carewebframework.plugin.infopanel/src/main/java/org/carewebframework/plugin/infopanel/controller/ActionListener.java
ActionListener.unbind
private void unbind(IActionTarget target) { if (targets.remove(target) && targets.isEmpty()) { getEventManager().unsubscribe(eventName, this); } }
java
private void unbind(IActionTarget target) { if (targets.remove(target) && targets.isEmpty()) { getEventManager().unsubscribe(eventName, this); } }
[ "private", "void", "unbind", "(", "IActionTarget", "target", ")", "{", "if", "(", "targets", ".", "remove", "(", "target", ")", "&&", "targets", ".", "isEmpty", "(", ")", ")", "{", "getEventManager", "(", ")", ".", "unsubscribe", "(", "eventName", ",", ...
Unbinds the specified action target from this event listener. @param target The action target to unbind.
[ "Unbinds", "the", "specified", "action", "target", "from", "this", "event", "listener", "." ]
fa3252d4f7541dbe151b92c3d4f6f91433cd1673
https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.plugin-parent/org.carewebframework.plugin.infopanel/src/main/java/org/carewebframework/plugin/infopanel/controller/ActionListener.java#L117-L121
train
carewebframework/carewebframework-core
org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/messaging/ConsumerService.java
ConsumerService.getCallbacks
private synchronized LinkedHashSet<IMessageCallback> getCallbacks(String channel, boolean autoCreate, boolean clone) { LinkedHashSet<IMessageCallback> result = callbacks.get(channel); if (result == null && autoCreate) { callbacks.put(channel, result = new LinkedHashSet<>()); } return result == null ? null : clone ? new LinkedHashSet<>(result) : result; }
java
private synchronized LinkedHashSet<IMessageCallback> getCallbacks(String channel, boolean autoCreate, boolean clone) { LinkedHashSet<IMessageCallback> result = callbacks.get(channel); if (result == null && autoCreate) { callbacks.put(channel, result = new LinkedHashSet<>()); } return result == null ? null : clone ? new LinkedHashSet<>(result) : result; }
[ "private", "synchronized", "LinkedHashSet", "<", "IMessageCallback", ">", "getCallbacks", "(", "String", "channel", ",", "boolean", "autoCreate", ",", "boolean", "clone", ")", "{", "LinkedHashSet", "<", "IMessageCallback", ">", "result", "=", "callbacks", ".", "ge...
Return the callbacks associated with the specified channel. @param channel The channel. @param autoCreate Create the callback list if one doesn't exist. @param clone Return a clone of the callback list. @return The callback list (possibly null).
[ "Return", "the", "callbacks", "associated", "with", "the", "specified", "channel", "." ]
fa3252d4f7541dbe151b92c3d4f6f91433cd1673
https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/messaging/ConsumerService.java#L111-L119
train
carewebframework/carewebframework-core
org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/messaging/ConsumerService.java
ConsumerService.onMessage
@Override public void onMessage(String channel, Message message) { if (MessageUtil.isMessageExcluded(message, RecipientType.CONSUMER, nodeId)) { return; } if (updateDelivered(message)) { LinkedHashSet<IMessageCallback> callbacks = getCallbacks(channel, false, true); if (callbacks != null) { dispatchMessages(channel, message, callbacks); } } }
java
@Override public void onMessage(String channel, Message message) { if (MessageUtil.isMessageExcluded(message, RecipientType.CONSUMER, nodeId)) { return; } if (updateDelivered(message)) { LinkedHashSet<IMessageCallback> callbacks = getCallbacks(channel, false, true); if (callbacks != null) { dispatchMessages(channel, message, callbacks); } } }
[ "@", "Override", "public", "void", "onMessage", "(", "String", "channel", ",", "Message", "message", ")", "{", "if", "(", "MessageUtil", ".", "isMessageExcluded", "(", "message", ",", "RecipientType", ".", "CONSUMER", ",", "nodeId", ")", ")", "{", "return", ...
Callback entry point for all registered consumers.
[ "Callback", "entry", "point", "for", "all", "registered", "consumers", "." ]
fa3252d4f7541dbe151b92c3d4f6f91433cd1673
https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/messaging/ConsumerService.java#L147-L160
train
carewebframework/carewebframework-core
org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/messaging/ConsumerService.java
ConsumerService.updateDelivered
private boolean updateDelivered(Message message) { if (consumers.size() <= 1) { return true; } String pubid = (String) message.getMetadata("cwf.pub.event"); return deliveredMessageCache.putIfAbsent(pubid, "") == null; }
java
private boolean updateDelivered(Message message) { if (consumers.size() <= 1) { return true; } String pubid = (String) message.getMetadata("cwf.pub.event"); return deliveredMessageCache.putIfAbsent(pubid, "") == null; }
[ "private", "boolean", "updateDelivered", "(", "Message", "message", ")", "{", "if", "(", "consumers", ".", "size", "(", ")", "<=", "1", ")", "{", "return", "true", ";", "}", "String", "pubid", "=", "(", "String", ")", "message", ".", "getMetadata", "("...
Updates the delivered message cache. This avoids delivering the same message transported by different messaging frameworks. If we have only one consumer registered, we don't need to worry about this. @param message The message being delivered. @return True if the cache was updated (i.e., the message has not been previously delivered).
[ "Updates", "the", "delivered", "message", "cache", ".", "This", "avoids", "delivering", "the", "same", "message", "transported", "by", "different", "messaging", "frameworks", ".", "If", "we", "have", "only", "one", "consumer", "registered", "we", "don", "t", "...
fa3252d4f7541dbe151b92c3d4f6f91433cd1673
https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/messaging/ConsumerService.java#L170-L177
train
carewebframework/carewebframework-core
org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/messaging/ConsumerService.java
ConsumerService.dispatchMessages
protected void dispatchMessages(String channel, Message message, Set<IMessageCallback> callbacks) { for (IMessageCallback callback : callbacks) { try { callback.onMessage(channel, message); } catch (Exception e) { } } }
java
protected void dispatchMessages(String channel, Message message, Set<IMessageCallback> callbacks) { for (IMessageCallback callback : callbacks) { try { callback.onMessage(channel, message); } catch (Exception e) { } } }
[ "protected", "void", "dispatchMessages", "(", "String", "channel", ",", "Message", "message", ",", "Set", "<", "IMessageCallback", ">", "callbacks", ")", "{", "for", "(", "IMessageCallback", "callback", ":", "callbacks", ")", "{", "try", "{", "callback", ".", ...
Dispatch message to callback. Override to address special threading considerations. @param channel The channel that delivered the message. @param message The message to dispatch. @param callbacks The callbacks to receive the message.
[ "Dispatch", "message", "to", "callback", ".", "Override", "to", "address", "special", "threading", "considerations", "." ]
fa3252d4f7541dbe151b92c3d4f6f91433cd1673
https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/messaging/ConsumerService.java#L186-L194
train
carewebframework/carewebframework-core
org.carewebframework.ui-parent/org.carewebframework.ui.sharedforms/src/main/java/org/carewebframework/ui/sharedforms/CaptionedFormController.java
CaptionedFormController.updateStyle
private void updateStyle() { CaptionStyle cs = captionStyle == null ? CaptionStyle.HIDDEN : captionStyle; String background = null; switch (cs) { case FRAME: break; case TITLE: break; case LEFT: background = getGradValue(color1, color2); break; case RIGHT: background = getGradValue(color2, color1); break; case CENTER: background = getGradValue(color1, color2, color1); break; } panel.addClass("sharedForms-captioned sharedForms-captioned-caption-" + cs.name().toLowerCase()); String css = "##{id}-titlebar "; if (cs == CaptionStyle.HIDDEN) { css += "{display:none}"; } else { css += "{background: " + background + "}"; } panel.setCss(css); }
java
private void updateStyle() { CaptionStyle cs = captionStyle == null ? CaptionStyle.HIDDEN : captionStyle; String background = null; switch (cs) { case FRAME: break; case TITLE: break; case LEFT: background = getGradValue(color1, color2); break; case RIGHT: background = getGradValue(color2, color1); break; case CENTER: background = getGradValue(color1, color2, color1); break; } panel.addClass("sharedForms-captioned sharedForms-captioned-caption-" + cs.name().toLowerCase()); String css = "##{id}-titlebar "; if (cs == CaptionStyle.HIDDEN) { css += "{display:none}"; } else { css += "{background: " + background + "}"; } panel.setCss(css); }
[ "private", "void", "updateStyle", "(", ")", "{", "CaptionStyle", "cs", "=", "captionStyle", "==", "null", "?", "CaptionStyle", ".", "HIDDEN", ":", "captionStyle", ";", "String", "background", "=", "null", ";", "switch", "(", "cs", ")", "{", "case", "FRAME"...
Update styles by current caption style setting.
[ "Update", "styles", "by", "current", "caption", "style", "setting", "." ]
fa3252d4f7541dbe151b92c3d4f6f91433cd1673
https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.ui-parent/org.carewebframework.ui.sharedforms/src/main/java/org/carewebframework/ui/sharedforms/CaptionedFormController.java#L79-L114
train
ologolo/streamline-engine
src/org/daisy/streamline/engine/impl/DefaultTaskSystem.java
DefaultTaskSystem.getPath
static List<TaskGroupInformation> getPath(TaskGroupFactoryMakerService imf, TaskSystemInformation def, String locale) throws TaskSystemException { Set<TaskGroupInformation> specs = imf.list(locale); Map<String, List<TaskGroupInformation>> byInput = byInput(specs); return getPathSpecifications(def.getInputType().getIdentifier(), def.getOutputType().getIdentifier(), byInput); }
java
static List<TaskGroupInformation> getPath(TaskGroupFactoryMakerService imf, TaskSystemInformation def, String locale) throws TaskSystemException { Set<TaskGroupInformation> specs = imf.list(locale); Map<String, List<TaskGroupInformation>> byInput = byInput(specs); return getPathSpecifications(def.getInputType().getIdentifier(), def.getOutputType().getIdentifier(), byInput); }
[ "static", "List", "<", "TaskGroupInformation", ">", "getPath", "(", "TaskGroupFactoryMakerService", "imf", ",", "TaskSystemInformation", "def", ",", "String", "locale", ")", "throws", "TaskSystemException", "{", "Set", "<", "TaskGroupInformation", ">", "specs", "=", ...
Finds a path for the given specifications @param input the input format @param output the output format @param locale the target locale @param parameters the parameters @return returns a list of task groups @throws TaskSystemException
[ "Finds", "a", "path", "for", "the", "given", "specifications" ]
04b7adc85d84d91dc5f0eaaa401d2738f9401b17
https://github.com/ologolo/streamline-engine/blob/04b7adc85d84d91dc5f0eaaa401d2738f9401b17/src/org/daisy/streamline/engine/impl/DefaultTaskSystem.java#L105-L110
train
carewebframework/carewebframework-core
org.carewebframework.shell/src/main/java/org/carewebframework/shell/elements/ElementToolbar.java
ElementToolbar.addToolbarComponent
public void addToolbarComponent(BaseComponent component, String action) { BaseComponent ref = toolbar.getFirstChild(); if (component instanceof Toolbar) { BaseComponent child; while ((child = component.getFirstChild()) != null) { toolbar.addChild(child, ref); } } else { toolbar.addChild(component, ref); ActionUtil.addAction(component, action); } }
java
public void addToolbarComponent(BaseComponent component, String action) { BaseComponent ref = toolbar.getFirstChild(); if (component instanceof Toolbar) { BaseComponent child; while ((child = component.getFirstChild()) != null) { toolbar.addChild(child, ref); } } else { toolbar.addChild(component, ref); ActionUtil.addAction(component, action); } }
[ "public", "void", "addToolbarComponent", "(", "BaseComponent", "component", ",", "String", "action", ")", "{", "BaseComponent", "ref", "=", "toolbar", ".", "getFirstChild", "(", ")", ";", "if", "(", "component", "instanceof", "Toolbar", ")", "{", "BaseComponent"...
Adds a component to the toolbar. @param component Component to add. If the component is a toolbar itself, its children will be added to the toolbar. @param action The action to associate with the component.
[ "Adds", "a", "component", "to", "the", "toolbar", "." ]
fa3252d4f7541dbe151b92c3d4f6f91433cd1673
https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.shell/src/main/java/org/carewebframework/shell/elements/ElementToolbar.java#L72-L86
train
carewebframework/carewebframework-core
org.carewebframework.mvn-parent/org.carewebframework.mvn.plugin-parent/org.carewebframework.mvn.plugin.helpconverter/src/main/java/org/carewebframework/maven/plugin/help/chm/BaseTransform.java
BaseTransform.extractAttribute
protected String extractAttribute(String name, String line) { int i = line.indexOf(name + "=\""); i = i == -1 ? i : i + name.length() + 2; int j = i == -1 ? -1 : line.indexOf("\"", i); return j == -1 ? null : line.substring(i, j); }
java
protected String extractAttribute(String name, String line) { int i = line.indexOf(name + "=\""); i = i == -1 ? i : i + name.length() + 2; int j = i == -1 ? -1 : line.indexOf("\"", i); return j == -1 ? null : line.substring(i, j); }
[ "protected", "String", "extractAttribute", "(", "String", "name", ",", "String", "line", ")", "{", "int", "i", "=", "line", ".", "indexOf", "(", "name", "+", "\"=\\\"\"", ")", ";", "i", "=", "i", "==", "-", "1", "?", "i", ":", "i", "+", "name", "...
Extracts the value of the named attribute. @param name The attribute name. @param line The source line. @return The attribute value, or null if not found.
[ "Extracts", "the", "value", "of", "the", "named", "attribute", "." ]
fa3252d4f7541dbe151b92c3d4f6f91433cd1673
https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.mvn-parent/org.carewebframework.mvn.plugin-parent/org.carewebframework.mvn.plugin.helpconverter/src/main/java/org/carewebframework/maven/plugin/help/chm/BaseTransform.java#L84-L89
train
carewebframework/carewebframework-core
org.carewebframework.mvn-parent/org.carewebframework.mvn.plugin-parent/org.carewebframework.mvn.plugin.helpconverter/src/main/java/org/carewebframework/maven/plugin/help/chm/BaseTransform.java
BaseTransform.write
protected void write(OutputStream outputStream, String data, boolean terminate, int level) { try { if (data != null) { if (level > 0) { outputStream.write(StringUtils.repeat(" ", level).getBytes(CS_UTF8)); } outputStream.write(data.getBytes(CS_UTF8)); if (terminate) { outputStream.write("\n".getBytes()); } } } catch (IOException e) { throw new RuntimeException(e); } }
java
protected void write(OutputStream outputStream, String data, boolean terminate, int level) { try { if (data != null) { if (level > 0) { outputStream.write(StringUtils.repeat(" ", level).getBytes(CS_UTF8)); } outputStream.write(data.getBytes(CS_UTF8)); if (terminate) { outputStream.write("\n".getBytes()); } } } catch (IOException e) { throw new RuntimeException(e); } }
[ "protected", "void", "write", "(", "OutputStream", "outputStream", ",", "String", "data", ",", "boolean", "terminate", ",", "int", "level", ")", "{", "try", "{", "if", "(", "data", "!=", "null", ")", "{", "if", "(", "level", ">", "0", ")", "{", "outp...
Write data to the output stream with the specified formatting. @param outputStream The output stream. @param data The data to write. @param terminate If true, add a line terminator. @param level The indent level.
[ "Write", "data", "to", "the", "output", "stream", "with", "the", "specified", "formatting", "." ]
fa3252d4f7541dbe151b92c3d4f6f91433cd1673
https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.mvn-parent/org.carewebframework.mvn.plugin-parent/org.carewebframework.mvn.plugin.helpconverter/src/main/java/org/carewebframework/maven/plugin/help/chm/BaseTransform.java#L135-L151
train
carewebframework/carewebframework-core
org.carewebframework.ui-parent/org.carewebframework.ui.popupsupport/src/main/java/org/carewebframework/ui/popupsupport/PopupSupport.java
PopupSupport.closeAll
public synchronized void closeAll() { for (Window window : windows) { try { window.removeEventListener("close", this); window.destroy(); } catch (Throwable e) { } } windows.clear(); resetPosition(); }
java
public synchronized void closeAll() { for (Window window : windows) { try { window.removeEventListener("close", this); window.destroy(); } catch (Throwable e) { } } windows.clear(); resetPosition(); }
[ "public", "synchronized", "void", "closeAll", "(", ")", "{", "for", "(", "Window", "window", ":", "windows", ")", "{", "try", "{", "window", ".", "removeEventListener", "(", "\"close\"", ",", "this", ")", ";", "window", ".", "destroy", "(", ")", ";", "...
Close all open popups.
[ "Close", "all", "open", "popups", "." ]
fa3252d4f7541dbe151b92c3d4f6f91433cd1673
https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.ui-parent/org.carewebframework.ui.popupsupport/src/main/java/org/carewebframework/ui/popupsupport/PopupSupport.java#L89-L101
train
carewebframework/carewebframework-core
org.carewebframework.ui-parent/org.carewebframework.ui.popupsupport/src/main/java/org/carewebframework/ui/popupsupport/PopupSupport.java
PopupSupport.eventCallback
@SuppressWarnings("deprecation") @Override public void eventCallback(String eventName, Object eventData) { try { PopupData popupData = null; if (eventData instanceof PopupData) { popupData = (PopupData) eventData; } else { popupData = new PopupData(eventData.toString()); } if (popupData.isEmpty()) { return; } Page currentPage = ExecutionContext.getPage(); Window window = getPopupWindow(); window.setTitle(popupData.getTitle()); window.setParent(currentPage); String pos = getPosition(); window.addStyle("left", pos); window.addStyle("top", pos); window.addEventListener("close", this); Label label = window.findByName("messagetext", Label.class); label.setLabel(popupData.getMessage()); window.setMode(Mode.POPUP); } catch (Exception e) {} }
java
@SuppressWarnings("deprecation") @Override public void eventCallback(String eventName, Object eventData) { try { PopupData popupData = null; if (eventData instanceof PopupData) { popupData = (PopupData) eventData; } else { popupData = new PopupData(eventData.toString()); } if (popupData.isEmpty()) { return; } Page currentPage = ExecutionContext.getPage(); Window window = getPopupWindow(); window.setTitle(popupData.getTitle()); window.setParent(currentPage); String pos = getPosition(); window.addStyle("left", pos); window.addStyle("top", pos); window.addEventListener("close", this); Label label = window.findByName("messagetext", Label.class); label.setLabel(popupData.getMessage()); window.setMode(Mode.POPUP); } catch (Exception e) {} }
[ "@", "SuppressWarnings", "(", "\"deprecation\"", ")", "@", "Override", "public", "void", "eventCallback", "(", "String", "eventName", ",", "Object", "eventData", ")", "{", "try", "{", "PopupData", "popupData", "=", "null", ";", "if", "(", "eventData", "instanc...
Popup event handler - display popup dialog upon receipt. @param eventName Name of popupEvent @param eventData May either be an encoded string (for backward compatibility) or a PopupData instance.
[ "Popup", "event", "handler", "-", "display", "popup", "dialog", "upon", "receipt", "." ]
fa3252d4f7541dbe151b92c3d4f6f91433cd1673
https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.ui-parent/org.carewebframework.ui.popupsupport/src/main/java/org/carewebframework/ui/popupsupport/PopupSupport.java#L110-L138
train
carewebframework/carewebframework-core
org.carewebframework.ui-parent/org.carewebframework.ui.popupsupport/src/main/java/org/carewebframework/ui/popupsupport/PopupSupport.java
PopupSupport.getPopupWindow
private synchronized Window getPopupWindow() throws Exception { if (popupDefinition == null) { popupDefinition = PageParser.getInstance().parse(RESOURCE_PREFIX + "popupWindow.fsp"); } Window window = (Window) popupDefinition.materialize(null); windows.add(window); return window; }
java
private synchronized Window getPopupWindow() throws Exception { if (popupDefinition == null) { popupDefinition = PageParser.getInstance().parse(RESOURCE_PREFIX + "popupWindow.fsp"); } Window window = (Window) popupDefinition.materialize(null); windows.add(window); return window; }
[ "private", "synchronized", "Window", "getPopupWindow", "(", ")", "throws", "Exception", "{", "if", "(", "popupDefinition", "==", "null", ")", "{", "popupDefinition", "=", "PageParser", ".", "getInstance", "(", ")", ".", "parse", "(", "RESOURCE_PREFIX", "+", "\...
Return a popup window instance. @return A popup window instance. @throws Exception Unspecified exception.
[ "Return", "a", "popup", "window", "instance", "." ]
fa3252d4f7541dbe151b92c3d4f6f91433cd1673
https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.ui-parent/org.carewebframework.ui.popupsupport/src/main/java/org/carewebframework/ui/popupsupport/PopupSupport.java#L165-L173
train
carewebframework/carewebframework-core
org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/spring/BeanRegistry.java
BeanRegistry.postProcessAfterInitialization
@SuppressWarnings("unchecked") @Override public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException { if (clazz.isInstance(bean)) { register((V) bean); } return bean; }
java
@SuppressWarnings("unchecked") @Override public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException { if (clazz.isInstance(bean)) { register((V) bean); } return bean; }
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "@", "Override", "public", "Object", "postProcessAfterInitialization", "(", "Object", "bean", ",", "String", "beanName", ")", "throws", "BeansException", "{", "if", "(", "clazz", ".", "isInstance", "(", "bean", ...
If the managed bean is of the desired type, add it to the registry.
[ "If", "the", "managed", "bean", "is", "of", "the", "desired", "type", "add", "it", "to", "the", "registry", "." ]
fa3252d4f7541dbe151b92c3d4f6f91433cd1673
https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/spring/BeanRegistry.java#L61-L69
train
carewebframework/carewebframework-core
org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/spring/BeanRegistry.java
BeanRegistry.postProcessBeforeDestruction
@SuppressWarnings("unchecked") @Override public void postProcessBeforeDestruction(Object bean, String beanName) throws BeansException { if (clazz.isInstance(bean)) { unregister((V) bean); } }
java
@SuppressWarnings("unchecked") @Override public void postProcessBeforeDestruction(Object bean, String beanName) throws BeansException { if (clazz.isInstance(bean)) { unregister((V) bean); } }
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "@", "Override", "public", "void", "postProcessBeforeDestruction", "(", "Object", "bean", ",", "String", "beanName", ")", "throws", "BeansException", "{", "if", "(", "clazz", ".", "isInstance", "(", "bean", ")"...
If the managed bean is of the desired type, remove it from the registry.
[ "If", "the", "managed", "bean", "is", "of", "the", "desired", "type", "remove", "it", "from", "the", "registry", "." ]
fa3252d4f7541dbe151b92c3d4f6f91433cd1673
https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/spring/BeanRegistry.java#L74-L80
train
carewebframework/carewebframework-core
org.carewebframework.ui-parent/org.carewebframework.ui.core/src/main/java/org/carewebframework/ui/dialog/DateRangePicker.java
DateRangePicker.loadChoices
public void loadChoices(Iterable<String> choices) { clear(); if (choices != null) { for (String choice : choices) { addChoice(choice, false); } } checkSelection(true); }
java
public void loadChoices(Iterable<String> choices) { clear(); if (choices != null) { for (String choice : choices) { addChoice(choice, false); } } checkSelection(true); }
[ "public", "void", "loadChoices", "(", "Iterable", "<", "String", ">", "choices", ")", "{", "clear", "(", ")", ";", "if", "(", "choices", "!=", "null", ")", "{", "for", "(", "String", "choice", ":", "choices", ")", "{", "addChoice", "(", "choice", ","...
Load choices from a list. @param choices A list of choices.
[ "Load", "choices", "from", "a", "list", "." ]
fa3252d4f7541dbe151b92c3d4f6f91433cd1673
https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.ui-parent/org.carewebframework.ui.core/src/main/java/org/carewebframework/ui/dialog/DateRangePicker.java#L104-L114
train
carewebframework/carewebframework-core
org.carewebframework.ui-parent/org.carewebframework.ui.core/src/main/java/org/carewebframework/ui/dialog/DateRangePicker.java
DateRangePicker.addChoice
public Dateitem addChoice(DateRange range, boolean isCustom) { Dateitem item; if (isCustom) { item = findMatchingItem(range); if (item != null) { return item; } } item = new Dateitem(); item.setLabel(range.getLabel()); item.setData(range); addChild(item, isCustom ? null : customItem); if (range.isDefault()) { setSelectedItem(item); } return item; }
java
public Dateitem addChoice(DateRange range, boolean isCustom) { Dateitem item; if (isCustom) { item = findMatchingItem(range); if (item != null) { return item; } } item = new Dateitem(); item.setLabel(range.getLabel()); item.setData(range); addChild(item, isCustom ? null : customItem); if (range.isDefault()) { setSelectedItem(item); } return item; }
[ "public", "Dateitem", "addChoice", "(", "DateRange", "range", ",", "boolean", "isCustom", ")", "{", "Dateitem", "item", ";", "if", "(", "isCustom", ")", "{", "item", "=", "findMatchingItem", "(", "range", ")", ";", "if", "(", "item", "!=", "null", ")", ...
Adds a date range to the choice list. @param range Date range item @param isCustom If true, range is a custom item. In this case, if another matching custom item exists, it will not be added. @return combo box item that was added (or found if duplicate custom item).
[ "Adds", "a", "date", "range", "to", "the", "choice", "list", "." ]
fa3252d4f7541dbe151b92c3d4f6f91433cd1673
https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.ui-parent/org.carewebframework.ui.core/src/main/java/org/carewebframework/ui/dialog/DateRangePicker.java#L124-L145
train
carewebframework/carewebframework-core
org.carewebframework.ui-parent/org.carewebframework.ui.core/src/main/java/org/carewebframework/ui/dialog/DateRangePicker.java
DateRangePicker.findMatchingItem
public Dateitem findMatchingItem(DateRange range) { for (BaseComponent item : getChildren()) { if (range.equals(item.getData())) { return (Dateitem) item; } } return null; }
java
public Dateitem findMatchingItem(DateRange range) { for (BaseComponent item : getChildren()) { if (range.equals(item.getData())) { return (Dateitem) item; } } return null; }
[ "public", "Dateitem", "findMatchingItem", "(", "DateRange", "range", ")", "{", "for", "(", "BaseComponent", "item", ":", "getChildren", "(", ")", ")", "{", "if", "(", "range", ".", "equals", "(", "item", ".", "getData", "(", ")", ")", ")", "{", "return...
Searches for a comboitem that has a date range equivalent to the specified range. @param range The date range to locate. @return A comboitem containing the date range, or null if not found.
[ "Searches", "for", "a", "comboitem", "that", "has", "a", "date", "range", "equivalent", "to", "the", "specified", "range", "." ]
fa3252d4f7541dbe151b92c3d4f6f91433cd1673
https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.ui-parent/org.carewebframework.ui.core/src/main/java/org/carewebframework/ui/dialog/DateRangePicker.java#L180-L188
train
carewebframework/carewebframework-core
org.carewebframework.ui-parent/org.carewebframework.ui.core/src/main/java/org/carewebframework/ui/dialog/DateRangePicker.java
DateRangePicker.findMatchingItem
public Dateitem findMatchingItem(String label) { for (BaseComponent child : getChildren()) { Dateitem item = (Dateitem) child; if (label.equalsIgnoreCase(item.getLabel())) { return item; } } return null; }
java
public Dateitem findMatchingItem(String label) { for (BaseComponent child : getChildren()) { Dateitem item = (Dateitem) child; if (label.equalsIgnoreCase(item.getLabel())) { return item; } } return null; }
[ "public", "Dateitem", "findMatchingItem", "(", "String", "label", ")", "{", "for", "(", "BaseComponent", "child", ":", "getChildren", "(", ")", ")", "{", "Dateitem", "item", "=", "(", "Dateitem", ")", "child", ";", "if", "(", "label", ".", "equalsIgnoreCas...
Searches for a comboitem that has a label that matches the specified value. The search is case insensitive. @param label Label text to find. @return A comboitem with a matching label., or null if not found.
[ "Searches", "for", "a", "comboitem", "that", "has", "a", "label", "that", "matches", "the", "specified", "value", ".", "The", "search", "is", "case", "insensitive", "." ]
fa3252d4f7541dbe151b92c3d4f6f91433cd1673
https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.ui-parent/org.carewebframework.ui.core/src/main/java/org/carewebframework/ui/dialog/DateRangePicker.java#L197-L207
train
carewebframework/carewebframework-core
org.carewebframework.ui-parent/org.carewebframework.ui.core/src/main/java/org/carewebframework/ui/dialog/DateRangePicker.java
DateRangePicker.checkSelection
private void checkSelection(boolean suppressEvent) { Dateitem selectedItem = getSelectedItem(); if (selectedItem == null) { selectedItem = lastSelectedItem; setSelectedItem(selectedItem); } else if (selectedItem != customItem && lastSelectedItem != selectedItem) { lastSelectedItem = selectedItem; if (!suppressEvent) { EventUtil.send(new Event(ON_SELECT_RANGE, this)); } } updateSelection(); }
java
private void checkSelection(boolean suppressEvent) { Dateitem selectedItem = getSelectedItem(); if (selectedItem == null) { selectedItem = lastSelectedItem; setSelectedItem(selectedItem); } else if (selectedItem != customItem && lastSelectedItem != selectedItem) { lastSelectedItem = selectedItem; if (!suppressEvent) { EventUtil.send(new Event(ON_SELECT_RANGE, this)); } } updateSelection(); }
[ "private", "void", "checkSelection", "(", "boolean", "suppressEvent", ")", "{", "Dateitem", "selectedItem", "=", "getSelectedItem", "(", ")", ";", "if", "(", "selectedItem", "==", "null", ")", "{", "selectedItem", "=", "lastSelectedItem", ";", "setSelectedItem", ...
Check the current selection. If nothing is selected, display a prompt message in gray text. Also, remembers the last selection made. @param suppressEvent If true, onSelectRange event is not fired.
[ "Check", "the", "current", "selection", ".", "If", "nothing", "is", "selected", "display", "a", "prompt", "message", "in", "gray", "text", ".", "Also", "remembers", "the", "last", "selection", "made", "." ]
fa3252d4f7541dbe151b92c3d4f6f91433cd1673
https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.ui-parent/org.carewebframework.ui.core/src/main/java/org/carewebframework/ui/dialog/DateRangePicker.java#L288-L303
train
carewebframework/carewebframework-core
org.carewebframework.ui-parent/org.carewebframework.ui.core/src/main/java/org/carewebframework/ui/dialog/DateRangePicker.java
DateRangePicker.updateSelection
private void updateSelection() { Dateitem selectedItem = getSelectedItem(); if (selectedItem == null) { addStyle("color", "gray"); } else { addStyle("color", "inherit"); } setFocus(false); }
java
private void updateSelection() { Dateitem selectedItem = getSelectedItem(); if (selectedItem == null) { addStyle("color", "gray"); } else { addStyle("color", "inherit"); } setFocus(false); }
[ "private", "void", "updateSelection", "(", ")", "{", "Dateitem", "selectedItem", "=", "getSelectedItem", "(", ")", ";", "if", "(", "selectedItem", "==", "null", ")", "{", "addStyle", "(", "\"color\"", ",", "\"gray\"", ")", ";", "}", "else", "{", "addStyle"...
Updates the visual appearance of the current selection.
[ "Updates", "the", "visual", "appearance", "of", "the", "current", "selection", "." ]
fa3252d4f7541dbe151b92c3d4f6f91433cd1673
https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.ui-parent/org.carewebframework.ui.core/src/main/java/org/carewebframework/ui/dialog/DateRangePicker.java#L313-L323
train
carewebframework/carewebframework-core
org.carewebframework.ui-parent/org.carewebframework.ui.core/src/main/java/org/carewebframework/ui/dialog/DateRangePicker.java
DateRangePicker.onChange
@EventHandler("change") private void onChange(ChangeEvent event) { // When the custom range item is selected, triggers the display of the date range dialog. if (event.getRelatedTarget() == customItem) { event.stopPropagation(); DateRangeDialog.show((range) -> { setSelectedItem(range == null ? lastSelectedItem : addChoice(range, true)); checkSelection(false); }); }
java
@EventHandler("change") private void onChange(ChangeEvent event) { // When the custom range item is selected, triggers the display of the date range dialog. if (event.getRelatedTarget() == customItem) { event.stopPropagation(); DateRangeDialog.show((range) -> { setSelectedItem(range == null ? lastSelectedItem : addChoice(range, true)); checkSelection(false); }); }
[ "@", "EventHandler", "(", "\"change\"", ")", "private", "void", "onChange", "(", "ChangeEvent", "event", ")", "{", "// When the custom range item is selected, triggers the display of the date range dialog.", "if", "(", "event", ".", "getRelatedTarget", "(", ")", "==", "cu...
Change event handler. @param event The change event.
[ "Change", "event", "handler", "." ]
fa3252d4f7541dbe151b92c3d4f6f91433cd1673
https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.ui-parent/org.carewebframework.ui.core/src/main/java/org/carewebframework/ui/dialog/DateRangePicker.java#L330-L340
train
carewebframework/carewebframework-core
org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/spring/FrameworkBeanFactory.java
FrameworkBeanFactory.getAttribute
private String getAttribute(BeanDefinition beanDefinition, String attributeName) { String value = null; while (beanDefinition != null) { value = (String) beanDefinition.getAttribute(attributeName); if (value != null) { break; } beanDefinition = beanDefinition.getOriginatingBeanDefinition(); } return value; }
java
private String getAttribute(BeanDefinition beanDefinition, String attributeName) { String value = null; while (beanDefinition != null) { value = (String) beanDefinition.getAttribute(attributeName); if (value != null) { break; } beanDefinition = beanDefinition.getOriginatingBeanDefinition(); } return value; }
[ "private", "String", "getAttribute", "(", "BeanDefinition", "beanDefinition", ",", "String", "attributeName", ")", "{", "String", "value", "=", "null", ";", "while", "(", "beanDefinition", "!=", "null", ")", "{", "value", "=", "(", "String", ")", "beanDefiniti...
Searches this bean definition and all originating bean definitions until it finds the requested attribute. @param beanDefinition Bean definition. @param attributeName Attribute to locate. @return The value of the attribute, or null if not found.
[ "Searches", "this", "bean", "definition", "and", "all", "originating", "bean", "definitions", "until", "it", "finds", "the", "requested", "attribute", "." ]
fa3252d4f7541dbe151b92c3d4f6f91433cd1673
https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/spring/FrameworkBeanFactory.java#L184-L198
train
carewebframework/carewebframework-core
org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/property/PropertyUtil.java
PropertyUtil.getValue
public static String getValue(String propertyName, String instanceName) { return getPropertyService().getValue(propertyName, instanceName); }
java
public static String getValue(String propertyName, String instanceName) { return getPropertyService().getValue(propertyName, instanceName); }
[ "public", "static", "String", "getValue", "(", "String", "propertyName", ",", "String", "instanceName", ")", "{", "return", "getPropertyService", "(", ")", ".", "getValue", "(", "propertyName", ",", "instanceName", ")", ";", "}" ]
Returns a property value as a string. @param propertyName Name of the property whose value is sought. @param instanceName An optional instance name. Use null to indicate the default instance. @return The property value, or null if not found. @see IPropertyService#getValue
[ "Returns", "a", "property", "value", "as", "a", "string", "." ]
fa3252d4f7541dbe151b92c3d4f6f91433cd1673
https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/property/PropertyUtil.java#L83-L85
train
carewebframework/carewebframework-core
org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/property/PropertyUtil.java
PropertyUtil.getValues
public static List<String> getValues(String propertyName, String instanceName) { return getPropertyService().getValues(propertyName, instanceName); }
java
public static List<String> getValues(String propertyName, String instanceName) { return getPropertyService().getValues(propertyName, instanceName); }
[ "public", "static", "List", "<", "String", ">", "getValues", "(", "String", "propertyName", ",", "String", "instanceName", ")", "{", "return", "getPropertyService", "(", ")", ".", "getValues", "(", "propertyName", ",", "instanceName", ")", ";", "}" ]
Returns a property value as a string list. @param propertyName Name of the property whose value is sought. @param instanceName An optional instance name. Specify null to indicate the default instance. @return The property value as a string list, or null if not found. @see IPropertyService#getValues
[ "Returns", "a", "property", "value", "as", "a", "string", "list", "." ]
fa3252d4f7541dbe151b92c3d4f6f91433cd1673
https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/property/PropertyUtil.java#L106-L108
train
carewebframework/carewebframework-core
org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/property/PropertyUtil.java
PropertyUtil.saveValue
public static void saveValue(String propertyName, String instanceName, boolean asGlobal, String value) { getPropertyService().saveValue(propertyName, instanceName, asGlobal, value); }
java
public static void saveValue(String propertyName, String instanceName, boolean asGlobal, String value) { getPropertyService().saveValue(propertyName, instanceName, asGlobal, value); }
[ "public", "static", "void", "saveValue", "(", "String", "propertyName", ",", "String", "instanceName", ",", "boolean", "asGlobal", ",", "String", "value", ")", "{", "getPropertyService", "(", ")", ".", "saveValue", "(", "propertyName", ",", "instanceName", ",", ...
Saves a string value to the underlying property store. @param propertyName Name of the property to be saved. @param instanceName An optional instance name. Specify null to indicate the default instance. @param asGlobal If true, save as a global property. If false, save as a user property. @param value Value to be saved. If null, any existing value is removed. @see IPropertyService#saveValue
[ "Saves", "a", "string", "value", "to", "the", "underlying", "property", "store", "." ]
fa3252d4f7541dbe151b92c3d4f6f91433cd1673
https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/property/PropertyUtil.java#L119-L121
train
carewebframework/carewebframework-core
org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/property/PropertyUtil.java
PropertyUtil.saveValues
public static void saveValues(String propertyName, String instanceName, boolean asGlobal, List<String> value) { getPropertyService().saveValues(propertyName, instanceName, asGlobal, value); }
java
public static void saveValues(String propertyName, String instanceName, boolean asGlobal, List<String> value) { getPropertyService().saveValues(propertyName, instanceName, asGlobal, value); }
[ "public", "static", "void", "saveValues", "(", "String", "propertyName", ",", "String", "instanceName", ",", "boolean", "asGlobal", ",", "List", "<", "String", ">", "value", ")", "{", "getPropertyService", "(", ")", ".", "saveValues", "(", "propertyName", ",",...
Saves a value list to the underlying property store. @param propertyName Name of the property to be saved. @param instanceName An optional instance name. Specify null to indicate the default instance. @param asGlobal If true, save as a global property. If false, save as a user property. @param value Value to be saved. If null or empty, any existing values are removed. @see IPropertyService#getValues
[ "Saves", "a", "value", "list", "to", "the", "underlying", "property", "store", "." ]
fa3252d4f7541dbe151b92c3d4f6f91433cd1673
https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/property/PropertyUtil.java#L132-L134
train
carewebframework/carewebframework-core
org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/property/PropertyUtil.java
PropertyUtil.getInstances
public static List<String> getInstances(String propertyName, boolean asGlobal) { return getPropertyService().getInstances(propertyName, asGlobal); }
java
public static List<String> getInstances(String propertyName, boolean asGlobal) { return getPropertyService().getInstances(propertyName, asGlobal); }
[ "public", "static", "List", "<", "String", ">", "getInstances", "(", "String", "propertyName", ",", "boolean", "asGlobal", ")", "{", "return", "getPropertyService", "(", ")", ".", "getInstances", "(", "propertyName", ",", "asGlobal", ")", ";", "}" ]
Returns a list of all instance id's associated with the specified property name. @param propertyName Name of the property. @param asGlobal Accesses the global property store if true, the user property store if false. @return A list of associated instance id's. May be empty, but never null. @see IPropertyService#getInstances
[ "Returns", "a", "list", "of", "all", "instance", "id", "s", "associated", "with", "the", "specified", "property", "name", "." ]
fa3252d4f7541dbe151b92c3d4f6f91433cd1673
https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/property/PropertyUtil.java#L144-L146
train
carewebframework/carewebframework-core
org.carewebframework.help-parent/org.carewebframework.help.core/src/main/java/org/carewebframework/help/viewer/HelpViewerProxy.java
HelpViewerProxy.sendRequest
private void sendRequest(String methodName, Object... params) { sendRequest(new InvocationRequest(methodName, params), true); }
java
private void sendRequest(String methodName, Object... params) { sendRequest(new InvocationRequest(methodName, params), true); }
[ "private", "void", "sendRequest", "(", "String", "methodName", ",", "Object", "...", "params", ")", "{", "sendRequest", "(", "new", "InvocationRequest", "(", "methodName", ",", "params", ")", ",", "true", ")", ";", "}" ]
Send a request to the remote viewer to request execution of the specified method. @param methodName Name of the method to execute. @param params Parameters to pass to the method (may be null).
[ "Send", "a", "request", "to", "the", "remote", "viewer", "to", "request", "execution", "of", "the", "specified", "method", "." ]
fa3252d4f7541dbe151b92c3d4f6f91433cd1673
https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.help-parent/org.carewebframework.help.core/src/main/java/org/carewebframework/help/viewer/HelpViewerProxy.java#L96-L99
train
carewebframework/carewebframework-core
org.carewebframework.help-parent/org.carewebframework.help.core/src/main/java/org/carewebframework/help/viewer/HelpViewerProxy.java
HelpViewerProxy.sendRequest
private void sendRequest(InvocationRequest helpRequest, boolean startRemoteViewer) { this.helpRequest = helpRequest; if (helpRequest != null) { if (remoteViewerActive()) { remoteQueue.sendRequest(helpRequest); this.helpRequest = null; } else if (startRemoteViewer) { startRemoteViewer(); } else { this.helpRequest = null; } } }
java
private void sendRequest(InvocationRequest helpRequest, boolean startRemoteViewer) { this.helpRequest = helpRequest; if (helpRequest != null) { if (remoteViewerActive()) { remoteQueue.sendRequest(helpRequest); this.helpRequest = null; } else if (startRemoteViewer) { startRemoteViewer(); } else { this.helpRequest = null; } } }
[ "private", "void", "sendRequest", "(", "InvocationRequest", "helpRequest", ",", "boolean", "startRemoteViewer", ")", "{", "this", ".", "helpRequest", "=", "helpRequest", ";", "if", "(", "helpRequest", "!=", "null", ")", "{", "if", "(", "remoteViewerActive", "(",...
Sends a request to the remote viewer. @param helpRequest The request to send. @param startRemoteViewer If true and the remote viewer is not running, start it.
[ "Sends", "a", "request", "to", "the", "remote", "viewer", "." ]
fa3252d4f7541dbe151b92c3d4f6f91433cd1673
https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.help-parent/org.carewebframework.help.core/src/main/java/org/carewebframework/help/viewer/HelpViewerProxy.java#L107-L120
train
carewebframework/carewebframework-core
org.carewebframework.help-parent/org.carewebframework.help.core/src/main/java/org/carewebframework/help/viewer/HelpViewerProxy.java
HelpViewerProxy.setRemoteQueue
public void setRemoteQueue(InvocationRequestQueue remoteQueue) { this.remoteQueue = remoteQueue; InvocationRequest deferredRequest = helpRequest; sendRequest(loadRequest, false); sendRequest(deferredRequest, false); }
java
public void setRemoteQueue(InvocationRequestQueue remoteQueue) { this.remoteQueue = remoteQueue; InvocationRequest deferredRequest = helpRequest; sendRequest(loadRequest, false); sendRequest(deferredRequest, false); }
[ "public", "void", "setRemoteQueue", "(", "InvocationRequestQueue", "remoteQueue", ")", "{", "this", ".", "remoteQueue", "=", "remoteQueue", ";", "InvocationRequest", "deferredRequest", "=", "helpRequest", ";", "sendRequest", "(", "loadRequest", ",", "false", ")", ";...
Sets the remote queue associated with the proxy. @param remoteQueue The remote queue.
[ "Sets", "the", "remote", "queue", "associated", "with", "the", "proxy", "." ]
fa3252d4f7541dbe151b92c3d4f6f91433cd1673
https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.help-parent/org.carewebframework.help.core/src/main/java/org/carewebframework/help/viewer/HelpViewerProxy.java#L236-L241
train
carewebframework/carewebframework-core
org.carewebframework.help-parent/org.carewebframework.help.core/src/main/java/org/carewebframework/help/HelpSetFactory.java
HelpSetFactory.register
public static Class<? extends IHelpSet> register(Class<? extends IHelpSet> clazz, String formats) { for (String type : formats.split("\\,")) { instance.map.put(type, clazz); } return clazz; }
java
public static Class<? extends IHelpSet> register(Class<? extends IHelpSet> clazz, String formats) { for (String type : formats.split("\\,")) { instance.map.put(type, clazz); } return clazz; }
[ "public", "static", "Class", "<", "?", "extends", "IHelpSet", ">", "register", "(", "Class", "<", "?", "extends", "IHelpSet", ">", "clazz", ",", "String", "formats", ")", "{", "for", "(", "String", "type", ":", "formats", ".", "split", "(", "\"\\\\,\"", ...
Register an implementation for one or more help formats. @param clazz Implementation class. @param formats Supported help formats, separated by commas. @return Returns the implementation class.
[ "Register", "an", "implementation", "for", "one", "or", "more", "help", "formats", "." ]
fa3252d4f7541dbe151b92c3d4f6f91433cd1673
https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.help-parent/org.carewebframework.help.core/src/main/java/org/carewebframework/help/HelpSetFactory.java#L61-L67
train
carewebframework/carewebframework-core
org.carewebframework.help-parent/org.carewebframework.help.core/src/main/java/org/carewebframework/help/HelpSetFactory.java
HelpSetFactory.create
public static IHelpSet create(HelpModule module) { try { Class<? extends IHelpSet> clazz = instance.map.get(module.getFormat()); if (clazz == null) { throw new Exception("Unsupported help format: " + module.getFormat()); } Constructor<? extends IHelpSet> ctor = clazz.getConstructor(HelpModule.class); return ctor.newInstance(module); } catch (Exception e) { log.error("Error creating help set for " + module.getUrl(), e); throw MiscUtil.toUnchecked(e); } }
java
public static IHelpSet create(HelpModule module) { try { Class<? extends IHelpSet> clazz = instance.map.get(module.getFormat()); if (clazz == null) { throw new Exception("Unsupported help format: " + module.getFormat()); } Constructor<? extends IHelpSet> ctor = clazz.getConstructor(HelpModule.class); return ctor.newInstance(module); } catch (Exception e) { log.error("Error creating help set for " + module.getUrl(), e); throw MiscUtil.toUnchecked(e); } }
[ "public", "static", "IHelpSet", "create", "(", "HelpModule", "module", ")", "{", "try", "{", "Class", "<", "?", "extends", "IHelpSet", ">", "clazz", "=", "instance", ".", "map", ".", "get", "(", "module", ".", "getFormat", "(", ")", ")", ";", "if", "...
Creates a help set. @param module A help module descriptor. @return An instantiation of the requested help set.
[ "Creates", "a", "help", "set", "." ]
fa3252d4f7541dbe151b92c3d4f6f91433cd1673
https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.help-parent/org.carewebframework.help.core/src/main/java/org/carewebframework/help/HelpSetFactory.java#L75-L89
train
DDTH/ddth-queue
ddth-queue-core/src/main/java/com/github/ddth/queue/impl/BaseRedisQueue.java
BaseRedisQueue.setRedisHashName
public BaseRedisQueue<ID, DATA> setRedisHashName(String redisHashName) { _redisHashName = redisHashName; this.redisHashName = _redisHashName.getBytes(QueueUtils.UTF8); return this; }
java
public BaseRedisQueue<ID, DATA> setRedisHashName(String redisHashName) { _redisHashName = redisHashName; this.redisHashName = _redisHashName.getBytes(QueueUtils.UTF8); return this; }
[ "public", "BaseRedisQueue", "<", "ID", ",", "DATA", ">", "setRedisHashName", "(", "String", "redisHashName", ")", "{", "_redisHashName", "=", "redisHashName", ";", "this", ".", "redisHashName", "=", "_redisHashName", ".", "getBytes", "(", "QueueUtils", ".", "UTF...
Name of the Redis hash to store queue messages. @param redisHashName @return
[ "Name", "of", "the", "Redis", "hash", "to", "store", "queue", "messages", "." ]
b20776850d23111d3d71fc8ed6023c590bc3621f
https://github.com/DDTH/ddth-queue/blob/b20776850d23111d3d71fc8ed6023c590bc3621f/ddth-queue-core/src/main/java/com/github/ddth/queue/impl/BaseRedisQueue.java#L145-L149
train
DDTH/ddth-queue
ddth-queue-core/src/main/java/com/github/ddth/queue/impl/BaseRedisQueue.java
BaseRedisQueue.setRedisListName
public BaseRedisQueue<ID, DATA> setRedisListName(String redisListName) { _redisListName = redisListName; this.redisListName = _redisListName.getBytes(QueueUtils.UTF8); return this; }
java
public BaseRedisQueue<ID, DATA> setRedisListName(String redisListName) { _redisListName = redisListName; this.redisListName = _redisListName.getBytes(QueueUtils.UTF8); return this; }
[ "public", "BaseRedisQueue", "<", "ID", ",", "DATA", ">", "setRedisListName", "(", "String", "redisListName", ")", "{", "_redisListName", "=", "redisListName", ";", "this", ".", "redisListName", "=", "_redisListName", ".", "getBytes", "(", "QueueUtils", ".", "UTF...
Name of the Redis list to store queue message ids. @param redisListName @return
[ "Name", "of", "the", "Redis", "list", "to", "store", "queue", "message", "ids", "." ]
b20776850d23111d3d71fc8ed6023c590bc3621f
https://github.com/DDTH/ddth-queue/blob/b20776850d23111d3d71fc8ed6023c590bc3621f/ddth-queue-core/src/main/java/com/github/ddth/queue/impl/BaseRedisQueue.java#L175-L179
train
DDTH/ddth-queue
ddth-queue-core/src/main/java/com/github/ddth/queue/impl/BaseRedisQueue.java
BaseRedisQueue.setRedisSortedSetName
public BaseRedisQueue<ID, DATA> setRedisSortedSetName(String redisSortedSetName) { _redisSortedSetName = redisSortedSetName; this.redisSortedSetName = _redisSortedSetName.getBytes(QueueUtils.UTF8); return this; }
java
public BaseRedisQueue<ID, DATA> setRedisSortedSetName(String redisSortedSetName) { _redisSortedSetName = redisSortedSetName; this.redisSortedSetName = _redisSortedSetName.getBytes(QueueUtils.UTF8); return this; }
[ "public", "BaseRedisQueue", "<", "ID", ",", "DATA", ">", "setRedisSortedSetName", "(", "String", "redisSortedSetName", ")", "{", "_redisSortedSetName", "=", "redisSortedSetName", ";", "this", ".", "redisSortedSetName", "=", "_redisSortedSetName", ".", "getBytes", "(",...
Name of the Redis sorted-set to store ephemeral message ids. @param redisSortedSetName @return
[ "Name", "of", "the", "Redis", "sorted", "-", "set", "to", "store", "ephemeral", "message", "ids", "." ]
b20776850d23111d3d71fc8ed6023c590bc3621f
https://github.com/DDTH/ddth-queue/blob/b20776850d23111d3d71fc8ed6023c590bc3621f/ddth-queue-core/src/main/java/com/github/ddth/queue/impl/BaseRedisQueue.java#L205-L209
train
carewebframework/carewebframework-core
org.carewebframework.mvn-parent/org.carewebframework.mvn.plugin-parent/org.carewebframework.mvn.plugin.core/src/main/java/org/carewebframework/maven/plugin/core/ConfigTemplate.java
ConfigTemplate.addEntry
public void addEntry(String placeholder, String... params) { ConfigEntry entry = entries.get(placeholder); String line = entry.template; for (int i = 0; i < params.length; i++) { line = line.replace("{" + i + "}", StringUtils.defaultString(params[i])); } entry.buffer.add(line); }
java
public void addEntry(String placeholder, String... params) { ConfigEntry entry = entries.get(placeholder); String line = entry.template; for (int i = 0; i < params.length; i++) { line = line.replace("{" + i + "}", StringUtils.defaultString(params[i])); } entry.buffer.add(line); }
[ "public", "void", "addEntry", "(", "String", "placeholder", ",", "String", "...", "params", ")", "{", "ConfigEntry", "entry", "=", "entries", ".", "get", "(", "placeholder", ")", ";", "String", "line", "=", "entry", ".", "template", ";", "for", "(", "int...
Adds an entry to the config file. @param placeholder Placeholder identifying insertion point for entry. @param params Parameters to be applied to the template.
[ "Adds", "an", "entry", "to", "the", "config", "file", "." ]
fa3252d4f7541dbe151b92c3d4f6f91433cd1673
https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.mvn-parent/org.carewebframework.mvn.plugin-parent/org.carewebframework.mvn.plugin.core/src/main/java/org/carewebframework/maven/plugin/core/ConfigTemplate.java#L110-L119
train
carewebframework/carewebframework-core
org.carewebframework.mvn-parent/org.carewebframework.mvn.plugin-parent/org.carewebframework.mvn.plugin.core/src/main/java/org/carewebframework/maven/plugin/core/ConfigTemplate.java
ConfigTemplate.createFile
protected void createFile(File stagingDirectory) throws MojoExecutionException { File targetDirectory = newSubdirectory(stagingDirectory, "META-INF"); File newEntry = new File(targetDirectory, filename); try (FileOutputStream out = new FileOutputStream(newEntry); PrintStream ps = new PrintStream(out);) { Iterator<ConfigEntry> iter = entries.values().iterator(); ConfigEntry entry = null; for (int i = 0; i < buffer.size(); i++) { if (entry == null && iter.hasNext()) { entry = iter.next(); } if (entry != null && entry.placeholder == i) { for (String line : entry.buffer) { ps.println(line); } entry = null; continue; } ps.println(buffer.get(i)); } } catch (Exception e) { throw new MojoExecutionException("Unexpected error while creating configuration file.", e); } }
java
protected void createFile(File stagingDirectory) throws MojoExecutionException { File targetDirectory = newSubdirectory(stagingDirectory, "META-INF"); File newEntry = new File(targetDirectory, filename); try (FileOutputStream out = new FileOutputStream(newEntry); PrintStream ps = new PrintStream(out);) { Iterator<ConfigEntry> iter = entries.values().iterator(); ConfigEntry entry = null; for (int i = 0; i < buffer.size(); i++) { if (entry == null && iter.hasNext()) { entry = iter.next(); } if (entry != null && entry.placeholder == i) { for (String line : entry.buffer) { ps.println(line); } entry = null; continue; } ps.println(buffer.get(i)); } } catch (Exception e) { throw new MojoExecutionException("Unexpected error while creating configuration file.", e); } }
[ "protected", "void", "createFile", "(", "File", "stagingDirectory", ")", "throws", "MojoExecutionException", "{", "File", "targetDirectory", "=", "newSubdirectory", "(", "stagingDirectory", ",", "\"META-INF\"", ")", ";", "File", "newEntry", "=", "new", "File", "(", ...
Create the xml configuration descriptor. @param stagingDirectory The parent directory where the configuration descriptor is to be created. @throws MojoExecutionException Unspecified exception.
[ "Create", "the", "xml", "configuration", "descriptor", "." ]
fa3252d4f7541dbe151b92c3d4f6f91433cd1673
https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.mvn-parent/org.carewebframework.mvn.plugin-parent/org.carewebframework.mvn.plugin.core/src/main/java/org/carewebframework/maven/plugin/core/ConfigTemplate.java#L128-L156
train
carewebframework/carewebframework-core
org.carewebframework.mvn-parent/org.carewebframework.mvn.plugin-parent/org.carewebframework.mvn.plugin.core/src/main/java/org/carewebframework/maven/plugin/core/ConfigTemplate.java
ConfigTemplate.newSubdirectory
private File newSubdirectory(File parentDirectory, String path) { File dir = new File(parentDirectory, path); if (!dir.exists()) { dir.mkdirs(); } return dir; }
java
private File newSubdirectory(File parentDirectory, String path) { File dir = new File(parentDirectory, path); if (!dir.exists()) { dir.mkdirs(); } return dir; }
[ "private", "File", "newSubdirectory", "(", "File", "parentDirectory", ",", "String", "path", ")", "{", "File", "dir", "=", "new", "File", "(", "parentDirectory", ",", "path", ")", ";", "if", "(", "!", "dir", ".", "exists", "(", ")", ")", "{", "dir", ...
Creates a new subdirectory under the specified parent directory. @param parentDirectory The directory under which the subdirectory will be created. @param path The full path of the subdirectory. @return The subdirectory just created.
[ "Creates", "a", "new", "subdirectory", "under", "the", "specified", "parent", "directory", "." ]
fa3252d4f7541dbe151b92c3d4f6f91433cd1673
https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.mvn-parent/org.carewebframework.mvn.plugin-parent/org.carewebframework.mvn.plugin.core/src/main/java/org/carewebframework/maven/plugin/core/ConfigTemplate.java#L165-L173
train
carewebframework/carewebframework-core
org.carewebframework.shell/src/main/java/org/carewebframework/shell/elements/ElementPlugin.java
ElementPlugin.destroy
@Override public void destroy() { shell.unregisterPlugin(this); executeAction(PluginAction.UNLOAD, false); CommandUtil.dissociateAll(container); if (pluginEventListeners1 != null) { pluginEventListeners1.clear(); pluginEventListeners1 = null; } if (pluginEventListeners2 != null) { executeAction(PluginAction.UNSUBSCRIBE, false); pluginEventListeners2.clear(); pluginEventListeners2 = null; } if (registeredProperties != null) { registeredProperties.clear(); registeredProperties = null; } if (registeredBeans != null) { registeredBeans.clear(); registeredBeans = null; } if (registeredComponents != null) { for (BaseComponent component : registeredComponents) { component.destroy(); } registeredComponents.clear(); registeredComponents = null; } super.destroy(); }
java
@Override public void destroy() { shell.unregisterPlugin(this); executeAction(PluginAction.UNLOAD, false); CommandUtil.dissociateAll(container); if (pluginEventListeners1 != null) { pluginEventListeners1.clear(); pluginEventListeners1 = null; } if (pluginEventListeners2 != null) { executeAction(PluginAction.UNSUBSCRIBE, false); pluginEventListeners2.clear(); pluginEventListeners2 = null; } if (registeredProperties != null) { registeredProperties.clear(); registeredProperties = null; } if (registeredBeans != null) { registeredBeans.clear(); registeredBeans = null; } if (registeredComponents != null) { for (BaseComponent component : registeredComponents) { component.destroy(); } registeredComponents.clear(); registeredComponents = null; } super.destroy(); }
[ "@", "Override", "public", "void", "destroy", "(", ")", "{", "shell", ".", "unregisterPlugin", "(", "this", ")", ";", "executeAction", "(", "PluginAction", ".", "UNLOAD", ",", "false", ")", ";", "CommandUtil", ".", "dissociateAll", "(", "container", ")", "...
Release contained resources.
[ "Release", "contained", "resources", "." ]
fa3252d4f7541dbe151b92c3d4f6f91433cd1673
https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.shell/src/main/java/org/carewebframework/shell/elements/ElementPlugin.java#L184-L221
train
carewebframework/carewebframework-core
org.carewebframework.shell/src/main/java/org/carewebframework/shell/elements/ElementPlugin.java
ElementPlugin.getPropertyValue
@Override public Object getPropertyValue(PropertyInfo propInfo) throws Exception { Object obj = registeredProperties == null ? null : registeredProperties.get(propInfo.getId()); if (obj instanceof PropertyProxy) { Object value = ((PropertyProxy) obj).getValue(); return value instanceof String ? propInfo.getPropertyType().getSerializer().deserialize((String) value) : value; } else { return obj == null ? null : propInfo.getPropertyValue(obj, obj == this); } }
java
@Override public Object getPropertyValue(PropertyInfo propInfo) throws Exception { Object obj = registeredProperties == null ? null : registeredProperties.get(propInfo.getId()); if (obj instanceof PropertyProxy) { Object value = ((PropertyProxy) obj).getValue(); return value instanceof String ? propInfo.getPropertyType().getSerializer().deserialize((String) value) : value; } else { return obj == null ? null : propInfo.getPropertyValue(obj, obj == this); } }
[ "@", "Override", "public", "Object", "getPropertyValue", "(", "PropertyInfo", "propInfo", ")", "throws", "Exception", "{", "Object", "obj", "=", "registeredProperties", "==", "null", "?", "null", ":", "registeredProperties", ".", "get", "(", "propInfo", ".", "ge...
Returns the value for a registered property. @param propInfo Property info. @return The property value. @throws Exception Unspecified exception.
[ "Returns", "the", "value", "for", "a", "registered", "property", "." ]
fa3252d4f7541dbe151b92c3d4f6f91433cd1673
https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.shell/src/main/java/org/carewebframework/shell/elements/ElementPlugin.java#L242-L252
train
carewebframework/carewebframework-core
org.carewebframework.shell/src/main/java/org/carewebframework/shell/elements/ElementPlugin.java
ElementPlugin.setPropertyValue
@Override public void setPropertyValue(PropertyInfo propInfo, Object value) throws Exception { String propId = propInfo.getId(); Object obj = registeredProperties == null ? null : registeredProperties.get(propId); if (obj == null) { obj = new PropertyProxy(propInfo, value); registerProperties(obj, propId); } else if (obj instanceof PropertyProxy) { ((PropertyProxy) obj).setValue(value); } else { propInfo.setPropertyValue(obj, value, obj == this); } }
java
@Override public void setPropertyValue(PropertyInfo propInfo, Object value) throws Exception { String propId = propInfo.getId(); Object obj = registeredProperties == null ? null : registeredProperties.get(propId); if (obj == null) { obj = new PropertyProxy(propInfo, value); registerProperties(obj, propId); } else if (obj instanceof PropertyProxy) { ((PropertyProxy) obj).setValue(value); } else { propInfo.setPropertyValue(obj, value, obj == this); } }
[ "@", "Override", "public", "void", "setPropertyValue", "(", "PropertyInfo", "propInfo", ",", "Object", "value", ")", "throws", "Exception", "{", "String", "propId", "=", "propInfo", ".", "getId", "(", ")", ";", "Object", "obj", "=", "registeredProperties", "==...
Sets a value for a registered property. @param propInfo Property info. @param value The value to set. @throws Exception Unspecified exception.
[ "Sets", "a", "value", "for", "a", "registered", "property", "." ]
fa3252d4f7541dbe151b92c3d4f6f91433cd1673
https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.shell/src/main/java/org/carewebframework/shell/elements/ElementPlugin.java#L261-L274
train
carewebframework/carewebframework-core
org.carewebframework.shell/src/main/java/org/carewebframework/shell/elements/ElementPlugin.java
ElementPlugin.updateVisibility
@Override protected void updateVisibility(boolean visible, boolean activated) { super.updateVisibility(visible, activated); if (registeredComponents != null) { for (BaseUIComponent component : registeredComponents) { if (!visible) { component.setAttribute(Constants.ATTR_VISIBLE, component.isVisible()); component.setVisible(false); } else { component.setVisible((Boolean) component.getAttribute(Constants.ATTR_VISIBLE)); } } } if (visible) { checkBusy(); } }
java
@Override protected void updateVisibility(boolean visible, boolean activated) { super.updateVisibility(visible, activated); if (registeredComponents != null) { for (BaseUIComponent component : registeredComponents) { if (!visible) { component.setAttribute(Constants.ATTR_VISIBLE, component.isVisible()); component.setVisible(false); } else { component.setVisible((Boolean) component.getAttribute(Constants.ATTR_VISIBLE)); } } } if (visible) { checkBusy(); } }
[ "@", "Override", "protected", "void", "updateVisibility", "(", "boolean", "visible", ",", "boolean", "activated", ")", "{", "super", ".", "updateVisibility", "(", "visible", ",", "activated", ")", ";", "if", "(", "registeredComponents", "!=", "null", ")", "{",...
Sets the visibility of the contained resource and any registered components. @param visible Visibility state to set
[ "Sets", "the", "visibility", "of", "the", "contained", "resource", "and", "any", "registered", "components", "." ]
fa3252d4f7541dbe151b92c3d4f6f91433cd1673
https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.shell/src/main/java/org/carewebframework/shell/elements/ElementPlugin.java#L292-L311
train
carewebframework/carewebframework-core
org.carewebframework.shell/src/main/java/org/carewebframework/shell/elements/ElementPlugin.java
ElementPlugin.setDefinition
@Override public void setDefinition(PluginDefinition definition) { super.setDefinition(definition); if (definition != null) { container.addClass("cwf-plugin-" + definition.getId()); shell.registerPlugin(this); } }
java
@Override public void setDefinition(PluginDefinition definition) { super.setDefinition(definition); if (definition != null) { container.addClass("cwf-plugin-" + definition.getId()); shell.registerPlugin(this); } }
[ "@", "Override", "public", "void", "setDefinition", "(", "PluginDefinition", "definition", ")", "{", "super", ".", "setDefinition", "(", "definition", ")", ";", "if", "(", "definition", "!=", "null", ")", "{", "container", ".", "addClass", "(", "\"cwf-plugin-\...
Sets the plugin definition the container will use to instantiate the plugin. If there is a status bean associated with the plugin, it is registered with the container at this time. If there are style sheet resources associated with the plugin, they will be added to the container at this time. @param definition The plugin definition.
[ "Sets", "the", "plugin", "definition", "the", "container", "will", "use", "to", "instantiate", "the", "plugin", ".", "If", "there", "is", "a", "status", "bean", "associated", "with", "the", "plugin", "it", "is", "registered", "with", "the", "container", "at"...
fa3252d4f7541dbe151b92c3d4f6f91433cd1673
https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.shell/src/main/java/org/carewebframework/shell/elements/ElementPlugin.java#L321-L329
train
carewebframework/carewebframework-core
org.carewebframework.shell/src/main/java/org/carewebframework/shell/elements/ElementPlugin.java
ElementPlugin.setBusy
public void setBusy(String message) { busyMessage = message = StrUtil.formatMessage(message); if (busyDisabled) { busyPending = true; } else if (message != null) { disableActions(true); ClientUtil.busy(container, message); busyPending = !isVisible(); } else { disableActions(false); ClientUtil.busy(container, null); busyPending = false; } }
java
public void setBusy(String message) { busyMessage = message = StrUtil.formatMessage(message); if (busyDisabled) { busyPending = true; } else if (message != null) { disableActions(true); ClientUtil.busy(container, message); busyPending = !isVisible(); } else { disableActions(false); ClientUtil.busy(container, null); busyPending = false; } }
[ "public", "void", "setBusy", "(", "String", "message", ")", "{", "busyMessage", "=", "message", "=", "StrUtil", ".", "formatMessage", "(", "message", ")", ";", "if", "(", "busyDisabled", ")", "{", "busyPending", "=", "true", ";", "}", "else", "if", "(", ...
If message is not null, disables the plugin and displays the busy message. If message is null, removes any previous message and returns the plugin to its previous state. @param message The message to display, or null to clear previous message.
[ "If", "message", "is", "not", "null", "disables", "the", "plugin", "and", "displays", "the", "busy", "message", ".", "If", "message", "is", "null", "removes", "any", "previous", "message", "and", "returns", "the", "plugin", "to", "its", "previous", "state", ...
fa3252d4f7541dbe151b92c3d4f6f91433cd1673
https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.shell/src/main/java/org/carewebframework/shell/elements/ElementPlugin.java#L388-L402
train
carewebframework/carewebframework-core
org.carewebframework.shell/src/main/java/org/carewebframework/shell/elements/ElementPlugin.java
ElementPlugin.executeAction
private void executeAction(PluginAction action, boolean async, Object data) { if (hasListeners() || action == PluginAction.LOAD) { PluginEvent event = new PluginEvent(this, action, data); if (async) { EventUtil.post(event); } else { onAction(event); } } }
java
private void executeAction(PluginAction action, boolean async, Object data) { if (hasListeners() || action == PluginAction.LOAD) { PluginEvent event = new PluginEvent(this, action, data); if (async) { EventUtil.post(event); } else { onAction(event); } } }
[ "private", "void", "executeAction", "(", "PluginAction", "action", ",", "boolean", "async", ",", "Object", "data", ")", "{", "if", "(", "hasListeners", "(", ")", "||", "action", "==", "PluginAction", ".", "LOAD", ")", "{", "PluginEvent", "event", "=", "new...
Notify all plugin callbacks of the specified action. @param action Action to perform. @param data Event-dependent data (may be null). @param async If true, callbacks are done asynchronously.
[ "Notify", "all", "plugin", "callbacks", "of", "the", "specified", "action", "." ]
fa3252d4f7541dbe151b92c3d4f6f91433cd1673
https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.shell/src/main/java/org/carewebframework/shell/elements/ElementPlugin.java#L430-L440
train
carewebframework/carewebframework-core
org.carewebframework.shell/src/main/java/org/carewebframework/shell/elements/ElementPlugin.java
ElementPlugin.onAction
@EventHandler("action") private void onAction(PluginEvent event) { PluginException exception = null; PluginAction action = event.getAction(); boolean debug = log.isDebugEnabled(); if (pluginEventListeners1 != null) { for (IPluginEvent listener : new ArrayList<>(pluginEventListeners1)) { try { if (debug) { log.debug("Invoking IPluginEvent.on" + WordUtils.capitalizeFully(action.name()) + " for listener " + listener); } switch (action) { case LOAD: listener.onLoad(this); continue; case UNLOAD: listener.onUnload(); continue; case ACTIVATE: listener.onActivate(); continue; case INACTIVATE: listener.onInactivate(); continue; } } catch (Throwable e) { exception = createChainedException(action.name(), e, exception); } } } if (pluginEventListeners2 != null) { for (IPluginEventListener listener : new ArrayList<>(pluginEventListeners2)) { try { if (debug) { log.debug("Delivering " + action.name() + " event to IPluginEventListener listener " + listener); } listener.onPluginEvent(event); } catch (Throwable e) { exception = createChainedException(action.name(), e, exception); } } } if (action == PluginAction.LOAD) { doAfterLoad(); } if (exception != null) { throw exception; } }
java
@EventHandler("action") private void onAction(PluginEvent event) { PluginException exception = null; PluginAction action = event.getAction(); boolean debug = log.isDebugEnabled(); if (pluginEventListeners1 != null) { for (IPluginEvent listener : new ArrayList<>(pluginEventListeners1)) { try { if (debug) { log.debug("Invoking IPluginEvent.on" + WordUtils.capitalizeFully(action.name()) + " for listener " + listener); } switch (action) { case LOAD: listener.onLoad(this); continue; case UNLOAD: listener.onUnload(); continue; case ACTIVATE: listener.onActivate(); continue; case INACTIVATE: listener.onInactivate(); continue; } } catch (Throwable e) { exception = createChainedException(action.name(), e, exception); } } } if (pluginEventListeners2 != null) { for (IPluginEventListener listener : new ArrayList<>(pluginEventListeners2)) { try { if (debug) { log.debug("Delivering " + action.name() + " event to IPluginEventListener listener " + listener); } listener.onPluginEvent(event); } catch (Throwable e) { exception = createChainedException(action.name(), e, exception); } } } if (action == PluginAction.LOAD) { doAfterLoad(); } if (exception != null) { throw exception; } }
[ "@", "EventHandler", "(", "\"action\"", ")", "private", "void", "onAction", "(", "PluginEvent", "event", ")", "{", "PluginException", "exception", "=", "null", ";", "PluginAction", "action", "=", "event", ".", "getAction", "(", ")", ";", "boolean", "debug", ...
Notify listeners of plugin events. @param event The plugin event containing the action.
[ "Notify", "listeners", "of", "plugin", "events", "." ]
fa3252d4f7541dbe151b92c3d4f6f91433cd1673
https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.shell/src/main/java/org/carewebframework/shell/elements/ElementPlugin.java#L447-L504
train
carewebframework/carewebframework-core
org.carewebframework.shell/src/main/java/org/carewebframework/shell/elements/ElementPlugin.java
ElementPlugin.onCommand
@EventHandler("command") private void onCommand(CommandEvent event) { if (isEnabled()) { for (BaseComponent child : container.getChildren()) { EventUtil.send(event, child); if (event.isStopped()) { break; } } } }
java
@EventHandler("command") private void onCommand(CommandEvent event) { if (isEnabled()) { for (BaseComponent child : container.getChildren()) { EventUtil.send(event, child); if (event.isStopped()) { break; } } } }
[ "@", "EventHandler", "(", "\"command\"", ")", "private", "void", "onCommand", "(", "CommandEvent", "event", ")", "{", "if", "(", "isEnabled", "(", ")", ")", "{", "for", "(", "BaseComponent", "child", ":", "container", ".", "getChildren", "(", ")", ")", "...
Forward command events to first level children of the container. @param event The command event.
[ "Forward", "command", "events", "to", "first", "level", "children", "of", "the", "container", "." ]
fa3252d4f7541dbe151b92c3d4f6f91433cd1673
https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.shell/src/main/java/org/carewebframework/shell/elements/ElementPlugin.java#L518-L529
train
carewebframework/carewebframework-core
org.carewebframework.shell/src/main/java/org/carewebframework/shell/elements/ElementPlugin.java
ElementPlugin.createChainedException
private PluginException createChainedException(String action, Throwable newException, PluginException previousException) { String msg = action + " event generated an error."; log.error(msg, newException); PluginException wrapper = new PluginException(msg, previousException == null ? newException : previousException, null); wrapper.setStackTrace(newException.getStackTrace()); return wrapper; }
java
private PluginException createChainedException(String action, Throwable newException, PluginException previousException) { String msg = action + " event generated an error."; log.error(msg, newException); PluginException wrapper = new PluginException(msg, previousException == null ? newException : previousException, null); wrapper.setStackTrace(newException.getStackTrace()); return wrapper; }
[ "private", "PluginException", "createChainedException", "(", "String", "action", ",", "Throwable", "newException", ",", "PluginException", "previousException", ")", "{", "String", "msg", "=", "action", "+", "\" event generated an error.\"", ";", "log", ".", "error", "...
Creates a chained exception. @param action Action being performed at the time of the exception. @param newException Exception just thrown. @param previousException Previous exception (may be null). @return Top level exception in chain.
[ "Creates", "a", "chained", "exception", "." ]
fa3252d4f7541dbe151b92c3d4f6f91433cd1673
https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.shell/src/main/java/org/carewebframework/shell/elements/ElementPlugin.java#L539-L547
train
carewebframework/carewebframework-core
org.carewebframework.shell/src/main/java/org/carewebframework/shell/elements/ElementPlugin.java
ElementPlugin.load
public void load() { PluginDefinition definition = getDefinition(); if (!initialized && definition != null) { BaseComponent top; try { initialized = true; top = container.getFirstChild(); if (top == null) { top = PageUtil.createPage(definition.getUrl(), container).get(0); } } catch (Throwable e) { container.destroyChildren(); throw createChainedException("Initialize", e, null); } if (pluginControllers != null) { for (Object controller : pluginControllers) { top.wireController(controller); } } findListeners(container); executeAction(PluginAction.LOAD, true); } }
java
public void load() { PluginDefinition definition = getDefinition(); if (!initialized && definition != null) { BaseComponent top; try { initialized = true; top = container.getFirstChild(); if (top == null) { top = PageUtil.createPage(definition.getUrl(), container).get(0); } } catch (Throwable e) { container.destroyChildren(); throw createChainedException("Initialize", e, null); } if (pluginControllers != null) { for (Object controller : pluginControllers) { top.wireController(controller); } } findListeners(container); executeAction(PluginAction.LOAD, true); } }
[ "public", "void", "load", "(", ")", "{", "PluginDefinition", "definition", "=", "getDefinition", "(", ")", ";", "if", "(", "!", "initialized", "&&", "definition", "!=", "null", ")", "{", "BaseComponent", "top", ";", "try", "{", "initialized", "=", "true", ...
Initializes a plugin, if not already done. This loads the plugin's principal cwf page, attaches any event listeners, and sends a load event to subscribers.
[ "Initializes", "a", "plugin", "if", "not", "already", "done", ".", "This", "loads", "the", "plugin", "s", "principal", "cwf", "page", "attaches", "any", "event", "listeners", "and", "sends", "a", "load", "event", "to", "subscribers", "." ]
fa3252d4f7541dbe151b92c3d4f6f91433cd1673
https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.shell/src/main/java/org/carewebframework/shell/elements/ElementPlugin.java#L553-L580
train
carewebframework/carewebframework-core
org.carewebframework.shell/src/main/java/org/carewebframework/shell/elements/ElementPlugin.java
ElementPlugin.addToolbarComponent
public void addToolbarComponent(BaseComponent component) { if (tbarContainer == null) { tbarContainer = new ToolbarContainer(); shell.addToolbarComponent(tbarContainer); registerComponent(tbarContainer); } tbarContainer.addChild(component); }
java
public void addToolbarComponent(BaseComponent component) { if (tbarContainer == null) { tbarContainer = new ToolbarContainer(); shell.addToolbarComponent(tbarContainer); registerComponent(tbarContainer); } tbarContainer.addChild(component); }
[ "public", "void", "addToolbarComponent", "(", "BaseComponent", "component", ")", "{", "if", "(", "tbarContainer", "==", "null", ")", "{", "tbarContainer", "=", "new", "ToolbarContainer", "(", ")", ";", "shell", ".", "addToolbarComponent", "(", "tbarContainer", "...
Adds the specified component to the toolbar container. The component is registered to this container and will visible only when the container is active. @param component BaseComponent to add.
[ "Adds", "the", "specified", "component", "to", "the", "toolbar", "container", ".", "The", "component", "is", "registered", "to", "this", "container", "and", "will", "visible", "only", "when", "the", "container", "is", "active", "." ]
fa3252d4f7541dbe151b92c3d4f6f91433cd1673
https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.shell/src/main/java/org/carewebframework/shell/elements/ElementPlugin.java#L602-L610
train
carewebframework/carewebframework-core
org.carewebframework.shell/src/main/java/org/carewebframework/shell/elements/ElementPlugin.java
ElementPlugin.registerId
public void registerId(String id, BaseComponent component) { if (!StringUtils.isEmpty(id) && !container.hasAttribute(id)) { container.setAttribute(id, component); } }
java
public void registerId(String id, BaseComponent component) { if (!StringUtils.isEmpty(id) && !container.hasAttribute(id)) { container.setAttribute(id, component); } }
[ "public", "void", "registerId", "(", "String", "id", ",", "BaseComponent", "component", ")", "{", "if", "(", "!", "StringUtils", ".", "isEmpty", "(", "id", ")", "&&", "!", "container", ".", "hasAttribute", "(", "id", ")", ")", "{", "container", ".", "s...
Allows auto-wire to work even if component is not a child of the container. @param id BaseComponent id. @param component BaseComponent to be registered.
[ "Allows", "auto", "-", "wire", "to", "work", "even", "if", "component", "is", "not", "a", "child", "of", "the", "container", "." ]
fa3252d4f7541dbe151b92c3d4f6f91433cd1673
https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.shell/src/main/java/org/carewebframework/shell/elements/ElementPlugin.java#L635-L639
train
carewebframework/carewebframework-core
org.carewebframework.shell/src/main/java/org/carewebframework/shell/elements/ElementPlugin.java
ElementPlugin.registerListener
public void registerListener(IPluginEvent listener) { if (pluginEventListeners1 == null) { pluginEventListeners1 = new ArrayList<>(); } if (!pluginEventListeners1.contains(listener)) { pluginEventListeners1.add(listener); } }
java
public void registerListener(IPluginEvent listener) { if (pluginEventListeners1 == null) { pluginEventListeners1 = new ArrayList<>(); } if (!pluginEventListeners1.contains(listener)) { pluginEventListeners1.add(listener); } }
[ "public", "void", "registerListener", "(", "IPluginEvent", "listener", ")", "{", "if", "(", "pluginEventListeners1", "==", "null", ")", "{", "pluginEventListeners1", "=", "new", "ArrayList", "<>", "(", ")", ";", "}", "if", "(", "!", "pluginEventListeners1", "....
Registers a listener for the IPluginEvent callback event. If the listener has already been registered, the request is ignored. @param listener Listener to be registered.
[ "Registers", "a", "listener", "for", "the", "IPluginEvent", "callback", "event", ".", "If", "the", "listener", "has", "already", "been", "registered", "the", "request", "is", "ignored", "." ]
fa3252d4f7541dbe151b92c3d4f6f91433cd1673
https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.shell/src/main/java/org/carewebframework/shell/elements/ElementPlugin.java#L647-L655
train
carewebframework/carewebframework-core
org.carewebframework.shell/src/main/java/org/carewebframework/shell/elements/ElementPlugin.java
ElementPlugin.registerListener
public void registerListener(IPluginEventListener listener) { if (pluginEventListeners2 == null) { pluginEventListeners2 = new ArrayList<>(); } if (!pluginEventListeners2.contains(listener)) { pluginEventListeners2.add(listener); listener.onPluginEvent(new PluginEvent(this, PluginAction.SUBSCRIBE)); } }
java
public void registerListener(IPluginEventListener listener) { if (pluginEventListeners2 == null) { pluginEventListeners2 = new ArrayList<>(); } if (!pluginEventListeners2.contains(listener)) { pluginEventListeners2.add(listener); listener.onPluginEvent(new PluginEvent(this, PluginAction.SUBSCRIBE)); } }
[ "public", "void", "registerListener", "(", "IPluginEventListener", "listener", ")", "{", "if", "(", "pluginEventListeners2", "==", "null", ")", "{", "pluginEventListeners2", "=", "new", "ArrayList", "<>", "(", ")", ";", "}", "if", "(", "!", "pluginEventListeners...
Registers a listener for the IPluginEventListener callback event. If the listener has already been registered, the request is ignored. @param listener Listener to be registered.
[ "Registers", "a", "listener", "for", "the", "IPluginEventListener", "callback", "event", ".", "If", "the", "listener", "has", "already", "been", "registered", "the", "request", "is", "ignored", "." ]
fa3252d4f7541dbe151b92c3d4f6f91433cd1673
https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.shell/src/main/java/org/carewebframework/shell/elements/ElementPlugin.java#L663-L672
train
carewebframework/carewebframework-core
org.carewebframework.shell/src/main/java/org/carewebframework/shell/elements/ElementPlugin.java
ElementPlugin.unregisterListener
public void unregisterListener(IPluginEventListener listener) { if (pluginEventListeners2 != null && pluginEventListeners2.contains(listener)) { pluginEventListeners2.remove(listener); listener.onPluginEvent(new PluginEvent(this, PluginAction.UNSUBSCRIBE)); } }
java
public void unregisterListener(IPluginEventListener listener) { if (pluginEventListeners2 != null && pluginEventListeners2.contains(listener)) { pluginEventListeners2.remove(listener); listener.onPluginEvent(new PluginEvent(this, PluginAction.UNSUBSCRIBE)); } }
[ "public", "void", "unregisterListener", "(", "IPluginEventListener", "listener", ")", "{", "if", "(", "pluginEventListeners2", "!=", "null", "&&", "pluginEventListeners2", ".", "contains", "(", "listener", ")", ")", "{", "pluginEventListeners2", ".", "remove", "(", ...
Unregisters a listener for the IPluginEvent callback event. @param listener Listener to be unregistered.
[ "Unregisters", "a", "listener", "for", "the", "IPluginEvent", "callback", "event", "." ]
fa3252d4f7541dbe151b92c3d4f6f91433cd1673
https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.shell/src/main/java/org/carewebframework/shell/elements/ElementPlugin.java#L690-L695
train
carewebframework/carewebframework-core
org.carewebframework.shell/src/main/java/org/carewebframework/shell/elements/ElementPlugin.java
ElementPlugin.tryRegisterListener
public boolean tryRegisterListener(Object object, boolean register) { boolean success = false; if (object instanceof IPluginEvent) { if (register) { registerListener((IPluginEvent) object); } else { unregisterListener((IPluginEvent) object); } success = true; } if (object instanceof IPluginEventListener) { if (register) { registerListener((IPluginEventListener) object); } else { unregisterListener((IPluginEventListener) object); } success = true; } return success; }
java
public boolean tryRegisterListener(Object object, boolean register) { boolean success = false; if (object instanceof IPluginEvent) { if (register) { registerListener((IPluginEvent) object); } else { unregisterListener((IPluginEvent) object); } success = true; } if (object instanceof IPluginEventListener) { if (register) { registerListener((IPluginEventListener) object); } else { unregisterListener((IPluginEventListener) object); } success = true; } return success; }
[ "public", "boolean", "tryRegisterListener", "(", "Object", "object", ",", "boolean", "register", ")", "{", "boolean", "success", "=", "false", ";", "if", "(", "object", "instanceof", "IPluginEvent", ")", "{", "if", "(", "register", ")", "{", "registerListener"...
Attempts to register or unregister an object as an event listener. @param object Object to register/unregister. @param register If true, we are attempting to register. If false, unregister. @return True if operation was successful. False if the object supports none of the recognized event listeners.
[ "Attempts", "to", "register", "or", "unregister", "an", "object", "as", "an", "event", "listener", "." ]
fa3252d4f7541dbe151b92c3d4f6f91433cd1673
https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.shell/src/main/java/org/carewebframework/shell/elements/ElementPlugin.java#L705-L727
train
carewebframework/carewebframework-core
org.carewebframework.shell/src/main/java/org/carewebframework/shell/elements/ElementPlugin.java
ElementPlugin.tryRegisterController
public void tryRegisterController(Object object) { if (object instanceof IPluginController) { if (pluginControllers == null) { pluginControllers = new ArrayList<>(); } pluginControllers.add((IPluginController) object); } }
java
public void tryRegisterController(Object object) { if (object instanceof IPluginController) { if (pluginControllers == null) { pluginControllers = new ArrayList<>(); } pluginControllers.add((IPluginController) object); } }
[ "public", "void", "tryRegisterController", "(", "Object", "object", ")", "{", "if", "(", "object", "instanceof", "IPluginController", ")", "{", "if", "(", "pluginControllers", "==", "null", ")", "{", "pluginControllers", "=", "new", "ArrayList", "<>", "(", ")"...
Registers an object as a controller if it implements the IPluginController interface. @param object Object to register.
[ "Registers", "an", "object", "as", "a", "controller", "if", "it", "implements", "the", "IPluginController", "interface", "." ]
fa3252d4f7541dbe151b92c3d4f6f91433cd1673
https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.shell/src/main/java/org/carewebframework/shell/elements/ElementPlugin.java#L734-L742
train
carewebframework/carewebframework-core
org.carewebframework.shell/src/main/java/org/carewebframework/shell/elements/ElementPlugin.java
ElementPlugin.registerProperties
public void registerProperties(Object instance, String... propertyNames) { for (String propertyName : propertyNames) { registerProperty(instance, propertyName, true); } }
java
public void registerProperties(Object instance, String... propertyNames) { for (String propertyName : propertyNames) { registerProperty(instance, propertyName, true); } }
[ "public", "void", "registerProperties", "(", "Object", "instance", ",", "String", "...", "propertyNames", ")", "{", "for", "(", "String", "propertyName", ":", "propertyNames", ")", "{", "registerProperty", "(", "instance", ",", "propertyName", ",", "true", ")", ...
Registers one or more named properties to the container. Using this, a plugin can expose properties for serialization and deserialization. @param instance The object instance holding the property accessors. If null, any existing registration will be removed. @param propertyNames One or more property names to register.
[ "Registers", "one", "or", "more", "named", "properties", "to", "the", "container", ".", "Using", "this", "a", "plugin", "can", "expose", "properties", "for", "serialization", "and", "deserialization", "." ]
fa3252d4f7541dbe151b92c3d4f6f91433cd1673
https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.shell/src/main/java/org/carewebframework/shell/elements/ElementPlugin.java#L752-L756
train
carewebframework/carewebframework-core
org.carewebframework.shell/src/main/java/org/carewebframework/shell/elements/ElementPlugin.java
ElementPlugin.registerProperty
public void registerProperty(Object instance, String propertyName, boolean override) { if (registeredProperties == null) { registeredProperties = new HashMap<>(); } if (instance == null) { registeredProperties.remove(propertyName); } else { Object oldInstance = registeredProperties.get(propertyName); PropertyProxy proxy = oldInstance instanceof PropertyProxy ? (PropertyProxy) oldInstance : null; if (!override && oldInstance != null && proxy == null) { return; } registeredProperties.put(propertyName, instance); // If previous registrant was a property proxy, transfer its value to new registrant. if (proxy != null) { try { proxy.getPropertyInfo().setPropertyValue(instance, proxy.getValue()); } catch (Exception e) { throw createChainedException("Register Property", e, null); } } } }
java
public void registerProperty(Object instance, String propertyName, boolean override) { if (registeredProperties == null) { registeredProperties = new HashMap<>(); } if (instance == null) { registeredProperties.remove(propertyName); } else { Object oldInstance = registeredProperties.get(propertyName); PropertyProxy proxy = oldInstance instanceof PropertyProxy ? (PropertyProxy) oldInstance : null; if (!override && oldInstance != null && proxy == null) { return; } registeredProperties.put(propertyName, instance); // If previous registrant was a property proxy, transfer its value to new registrant. if (proxy != null) { try { proxy.getPropertyInfo().setPropertyValue(instance, proxy.getValue()); } catch (Exception e) { throw createChainedException("Register Property", e, null); } } } }
[ "public", "void", "registerProperty", "(", "Object", "instance", ",", "String", "propertyName", ",", "boolean", "override", ")", "{", "if", "(", "registeredProperties", "==", "null", ")", "{", "registeredProperties", "=", "new", "HashMap", "<>", "(", ")", ";",...
Registers a named property to the container. Using this, a plugin can expose a property for serialization and deserialization. @param instance The object instance holding the property accessors. If null, any existing registration will be removed. @param propertyName Name of property to register. @param override If the property is already registered to a non-proxy, the previous registration will be replaced if this is true; otherwise the request is ignored.
[ "Registers", "a", "named", "property", "to", "the", "container", ".", "Using", "this", "a", "plugin", "can", "expose", "a", "property", "for", "serialization", "and", "deserialization", "." ]
fa3252d4f7541dbe151b92c3d4f6f91433cd1673
https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.shell/src/main/java/org/carewebframework/shell/elements/ElementPlugin.java#L768-L794
train
carewebframework/carewebframework-core
org.carewebframework.shell/src/main/java/org/carewebframework/shell/elements/ElementPlugin.java
ElementPlugin.registerBean
public void registerBean(String beanId, boolean isRequired) { if (beanId == null || beanId.isEmpty()) { return; } Object bean = SpringUtil.getBean(beanId); if (bean == null && isRequired) { throw new PluginException("Required bean resouce not found: " + beanId); } Object oldBean = getAssociatedBean(beanId); if (bean == oldBean) { return; } if (registeredBeans == null) { registeredBeans = new HashMap<>(); } tryRegisterListener(oldBean, false); if (bean == null) { registeredBeans.remove(beanId); } else { registeredBeans.put(beanId, bean); tryRegisterListener(bean, true); tryRegisterController(bean); } }
java
public void registerBean(String beanId, boolean isRequired) { if (beanId == null || beanId.isEmpty()) { return; } Object bean = SpringUtil.getBean(beanId); if (bean == null && isRequired) { throw new PluginException("Required bean resouce not found: " + beanId); } Object oldBean = getAssociatedBean(beanId); if (bean == oldBean) { return; } if (registeredBeans == null) { registeredBeans = new HashMap<>(); } tryRegisterListener(oldBean, false); if (bean == null) { registeredBeans.remove(beanId); } else { registeredBeans.put(beanId, bean); tryRegisterListener(bean, true); tryRegisterController(bean); } }
[ "public", "void", "registerBean", "(", "String", "beanId", ",", "boolean", "isRequired", ")", "{", "if", "(", "beanId", "==", "null", "||", "beanId", ".", "isEmpty", "(", ")", ")", "{", "return", ";", "}", "Object", "bean", "=", "SpringUtil", ".", "get...
Registers a helper bean with this container. @param beanId The bean's id. @param isRequired If true and the bean is not found, an exception is raised.
[ "Registers", "a", "helper", "bean", "with", "this", "container", "." ]
fa3252d4f7541dbe151b92c3d4f6f91433cd1673
https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.shell/src/main/java/org/carewebframework/shell/elements/ElementPlugin.java#L802-L832
train
carewebframework/carewebframework-core
org.carewebframework.shell/src/main/java/org/carewebframework/shell/elements/ElementProxy.java
ElementProxy.setPropertyValue
@Override public void setPropertyValue(PropertyInfo propInfo, Object value) { setPropertyValue(propInfo.getId(), value); }
java
@Override public void setPropertyValue(PropertyInfo propInfo, Object value) { setPropertyValue(propInfo.getId(), value); }
[ "@", "Override", "public", "void", "setPropertyValue", "(", "PropertyInfo", "propInfo", ",", "Object", "value", ")", "{", "setPropertyValue", "(", "propInfo", ".", "getId", "(", ")", ",", "value", ")", ";", "}" ]
Overridden to set property value in proxy's property cache. @see org.carewebframework.shell.property.IPropertyAccessor#setPropertyValue
[ "Overridden", "to", "set", "property", "value", "in", "proxy", "s", "property", "cache", "." ]
fa3252d4f7541dbe151b92c3d4f6f91433cd1673
https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.shell/src/main/java/org/carewebframework/shell/elements/ElementProxy.java#L83-L86
train
carewebframework/carewebframework-core
org.carewebframework.shell/src/main/java/org/carewebframework/shell/elements/ElementProxy.java
ElementProxy.realize
public ElementBase realize(ElementBase parent) { if (!deleted && real == null) { real = getDefinition().createElement(parent, null, false); } else if (deleted && real != null) { real.remove(true); real = null; } return real; }
java
public ElementBase realize(ElementBase parent) { if (!deleted && real == null) { real = getDefinition().createElement(parent, null, false); } else if (deleted && real != null) { real.remove(true); real = null; } return real; }
[ "public", "ElementBase", "realize", "(", "ElementBase", "parent", ")", "{", "if", "(", "!", "deleted", "&&", "real", "==", "null", ")", "{", "real", "=", "getDefinition", "(", ")", ".", "createElement", "(", "parent", ",", "null", ",", "false", ")", ";...
Realizes the creation or destruction of the proxied object. In other words, if this is a deletion operation and the proxied object exists, the proxied object is removed from its parent. If this is not a deletion and the proxied object does not exist, a new object is instantiated as a child to the specified parent. @param parent The parent UI element. @return Returns the updated proxied object.
[ "Realizes", "the", "creation", "or", "destruction", "of", "the", "proxied", "object", ".", "In", "other", "words", "if", "this", "is", "a", "deletion", "operation", "and", "the", "proxied", "object", "exists", "the", "proxied", "object", "is", "removed", "fr...
fa3252d4f7541dbe151b92c3d4f6f91433cd1673
https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.shell/src/main/java/org/carewebframework/shell/elements/ElementProxy.java#L114-L123
train
carewebframework/carewebframework-core
org.carewebframework.shell/src/main/java/org/carewebframework/shell/elements/ElementProxy.java
ElementProxy.syncProperties
private void syncProperties(boolean fromReal) { PluginDefinition def = getDefinition(); for (PropertyInfo propInfo : def.getProperties()) { if (fromReal) { syncProperty(propInfo, real, this); } else { syncProperty(propInfo, this, real); } } }
java
private void syncProperties(boolean fromReal) { PluginDefinition def = getDefinition(); for (PropertyInfo propInfo : def.getProperties()) { if (fromReal) { syncProperty(propInfo, real, this); } else { syncProperty(propInfo, this, real); } } }
[ "private", "void", "syncProperties", "(", "boolean", "fromReal", ")", "{", "PluginDefinition", "def", "=", "getDefinition", "(", ")", ";", "for", "(", "PropertyInfo", "propInfo", ":", "def", ".", "getProperties", "(", ")", ")", "{", "if", "(", "fromReal", ...
Synchronizes property values between the proxy and its object. @param fromReal If true, property values are copied from the target to the proxy. If false, property values are copied from the proxy to the target.
[ "Synchronizes", "property", "values", "between", "the", "proxy", "and", "its", "object", "." ]
fa3252d4f7541dbe151b92c3d4f6f91433cd1673
https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.shell/src/main/java/org/carewebframework/shell/elements/ElementProxy.java#L131-L141
train
strator-dev/greenpepper
greenpepper-open/confluence/greenpepper-confluence-code/src/main/java/com/greenpepper/confluence/macros/GreenPepperWiki.java
GreenPepperWiki.execute
@Override public String execute(@SuppressWarnings("rawtypes") Map parameters, String body, RenderContext renderContext) throws MacroException { try { return body; } catch (Exception e) { return getErrorView("greenpepper.info.macroid", e.getMessage()); } }
java
@Override public String execute(@SuppressWarnings("rawtypes") Map parameters, String body, RenderContext renderContext) throws MacroException { try { return body; } catch (Exception e) { return getErrorView("greenpepper.info.macroid", e.getMessage()); } }
[ "@", "Override", "public", "String", "execute", "(", "@", "SuppressWarnings", "(", "\"rawtypes\"", ")", "Map", "parameters", ",", "String", "body", ",", "RenderContext", "renderContext", ")", "throws", "MacroException", "{", "try", "{", "return", "body", ";", ...
Confluence 2 and 3 @param parameters @param body @param renderContext @return @throws MacroException
[ "Confluence", "2", "and", "3" ]
2a61e6c179b74085babcc559d677490b0cad2d30
https://github.com/strator-dev/greenpepper/blob/2a61e6c179b74085babcc559d677490b0cad2d30/greenpepper-open/confluence/greenpepper-confluence-code/src/main/java/com/greenpepper/confluence/macros/GreenPepperWiki.java#L59-L70
train
strator-dev/greenpepper
greenpepper-open/confluence/greenpepper-confluence-code/src/main/java/com/greenpepper/confluence/macros/GreenPepperWiki.java
GreenPepperWiki.execute
@Override public String execute(Map<String, String> parameters, String body, ConversionContext context) throws MacroExecutionException { try { String xhtmlRendered = gpUtil.getWikiStyleRenderer().convertWikiToXHtml(context.getPageContext(), body); LOGGER.trace("rendering : \n - source \n {} \n - output \n {}", body, xhtmlRendered); return xhtmlRendered; } catch (Exception e) { return getErrorView("greenpepper.info.macroid", e.getMessage()); } }
java
@Override public String execute(Map<String, String> parameters, String body, ConversionContext context) throws MacroExecutionException { try { String xhtmlRendered = gpUtil.getWikiStyleRenderer().convertWikiToXHtml(context.getPageContext(), body); LOGGER.trace("rendering : \n - source \n {} \n - output \n {}", body, xhtmlRendered); return xhtmlRendered; } catch (Exception e) { return getErrorView("greenpepper.info.macroid", e.getMessage()); } }
[ "@", "Override", "public", "String", "execute", "(", "Map", "<", "String", ",", "String", ">", "parameters", ",", "String", "body", ",", "ConversionContext", "context", ")", "throws", "MacroExecutionException", "{", "try", "{", "String", "xhtmlRendered", "=", ...
Confluence 4+ @param parameters @param body @param context @return @throws MacroExecutionException
[ "Confluence", "4", "+" ]
2a61e6c179b74085babcc559d677490b0cad2d30
https://github.com/strator-dev/greenpepper/blob/2a61e6c179b74085babcc559d677490b0cad2d30/greenpepper-open/confluence/greenpepper-confluence-code/src/main/java/com/greenpepper/confluence/macros/GreenPepperWiki.java#L80-L93
train
DDTH/ddth-queue
ddth-queue-core/src/main/java/com/github/ddth/queue/impl/RocksDbQueue.java
RocksDbQueue.saveLastFetchedId
private void saveLastFetchedId(byte[] lastFetchedId) { if (lastFetchedId != null) { rocksDbWrapper.put(cfNameMetadata, writeOptions, keyLastFetchedId, lastFetchedId); } }
java
private void saveLastFetchedId(byte[] lastFetchedId) { if (lastFetchedId != null) { rocksDbWrapper.put(cfNameMetadata, writeOptions, keyLastFetchedId, lastFetchedId); } }
[ "private", "void", "saveLastFetchedId", "(", "byte", "[", "]", "lastFetchedId", ")", "{", "if", "(", "lastFetchedId", "!=", "null", ")", "{", "rocksDbWrapper", ".", "put", "(", "cfNameMetadata", ",", "writeOptions", ",", "keyLastFetchedId", ",", "lastFetchedId",...
Saves last-fetched-id. @param lastFetchedId @since 0.4.0.1
[ "Saves", "last", "-", "fetched", "-", "id", "." ]
b20776850d23111d3d71fc8ed6023c590bc3621f
https://github.com/DDTH/ddth-queue/blob/b20776850d23111d3d71fc8ed6023c590bc3621f/ddth-queue-core/src/main/java/com/github/ddth/queue/impl/RocksDbQueue.java#L245-L249
train
carewebframework/carewebframework-core
org.carewebframework.help-parent/org.carewebframework.help.core/src/main/java/org/carewebframework/help/viewer/HelpViewBase.java
HelpViewBase.createView
public static HelpViewBase createView(HelpViewer viewer, HelpViewType viewType) { Class<? extends HelpViewBase> viewClass = viewType == null ? null : getViewClass(viewType); if (viewClass == null) { return null; } try { return viewClass.getConstructor(HelpViewer.class, HelpViewType.class).newInstance(viewer, viewType); } catch (Exception e) { throw MiscUtil.toUnchecked(e); } }
java
public static HelpViewBase createView(HelpViewer viewer, HelpViewType viewType) { Class<? extends HelpViewBase> viewClass = viewType == null ? null : getViewClass(viewType); if (viewClass == null) { return null; } try { return viewClass.getConstructor(HelpViewer.class, HelpViewType.class).newInstance(viewer, viewType); } catch (Exception e) { throw MiscUtil.toUnchecked(e); } }
[ "public", "static", "HelpViewBase", "createView", "(", "HelpViewer", "viewer", ",", "HelpViewType", "viewType", ")", "{", "Class", "<", "?", "extends", "HelpViewBase", ">", "viewClass", "=", "viewType", "==", "null", "?", "null", ":", "getViewClass", "(", "vie...
Creates a new tab for the specified view type. @param viewer The help viewer instance. @param viewType The view type supported by the created tab. @return The help tab that supports the specified view type.
[ "Creates", "a", "new", "tab", "for", "the", "specified", "view", "type", "." ]
fa3252d4f7541dbe151b92c3d4f6f91433cd1673
https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.help-parent/org.carewebframework.help.core/src/main/java/org/carewebframework/help/viewer/HelpViewBase.java#L59-L71
train
carewebframework/carewebframework-core
org.carewebframework.help-parent/org.carewebframework.help.core/src/main/java/org/carewebframework/help/viewer/HelpViewBase.java
HelpViewBase.getViewClass
private static Class<? extends HelpViewBase> getViewClass(HelpViewType viewType) { switch (viewType) { case TOC: return HelpViewContents.class; case KEYWORD: return HelpViewIndex.class; case INDEX: return HelpViewIndex.class; case SEARCH: return HelpViewSearch.class; case HISTORY: return HelpViewHistory.class; case GLOSSARY: return HelpViewIndex.class; default: return null; } }
java
private static Class<? extends HelpViewBase> getViewClass(HelpViewType viewType) { switch (viewType) { case TOC: return HelpViewContents.class; case KEYWORD: return HelpViewIndex.class; case INDEX: return HelpViewIndex.class; case SEARCH: return HelpViewSearch.class; case HISTORY: return HelpViewHistory.class; case GLOSSARY: return HelpViewIndex.class; default: return null; } }
[ "private", "static", "Class", "<", "?", "extends", "HelpViewBase", ">", "getViewClass", "(", "HelpViewType", "viewType", ")", "{", "switch", "(", "viewType", ")", "{", "case", "TOC", ":", "return", "HelpViewContents", ".", "class", ";", "case", "KEYWORD", ":...
Returns the help view class that services the specified view type. For unsupported view types, returns null. @param viewType The view type. @return A help tab class.
[ "Returns", "the", "help", "view", "class", "that", "services", "the", "specified", "view", "type", ".", "For", "unsupported", "view", "types", "returns", "null", "." ]
fa3252d4f7541dbe151b92c3d4f6f91433cd1673
https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.help-parent/org.carewebframework.help.core/src/main/java/org/carewebframework/help/viewer/HelpViewBase.java#L80-L103
train
mgormley/prim
src/main/java/edu/jhu/prim/map/LongDoubleHashMap.java
LongDoubleHashMap.computeCapacity
private static int computeCapacity(final int expectedSize) { if (expectedSize == 0) { return 1; } final int capacity = (int) InternalFastMath.ceil(expectedSize / LOAD_FACTOR); final int powerOfTwo = Integer.highestOneBit(capacity); if (powerOfTwo == capacity) { return capacity; } return nextPowerOfTwo(capacity); }
java
private static int computeCapacity(final int expectedSize) { if (expectedSize == 0) { return 1; } final int capacity = (int) InternalFastMath.ceil(expectedSize / LOAD_FACTOR); final int powerOfTwo = Integer.highestOneBit(capacity); if (powerOfTwo == capacity) { return capacity; } return nextPowerOfTwo(capacity); }
[ "private", "static", "int", "computeCapacity", "(", "final", "int", "expectedSize", ")", "{", "if", "(", "expectedSize", "==", "0", ")", "{", "return", "1", ";", "}", "final", "int", "capacity", "=", "(", "int", ")", "InternalFastMath", ".", "ceil", "(",...
Compute the capacity needed for a given size. @param expectedSize expected size of the map @return capacity to use for the specified size
[ "Compute", "the", "capacity", "needed", "for", "a", "given", "size", "." ]
5dce5e1ae94a9ae558a6262fc246e1a24f56686c
https://github.com/mgormley/prim/blob/5dce5e1ae94a9ae558a6262fc246e1a24f56686c/src/main/java/edu/jhu/prim/map/LongDoubleHashMap.java#L175-L185
train
mgormley/prim
src/main/java/edu/jhu/prim/map/LongDoubleHashMap.java
LongDoubleHashMap.contains
public boolean contains(final long key) { final int hash = hashOf(key); int index = hash & mask; if (contains(key, index)) { return true; } if (states[index] == FREE) { return false; } int j = index; for (int perturb = perturb(hash); states[index] != FREE; perturb >>= PERTURB_SHIFT) { j = probe(perturb, j); index = j & mask; if (contains(key, index)) { return true; } } return false; }
java
public boolean contains(final long key) { final int hash = hashOf(key); int index = hash & mask; if (contains(key, index)) { return true; } if (states[index] == FREE) { return false; } int j = index; for (int perturb = perturb(hash); states[index] != FREE; perturb >>= PERTURB_SHIFT) { j = probe(perturb, j); index = j & mask; if (contains(key, index)) { return true; } } return false; }
[ "public", "boolean", "contains", "(", "final", "long", "key", ")", "{", "final", "int", "hash", "=", "hashOf", "(", "key", ")", ";", "int", "index", "=", "hash", "&", "mask", ";", "if", "(", "contains", "(", "key", ",", "index", ")", ")", "{", "r...
Check if a value is associated with a key. @param key key to check @return true if a value is associated with key
[ "Check", "if", "a", "value", "is", "associated", "with", "a", "key", "." ]
5dce5e1ae94a9ae558a6262fc246e1a24f56686c
https://github.com/mgormley/prim/blob/5dce5e1ae94a9ae558a6262fc246e1a24f56686c/src/main/java/edu/jhu/prim/map/LongDoubleHashMap.java#L234-L257
train
mgormley/prim
src/main/java/edu/jhu/prim/map/LongDoubleHashMap.java
LongDoubleHashMap.findInsertionIndex
private static int findInsertionIndex(final long[] keys, final byte[] states, final long key, final int mask) { final int hash = hashOf(key); int index = hash & mask; if (states[index] == FREE) { return index; } else if (states[index] == FULL && keys[index] == key) { return changeIndexSign(index); } int perturb = perturb(hash); int j = index; if (states[index] == FULL) { while (true) { j = probe(perturb, j); index = j & mask; perturb >>= PERTURB_SHIFT; if (states[index] != FULL || keys[index] == key) { break; } } } if (states[index] == FREE) { return index; } else if (states[index] == FULL) { // due to the loop exit condition, // if (states[index] == FULL) then keys[index] == key return changeIndexSign(index); } final int firstRemoved = index; while (true) { j = probe(perturb, j); index = j & mask; if (states[index] == FREE) { return firstRemoved; } else if (states[index] == FULL && keys[index] == key) { return changeIndexSign(index); } perturb >>= PERTURB_SHIFT; } }
java
private static int findInsertionIndex(final long[] keys, final byte[] states, final long key, final int mask) { final int hash = hashOf(key); int index = hash & mask; if (states[index] == FREE) { return index; } else if (states[index] == FULL && keys[index] == key) { return changeIndexSign(index); } int perturb = perturb(hash); int j = index; if (states[index] == FULL) { while (true) { j = probe(perturb, j); index = j & mask; perturb >>= PERTURB_SHIFT; if (states[index] != FULL || keys[index] == key) { break; } } } if (states[index] == FREE) { return index; } else if (states[index] == FULL) { // due to the loop exit condition, // if (states[index] == FULL) then keys[index] == key return changeIndexSign(index); } final int firstRemoved = index; while (true) { j = probe(perturb, j); index = j & mask; if (states[index] == FREE) { return firstRemoved; } else if (states[index] == FULL && keys[index] == key) { return changeIndexSign(index); } perturb >>= PERTURB_SHIFT; } }
[ "private", "static", "int", "findInsertionIndex", "(", "final", "long", "[", "]", "keys", ",", "final", "byte", "[", "]", "states", ",", "final", "long", "key", ",", "final", "int", "mask", ")", "{", "final", "int", "hash", "=", "hashOf", "(", "key", ...
Find the index at which a key should be inserted @param keys keys table @param states states table @param key key to lookup @param mask bit mask for hash values @return index at which key should be inserted
[ "Find", "the", "index", "at", "which", "a", "key", "should", "be", "inserted" ]
5dce5e1ae94a9ae558a6262fc246e1a24f56686c
https://github.com/mgormley/prim/blob/5dce5e1ae94a9ae558a6262fc246e1a24f56686c/src/main/java/edu/jhu/prim/map/LongDoubleHashMap.java#L296-L343
train
mgormley/prim
src/main/java/edu/jhu/prim/map/LongDoubleHashMap.java
LongDoubleHashMap.clear
public void clear() { final int capacity = keys.length; Arrays.fill(keys, 0); Arrays.fill(values, 0); Arrays.fill(states, FREE); size = 0; mask = capacity - 1; count = 0; }
java
public void clear() { final int capacity = keys.length; Arrays.fill(keys, 0); Arrays.fill(values, 0); Arrays.fill(states, FREE); size = 0; mask = capacity - 1; count = 0; }
[ "public", "void", "clear", "(", ")", "{", "final", "int", "capacity", "=", "keys", ".", "length", ";", "Arrays", ".", "fill", "(", "keys", ",", "0", ")", ";", "Arrays", ".", "fill", "(", "values", ",", "0", ")", ";", "Arrays", ".", "fill", "(", ...
Removes all entries from the hash map.
[ "Removes", "all", "entries", "from", "the", "hash", "map", "." ]
5dce5e1ae94a9ae558a6262fc246e1a24f56686c
https://github.com/mgormley/prim/blob/5dce5e1ae94a9ae558a6262fc246e1a24f56686c/src/main/java/edu/jhu/prim/map/LongDoubleHashMap.java#L406-L414
train
mgormley/prim
src/main/java_generated/edu/jhu/prim/sort/IntLongSort.java
IntLongSort.swap
private static void swap(long[] values, int[] index, int i, int j) { if (i != j) { swap(values, i, j); swap(index, i, j); numSwaps ++; } }
java
private static void swap(long[] values, int[] index, int i, int j) { if (i != j) { swap(values, i, j); swap(index, i, j); numSwaps ++; } }
[ "private", "static", "void", "swap", "(", "long", "[", "]", "values", ",", "int", "[", "]", "index", ",", "int", "i", ",", "int", "j", ")", "{", "if", "(", "i", "!=", "j", ")", "{", "swap", "(", "values", ",", "i", ",", "j", ")", ";", "swap...
Swaps the elements at positions i and j in both the values and index array, which must be the same length. @param values An array of values. @param index An array of indices. @param i The position of the first element to swap. @param j The position of the second element to swap.
[ "Swaps", "the", "elements", "at", "positions", "i", "and", "j", "in", "both", "the", "values", "and", "index", "array", "which", "must", "be", "the", "same", "length", "." ]
5dce5e1ae94a9ae558a6262fc246e1a24f56686c
https://github.com/mgormley/prim/blob/5dce5e1ae94a9ae558a6262fc246e1a24f56686c/src/main/java_generated/edu/jhu/prim/sort/IntLongSort.java#L200-L206
train
mgormley/prim
src/main/java_generated/edu/jhu/prim/arrays/FloatArrays.java
FloatArrays.getArgmax
public static IntTuple getArgmax(float[][] array, float delta) { float maxValue = Float.NEGATIVE_INFINITY; int maxX = -1; int maxY = -1; float numMax = 1; for (int x=0; x<array.length; x++) { for (int y=0; y<array[x].length; y++) { float diff = Primitives.compare(array[x][y], maxValue, delta); if (diff == 0 && Prng.nextFloat() < 1.0 / numMax) { maxValue = array[x][y]; maxX = x; maxY = y; numMax++; } else if (diff > 0) { maxValue = array[x][y]; maxX = x; maxY = y; numMax = 1; } } } return new IntTuple(maxX, maxY); }
java
public static IntTuple getArgmax(float[][] array, float delta) { float maxValue = Float.NEGATIVE_INFINITY; int maxX = -1; int maxY = -1; float numMax = 1; for (int x=0; x<array.length; x++) { for (int y=0; y<array[x].length; y++) { float diff = Primitives.compare(array[x][y], maxValue, delta); if (diff == 0 && Prng.nextFloat() < 1.0 / numMax) { maxValue = array[x][y]; maxX = x; maxY = y; numMax++; } else if (diff > 0) { maxValue = array[x][y]; maxX = x; maxY = y; numMax = 1; } } } return new IntTuple(maxX, maxY); }
[ "public", "static", "IntTuple", "getArgmax", "(", "float", "[", "]", "[", "]", "array", ",", "float", "delta", ")", "{", "float", "maxValue", "=", "Float", ".", "NEGATIVE_INFINITY", ";", "int", "maxX", "=", "-", "1", ";", "int", "maxY", "=", "-", "1"...
Gets the argmax breaking ties randomly.
[ "Gets", "the", "argmax", "breaking", "ties", "randomly", "." ]
5dce5e1ae94a9ae558a6262fc246e1a24f56686c
https://github.com/mgormley/prim/blob/5dce5e1ae94a9ae558a6262fc246e1a24f56686c/src/main/java_generated/edu/jhu/prim/arrays/FloatArrays.java#L302-L324
train
mgormley/prim
src/main/java_generated/edu/jhu/prim/arrays/FloatArrays.java
FloatArrays.count
public static int count(float[] array, float val) { int count = 0; for (int i=0; i<array.length; i++) { if (array[i] == val) { count++; } } return count; }
java
public static int count(float[] array, float val) { int count = 0; for (int i=0; i<array.length; i++) { if (array[i] == val) { count++; } } return count; }
[ "public", "static", "int", "count", "(", "float", "[", "]", "array", ",", "float", "val", ")", "{", "int", "count", "=", "0", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "array", ".", "length", ";", "i", "++", ")", "{", "if", "(", ...
Gets the number of times a given value occurs in an array.
[ "Gets", "the", "number", "of", "times", "a", "given", "value", "occurs", "in", "an", "array", "." ]
5dce5e1ae94a9ae558a6262fc246e1a24f56686c
https://github.com/mgormley/prim/blob/5dce5e1ae94a9ae558a6262fc246e1a24f56686c/src/main/java_generated/edu/jhu/prim/arrays/FloatArrays.java#L534-L542
train
mgormley/prim
src/main/java/edu/jhu/prim/sample/PairSampler.java
PairSampler.sampleOrderedPairs
public static Collection<OrderedPair> sampleOrderedPairs(int minI, int maxI, int minJ, int maxJ, double prop) { int numI = maxI - minI; int numJ = maxJ - minJ; // Count the max number possible: long maxPairs = numI * numJ; Collection<OrderedPair> samples; if (maxPairs < 400000000 || prop > 0.1) { samples = new ArrayList<OrderedPair>(); for (int i=minI; i<maxI; i++) { for (int j=minJ; j<maxJ; j++) { if (prop >= 1.0 || Prng.nextDouble() < prop) { samples.add(new OrderedPair(i, j)); } } } } else { samples = new HashSet<OrderedPair>(); double numSamples = maxPairs * prop; while (samples.size() < numSamples) { int i = Prng.nextInt(numI) + minI; int j = Prng.nextInt(numJ) + minJ; samples.add(new OrderedPair(i, j)); } } return samples; }
java
public static Collection<OrderedPair> sampleOrderedPairs(int minI, int maxI, int minJ, int maxJ, double prop) { int numI = maxI - minI; int numJ = maxJ - minJ; // Count the max number possible: long maxPairs = numI * numJ; Collection<OrderedPair> samples; if (maxPairs < 400000000 || prop > 0.1) { samples = new ArrayList<OrderedPair>(); for (int i=minI; i<maxI; i++) { for (int j=minJ; j<maxJ; j++) { if (prop >= 1.0 || Prng.nextDouble() < prop) { samples.add(new OrderedPair(i, j)); } } } } else { samples = new HashSet<OrderedPair>(); double numSamples = maxPairs * prop; while (samples.size() < numSamples) { int i = Prng.nextInt(numI) + minI; int j = Prng.nextInt(numJ) + minJ; samples.add(new OrderedPair(i, j)); } } return samples; }
[ "public", "static", "Collection", "<", "OrderedPair", ">", "sampleOrderedPairs", "(", "int", "minI", ",", "int", "maxI", ",", "int", "minJ", ",", "int", "maxJ", ",", "double", "prop", ")", "{", "int", "numI", "=", "maxI", "-", "minI", ";", "int", "numJ...
Sample with replacement ordered pairs of integers. @param minI The minimum value for i (inclusive). @param maxI The maximum value for i (exclusive). @param minJ The minimum value for j (inclusive). @param maxJ The maximum value for j (exclusive). @param prop The proportion of possible pairs to return. @return A collection of ordered pairs.
[ "Sample", "with", "replacement", "ordered", "pairs", "of", "integers", "." ]
5dce5e1ae94a9ae558a6262fc246e1a24f56686c
https://github.com/mgormley/prim/blob/5dce5e1ae94a9ae558a6262fc246e1a24f56686c/src/main/java/edu/jhu/prim/sample/PairSampler.java#L27-L57
train
mgormley/prim
src/main/java/edu/jhu/prim/sample/PairSampler.java
PairSampler.sampleUnorderedPairs
public static Collection<UnorderedPair> sampleUnorderedPairs(int minI, int maxI, int minJ, int maxJ, double prop) { int numI = maxI - minI; int numJ = maxJ - minJ; // Count the max number possible: long maxPairs = PairSampler.countUnorderedPairs(minI, maxI, minJ, maxJ); Collection<UnorderedPair> samples; if (maxPairs < 400000000 || prop > 0.1) { samples = new ArrayList<UnorderedPair>(); int min = Math.min(minI, minJ); int max = Math.max(maxI, maxJ); for (int i=min; i<max; i++) { for (int j=i; j<max; j++) { if ((minI <= i && i < maxI && minJ <= j && j < maxJ) || (minJ <= i && i < maxJ && minI <= j && j < maxI)) { if (prop >= 1.0 || Prng.nextDouble() < prop) { samples.add(new UnorderedPair(i, j)); } } } } } else { samples = new HashSet<UnorderedPair>(); double numSamples = maxPairs * prop; while (samples.size() < numSamples) { int i = Prng.nextInt(numI) + minI; int j = Prng.nextInt(numJ) + minJ; if (i <= j) { // We must reject samples for which j < i, or else we would // be making pairs with i==j half as likely. samples.add(new UnorderedPair(i, j)); } } } return samples; }
java
public static Collection<UnorderedPair> sampleUnorderedPairs(int minI, int maxI, int minJ, int maxJ, double prop) { int numI = maxI - minI; int numJ = maxJ - minJ; // Count the max number possible: long maxPairs = PairSampler.countUnorderedPairs(minI, maxI, minJ, maxJ); Collection<UnorderedPair> samples; if (maxPairs < 400000000 || prop > 0.1) { samples = new ArrayList<UnorderedPair>(); int min = Math.min(minI, minJ); int max = Math.max(maxI, maxJ); for (int i=min; i<max; i++) { for (int j=i; j<max; j++) { if ((minI <= i && i < maxI && minJ <= j && j < maxJ) || (minJ <= i && i < maxJ && minI <= j && j < maxI)) { if (prop >= 1.0 || Prng.nextDouble() < prop) { samples.add(new UnorderedPair(i, j)); } } } } } else { samples = new HashSet<UnorderedPair>(); double numSamples = maxPairs * prop; while (samples.size() < numSamples) { int i = Prng.nextInt(numI) + minI; int j = Prng.nextInt(numJ) + minJ; if (i <= j) { // We must reject samples for which j < i, or else we would // be making pairs with i==j half as likely. samples.add(new UnorderedPair(i, j)); } } } return samples; }
[ "public", "static", "Collection", "<", "UnorderedPair", ">", "sampleUnorderedPairs", "(", "int", "minI", ",", "int", "maxI", ",", "int", "minJ", ",", "int", "maxJ", ",", "double", "prop", ")", "{", "int", "numI", "=", "maxI", "-", "minI", ";", "int", "...
Sample with replacement unordered pairs of integers. @param minI The minimum value for i (inclusive). @param maxI The maximum value for i (exclusive). @param minJ The minimum value for j (inclusive). @param maxJ The maximum value for j (exclusive). @param prop The proportion of possible pairs to return. @return A collection of unordered pairs represented as ordered pairs s.t. i <= j.
[ "Sample", "with", "replacement", "unordered", "pairs", "of", "integers", "." ]
5dce5e1ae94a9ae558a6262fc246e1a24f56686c
https://github.com/mgormley/prim/blob/5dce5e1ae94a9ae558a6262fc246e1a24f56686c/src/main/java/edu/jhu/prim/sample/PairSampler.java#L69-L108
train
carewebframework/carewebframework-core
org.carewebframework.plugin-parent/org.carewebframework.plugin.chat/src/main/java/org/carewebframework/plugin/chat/ParticipantListener.java
ParticipantListener.setActive
public void setActive(boolean active) { refreshListener.setActive(active); addListener.setActive(active); removeListener.setActive(active); eventManager.fireRemoteEvent(active ? addListener.eventName : removeListener.eventName, self); if (active) { refresh(); } }
java
public void setActive(boolean active) { refreshListener.setActive(active); addListener.setActive(active); removeListener.setActive(active); eventManager.fireRemoteEvent(active ? addListener.eventName : removeListener.eventName, self); if (active) { refresh(); } }
[ "public", "void", "setActive", "(", "boolean", "active", ")", "{", "refreshListener", ".", "setActive", "(", "active", ")", ";", "addListener", ".", "setActive", "(", "active", ")", ";", "removeListener", ".", "setActive", "(", "active", ")", ";", "eventMana...
Sets the active state. @param active The new active state. When set to true, all event subscriptions are activated and a participant add event is fired globally. When set to false, all event subscriptions are inactivated and a participant remove event is fired globally.
[ "Sets", "the", "active", "state", "." ]
fa3252d4f7541dbe151b92c3d4f6f91433cd1673
https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.plugin-parent/org.carewebframework.plugin.chat/src/main/java/org/carewebframework/plugin/chat/ParticipantListener.java#L162-L171
train
carewebframework/carewebframework-core
org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/ManifestIterator.java
ManifestIterator.init
public void init() { if (manifests == null) { manifests = new ArrayList<>(); try { primaryManifest = addToList(applicationContext.getResource(MANIFEST_PATH)); Resource[] resources = applicationContext.getResources("classpath*:/" + MANIFEST_PATH); for (Resource resource : resources) { Manifest manifest = addToList(resource); if (primaryManifest == null) { primaryManifest = manifest; } } } catch (Exception e) { log.error("Error enumerating manifests.", e); } } }
java
public void init() { if (manifests == null) { manifests = new ArrayList<>(); try { primaryManifest = addToList(applicationContext.getResource(MANIFEST_PATH)); Resource[] resources = applicationContext.getResources("classpath*:/" + MANIFEST_PATH); for (Resource resource : resources) { Manifest manifest = addToList(resource); if (primaryManifest == null) { primaryManifest = manifest; } } } catch (Exception e) { log.error("Error enumerating manifests.", e); } } }
[ "public", "void", "init", "(", ")", "{", "if", "(", "manifests", "==", "null", ")", "{", "manifests", "=", "new", "ArrayList", "<>", "(", ")", ";", "try", "{", "primaryManifest", "=", "addToList", "(", "applicationContext", ".", "getResource", "(", "MANI...
Initialize the manifest list if not already done. This is done by iterating over the class path to locate all manifest files.
[ "Initialize", "the", "manifest", "list", "if", "not", "already", "done", ".", "This", "is", "done", "by", "iterating", "over", "the", "class", "path", "to", "locate", "all", "manifest", "files", "." ]
fa3252d4f7541dbe151b92c3d4f6f91433cd1673
https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/ManifestIterator.java#L109-L130
train
carewebframework/carewebframework-core
org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/ManifestIterator.java
ManifestIterator.findByPath
public Manifest findByPath(String path) { for (Manifest manifest : this) { String mpath = ((ManifestEx) manifest).path; if (path.startsWith(mpath)) { return manifest; } } return null; }
java
public Manifest findByPath(String path) { for (Manifest manifest : this) { String mpath = ((ManifestEx) manifest).path; if (path.startsWith(mpath)) { return manifest; } } return null; }
[ "public", "Manifest", "findByPath", "(", "String", "path", ")", "{", "for", "(", "Manifest", "manifest", ":", "this", ")", "{", "String", "mpath", "=", "(", "(", "ManifestEx", ")", "manifest", ")", ".", "path", ";", "if", "(", "path", ".", "startsWith"...
Returns a manifest based on the input path. @param path The path whose associated manifest is sought. @return The manifest found on the specified path, or null if none.
[ "Returns", "a", "manifest", "based", "on", "the", "input", "path", "." ]
fa3252d4f7541dbe151b92c3d4f6f91433cd1673
https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/ManifestIterator.java#L138-L148
train
carewebframework/carewebframework-core
org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/ManifestIterator.java
ManifestIterator.addToList
private Manifest addToList(Resource resource) { try { if (resource != null && resource.exists()) { Manifest manifest = new ManifestEx(resource); manifests.add(manifest); return manifest; } } catch (Exception e) { log.debug("Exception occurred reading manifest: " + resource); } return null; }
java
private Manifest addToList(Resource resource) { try { if (resource != null && resource.exists()) { Manifest manifest = new ManifestEx(resource); manifests.add(manifest); return manifest; } } catch (Exception e) { log.debug("Exception occurred reading manifest: " + resource); } return null; }
[ "private", "Manifest", "addToList", "(", "Resource", "resource", ")", "{", "try", "{", "if", "(", "resource", "!=", "null", "&&", "resource", ".", "exists", "(", ")", ")", "{", "Manifest", "manifest", "=", "new", "ManifestEx", "(", "resource", ")", ";", ...
Adds the manifest referenced by the specified resource to the list. @param resource Resource that references a manifest file. @return The manifest that was added, or null if not found or an error occurred.
[ "Adds", "the", "manifest", "referenced", "by", "the", "specified", "resource", "to", "the", "list", "." ]
fa3252d4f7541dbe151b92c3d4f6f91433cd1673
https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/ManifestIterator.java#L177-L189
train
DDTH/ddth-queue
ddth-queue-core/src/main/java/com/github/ddth/queue/impl/InmemQueue.java
InmemQueue.putToQueue
protected void putToQueue(IQueueMessage<ID, DATA> msg) throws QueueException.QueueIsFull { if (!queue.offer(msg)) { throw new QueueException.QueueIsFull(getBoundary()); } }
java
protected void putToQueue(IQueueMessage<ID, DATA> msg) throws QueueException.QueueIsFull { if (!queue.offer(msg)) { throw new QueueException.QueueIsFull(getBoundary()); } }
[ "protected", "void", "putToQueue", "(", "IQueueMessage", "<", "ID", ",", "DATA", ">", "msg", ")", "throws", "QueueException", ".", "QueueIsFull", "{", "if", "(", "!", "queue", ".", "offer", "(", "msg", ")", ")", "{", "throw", "new", "QueueException", "."...
Puts a message to the queue buffer. @param msg @throws QueueException.QueueIsFull if the ring buffer is full
[ "Puts", "a", "message", "to", "the", "queue", "buffer", "." ]
b20776850d23111d3d71fc8ed6023c590bc3621f
https://github.com/DDTH/ddth-queue/blob/b20776850d23111d3d71fc8ed6023c590bc3621f/ddth-queue-core/src/main/java/com/github/ddth/queue/impl/InmemQueue.java#L123-L127
train
carewebframework/carewebframework-core
org.carewebframework.ui-parent/org.carewebframework.ui.core/src/main/java/org/carewebframework/ui/action/ActionTypeBase.java
ActionTypeBase.getType
protected String getType(String script) { int i = script.indexOf(':'); return i < 0 ? "" : script.substring(0, i); }
java
protected String getType(String script) { int i = script.indexOf(':'); return i < 0 ? "" : script.substring(0, i); }
[ "protected", "String", "getType", "(", "String", "script", ")", "{", "int", "i", "=", "script", ".", "indexOf", "(", "'", "'", ")", ";", "return", "i", "<", "0", "?", "\"\"", ":", "script", ".", "substring", "(", "0", ",", "i", ")", ";", "}" ]
Extracts the action type prefix. @param script The script. @return The action type, or empty string if none.
[ "Extracts", "the", "action", "type", "prefix", "." ]
fa3252d4f7541dbe151b92c3d4f6f91433cd1673
https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.ui-parent/org.carewebframework.ui.core/src/main/java/org/carewebframework/ui/action/ActionTypeBase.java#L42-L45
train
carewebframework/carewebframework-core
org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/spring/PropertyBasedConfigurator.java
PropertyBasedConfigurator.setApplicationContext
@Override public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { propertyProvider = new PropertyProvider(applicationContext); conversionService = DefaultConversionService.getSharedInstance(); wireParams(this); afterInitialized(); }
java
@Override public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { propertyProvider = new PropertyProvider(applicationContext); conversionService = DefaultConversionService.getSharedInstance(); wireParams(this); afterInitialized(); }
[ "@", "Override", "public", "void", "setApplicationContext", "(", "ApplicationContext", "applicationContext", ")", "throws", "BeansException", "{", "propertyProvider", "=", "new", "PropertyProvider", "(", "applicationContext", ")", ";", "conversionService", "=", "DefaultCo...
Inject all annotated class members. @see org.springframework.context.ApplicationContextAware#setApplicationContext(org.springframework.context.ApplicationContext)
[ "Inject", "all", "annotated", "class", "members", "." ]
fa3252d4f7541dbe151b92c3d4f6f91433cd1673
https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/spring/PropertyBasedConfigurator.java#L100-L106
train
xiaosunzhu/resource-utils
src/main/java/net/sunyijun/resource/config/OneProperties.java
OneProperties.initConfigs
void initConfigs(String propertiesAbsoluteClassPath) { this.propertiesAbsoluteClassPath = propertiesAbsoluteClassPath; this.propertiesFilePath = ResourceUtil.getAbsolutePath(propertiesAbsoluteClassPath); loadConfigs(); }
java
void initConfigs(String propertiesAbsoluteClassPath) { this.propertiesAbsoluteClassPath = propertiesAbsoluteClassPath; this.propertiesFilePath = ResourceUtil.getAbsolutePath(propertiesAbsoluteClassPath); loadConfigs(); }
[ "void", "initConfigs", "(", "String", "propertiesAbsoluteClassPath", ")", "{", "this", ".", "propertiesAbsoluteClassPath", "=", "propertiesAbsoluteClassPath", ";", "this", ".", "propertiesFilePath", "=", "ResourceUtil", ".", "getAbsolutePath", "(", "propertiesAbsoluteClassP...
Init properties file path. Will reload configs every time.
[ "Init", "properties", "file", "path", ".", "Will", "reload", "configs", "every", "time", "." ]
4f2bf3f36df10195a978f122ed682ba1eb0462b5
https://github.com/xiaosunzhu/resource-utils/blob/4f2bf3f36df10195a978f122ed682ba1eb0462b5/src/main/java/net/sunyijun/resource/config/OneProperties.java#L54-L58
train