Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
47,800
void (final long value) { myBuffer.append(value).append("L"); }
append
47,801
void (final char value) { checkParameter(); append(value); }
push
47,802
void (final char value) { myBuffer.append("'").append(value).append("'"); }
append
47,803
String () { return UIDesignerBundle.message("form.inspections.group"); }
getGroupDisplayName
47,804
String () { return "BoundFieldAssignment"; }
getShortName
47,805
boolean () { return true; }
isEnabledByDefault
47,806
PsiElementVisitor (@NotNull final ProblemsHolder holder, boolean isOnTheFly) { return new JavaElementVisitor() { @Override public void visitAssignmentExpression(@NotNull PsiAssignmentExpression expression) { PsiExpression lExpression = expression.getLExpression(); if (lExpression instanceof PsiReferenceExpression lExpr...
buildVisitor
47,807
void (@NotNull PsiAssignmentExpression expression) { PsiExpression lExpression = expression.getLExpression(); if (lExpression instanceof PsiReferenceExpression lExpr) { PsiElement lElement = lExpr.resolve(); if (!(lElement instanceof PsiField field)) { return; } PsiReference formReference = FormReferenceProvider.getFor...
visitAssignmentExpression
47,808
String () { return UIDesignerBundle.message("form.inspections.group"); }
getGroupDisplayName
47,809
boolean (PsiElement psiRoot) { final InspectionProfile profile = InspectionProjectProfileManager.getInstance(psiRoot.getProject()).getCurrentProfile(); HighlightDisplayKey key = HighlightDisplayKey.find(myInspectionKey); return key != null && profile.isToolEnabled(key, psiRoot); }
isActive
47,810
void (IRootContainer rootContainer) { }
startCheckForm
47,811
void (IRootContainer rootContainer) { }
doneCheckForm
47,812
String () { return "SpellCheckingInspection"; }
getAlternativeID
47,813
void (Module module, final IComponent component, final IProperty prop, final StringDescriptor descriptor, final FormErrorCollector collector) { final String value = descriptor.getResolvedValue(); if (value == null) { return; } final SpellCheckerManager manager = SpellCheckerManager.getInstance(module.getProject()); Pla...
checkStringDescriptor
47,814
void () { ListPopup popup = JBPopupFactory.getInstance().createListPopup(getPopupStep()); popup.showUnderneathOf(component1.getDelegee()); }
run
47,815
ListPopupStep<String> () { return new BaseListPopupStep<>(UIDesignerBundle.message("popup.title.select.replacement"), suggestions) { @Override public PopupStep onChosen(String selectedValue, boolean finalChoice) { FormInspectionUtil.updateStringPropertyValue(editor, component1, (IntroStringProperty)prop, descriptor, se...
getPopupStep
47,816
PopupStep (String selectedValue, boolean finalChoice) { FormInspectionUtil.updateStringPropertyValue(editor, component1, (IntroStringProperty)prop, descriptor, selectedValue); return FINAL_CHOICE; }
onChosen
47,817
void () { manager.acceptWordAsCorrect(word, editor.getProject()); }
run
47,818
String () { return myComponentId; }
getComponentId
47,819
String () { return myPropertyName; }
getPropertyName
47,820
void (final Module module, @NotNull final IComponent component, FormErrorCollector collector) { ComponentItem item = Palette.getInstance(module.getProject()).getItem(component.getComponentClassName()); if (item != null && item.isCanAttachLabel()) { IComponent root = component; while(root.getParentContainer() != null) {...
checkComponentProperties
47,821
void () { if (!myEditor.ensureEditable()) { return; } Runnable runnable = () -> { final Palette palette = Palette.getInstance(myEditor.getProject()); IntrospectedProperty[] props = palette.getIntrospectedProperties(myLabel); boolean modified = false; for(IntrospectedProperty prop: props) { if (prop.getName().equals(Swi...
run
47,822
ErrorInfo[] () { return myResults == null ? null : myResults.toArray(ErrorInfo.EMPTY_ARRAY); }
result
47,823
void (@NotNull final String inspectionId, @NotNull final IComponent component, @Nullable IProperty prop, @NotNull String errorMessage, EditorQuickFixProvider @NotNull ... editorQuickFixProviders) { if (myResults == null) { myResults = new ArrayList<>(); } List<QuickFix> quickFixes = new ArrayList<>(); for (EditorQuickF...
addError
47,824
void (Module module, @NotNull IComponent component, FormErrorCollector collector) { String value = FormInspectionUtil.getText(module, component); if (value == null) { return; } IProperty textProperty = FormInspectionUtil.findProperty(component, SwingProperties.TEXT); SupportCode.TextWithMnemonic twm = SupportCode.parse...
checkComponentProperties
47,825
QuickFix (GuiEditor editor, @NotNull RadComponent component) { return new AssignMnemonicFix(editor, component, UIDesignerBundle.message("inspections.missing.mnemonic.quickfix")); }
createQuickFix
47,826
void (Module module, @NotNull IComponent component, FormErrorCollector collector) { if (FormInspectionUtil.isComponentClass(module, component, Scrollable.class) && !FormInspectionUtil.isComponentClass(module, component, JTextField.class) && !FormInspectionUtil.isComponentClass(module, component.getParentContainer(), JS...
checkComponentProperties
47,827
void () { String scrollPane = JScrollPane.class.getName(); ComponentItem item = Palette.getInstance(myEditor.getProject()).getItem(scrollPane); SurroundAction action = new SurroundAction(item == null ? JBScrollPane.class.getName() : scrollPane); ArrayList<RadComponent> targetList = new ArrayList<>(Collections.singleton...
run
47,828
void (Module module, @NotNull IComponent component, FormErrorCollector collector) { SupportCode.TextWithMnemonic twm = getTextWithMnemonic(module, component); if (twm != null) { checkTextWithMnemonic(module, component, twm, collector); } }
checkComponentProperties
47,829
void (final Module module, @NotNull IComponent component, final SupportCode.TextWithMnemonic twm, final FormErrorCollector collector) { IRootContainer root = FormEditingUtil.getRoot(component); MnemonicMap map = myContainerMnemonicMap.get().get(root); MnemonicKey key = buildMnemonicKey(twm, component); if (map.contains...
checkTextWithMnemonic
47,830
MnemonicKey (final SupportCode.TextWithMnemonic twm, final IComponent component) { List<Integer> exclusiveContainerStack = new ArrayList<>(); IContainer parent = component.getParentContainer(); IComponent child = component; while(parent != null) { if (parent.areChildrenExclusive()) { exclusiveContainerStack.add(0, pare...
buildMnemonicKey
47,831
boolean (final Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; final MnemonicKey that = (MnemonicKey)o; if (myMnemonicChar != that.myMnemonicChar) return false; if (!myExclusiveContainerStack.equals(that.myExclusiveContainerStack)) return false; return true; }
equals
47,832
int () { int result = myMnemonicChar; result = 31 * result + myExclusiveContainerStack.hashCode(); return result; }
hashCode
47,833
void (Module module, @NotNull IComponent component, FormErrorCollector collector) { for(IProperty prop: component.getModifiedProperties()) { Object propValue = prop.getPropertyValue(component); if (propValue instanceof StringDescriptor descriptor) { checkStringDescriptor(module, component, prop, descriptor, collector);...
checkComponentProperties
47,834
String () { return ITabbedPane.TAB_TITLE_PROPERTY; }
getName
47,835
Object (final IComponent component) { return null; }
getPropertyValue
47,836
String () { return ITabbedPane.TAB_TOOLTIP_PROPERTY; }
getName
47,837
Object (final IComponent component) { return null; }
getPropertyValue
47,838
void (Module module, @NotNull IComponent component, FormErrorCollector collector) { if (FormInspectionUtil.isComponentClass(module, component, JRadioButton.class)) { final IRootContainer root = FormEditingUtil.getRoot(component); if (root == null) return; if (root.getButtonGroupName(component) == null) { EditorQuickFix...
checkComponentProperties
47,839
boolean (final IContainer parent, final GridConstraints c1, final GridConstraints c2) { if (parent instanceof RadContainer container) { if (!container.getLayoutManager().isGrid()) return false; if (c1.getRow() == c2.getRow()) { return FormEditingUtil.prevCol(container, c1.getColumn()) == c2.getColumn() || FormEditingUt...
areCellsAdjacent
47,840
void () { RadContainer parent = myComponent.getParent(); ArrayList<RadComponent> buttonsToGroup = new ArrayList<>(); for(RadComponent component: parent.getComponents()) { if (FormInspectionUtil.isComponentClass(myComponent.getModule(), component, JRadioButton.class)) { if (component.getConstraints().getCell(!myVertical...
run
47,841
void () { RadRootContainer root = (RadRootContainer) FormEditingUtil.getRoot(myComponent); if (root == null) return; for(RadButtonGroup group: root.getButtonGroups()) { if (group.getName().equals(myGroupName)) { root.setGroupForComponent(myComponent, group); break; } } myEditor.refreshAndSave(true); }
run
47,842
boolean (final Module module, final IComponent component, final Class<?> componentClass) { final GlobalSearchScope scope = GlobalSearchScope.moduleWithDependenciesAndLibrariesScope(module); final PsiManager psiManager = PsiManager.getInstance(module.getProject()); final PsiClass aClass = JavaPsiFacade.getInstance(psiMa...
isComponentClass
47,843
IProperty (@NotNull IComponent component, final String name) { IProperty[] props = component.getModifiedProperties(); for(IProperty prop: props) { if (prop.getName().equals(name)) return prop; } return null; }
findProperty
47,844
void (GuiEditor editor, RadComponent component, IntroStringProperty prop, StringDescriptor descriptor, String result) { if (descriptor.getBundleName() == null) { prop.setValueEx(component, StringDescriptor.create(result)); } else { final String newKeyName = StringEditorDialog.saveModifiedPropertyValue(editor.getModule(...
updateStringPropertyValue
47,845
void (Module module, @NotNull final IComponent component, final FormErrorCollector collector) { final GlobalSearchScope scope = GlobalSearchScope.moduleWithDependenciesAndLibrariesScope(module); final PsiManager psiManager = PsiManager.getInstance(module.getProject()); final PsiClass aClass = JavaPsiFacade.getInstance(...
checkComponentProperties
47,846
void (final IComponent component, final FormErrorCollector collector, final IProperty prop, @NonNls final String api) { collector.addError(getID(), component, prop, UIDesignerBundle.message("inspection.java15form.problem.descriptor", api), (editor, component1) -> new RemoveUIPropertyFix(editor, component1, (Property)pr...
registerError
47,847
void () { ResetValueAction.doResetValue(Collections.singletonList(myComponent), myProperty, myEditor); }
run
47,848
void (final String inspectionId, @NotNull final IComponent component, @Nullable IProperty prop, @NotNull String errorMessage, EditorQuickFixProvider @NotNull ... editorQuickFixProviders) { List<LocalQuickFix> quickFixes = new ArrayList<>(); for (EditorQuickFixProvider provider : editorQuickFixProviders) { if (provider ...
addError
47,849
ProblemDescriptor[] () { return myProblems.toArray(ProblemDescriptor.EMPTY_ARRAY); }
result
47,850
void (Module module, @NotNull IComponent component, FormErrorCollector collector) { final IRootContainer root = FormEditingUtil.getRoot(component); if (root == null) return; String groupName = root.getButtonGroupName(component); if (groupName != null) { final String[] sameGroupComponents = root.getButtonGroupComponentI...
checkComponentProperties
47,851
void () { IProperty textProperty = FormInspectionUtil.findProperty(myComponent, SwingProperties.TEXT); StringDescriptor descriptor = (StringDescriptor) textProperty.getPropertyValue(myComponent); String value = StringDescriptorManager.getInstance(myComponent.getModule()).resolve(myComponent, descriptor); String[] varia...
run
47,852
String[] (final String value) { final StringBuffer usedMnemonics = new StringBuffer(); RadContainer container = myComponent.getParent(); if (container != null) { while (container.getParent() != null) { container = container.getParent(); } FormEditingUtil.iterate(container, new FormEditingUtil.ComponentVisitor() { @Over...
fillMnemonicVariants
47,853
boolean (final IComponent component) { SupportCode.TextWithMnemonic twm = DuplicateMnemonicInspection.getTextWithMnemonic(myEditor.getModule(), component); if (twm != null) { usedMnemonics.append(twm.getMnemonicChar()); } return true; }
visit
47,854
Palette (@NotNull Project project) { return project.getService(Palette.class); }
getInstance
47,855
void () { }
dispose
47,856
Element () { Element state = new Element("state"); writeGroups(state); return state; }
getState
47,857
void (@NotNull Element state) { myClass2Properties.clear(); myClassName2Item.clear(); myGroups.clear(); processGroups(state.getChildren(ELEMENT_GROUP)); // Ensure that all predefined items are loaded LOG.assertTrue(myPanelItem != null); if (!state.getAttributeValue(ATTRIBUTE_VERSION, "1").equals("2")) { upgradePalette(...
loadState
47,858
void () { try { loadState(Objects.requireNonNull(loadDefaultPalette())); } catch (Exception e) { LOG.error(e); } }
noStateLoaded
47,859
void (final @NotNull Listener l) { LOG.assertTrue(!myListeners.contains(l)); myListeners.add(l); }
addListener
47,860
void () { // load new components from the predefined Palette2.xml try { Element rootElement = loadDefaultPalette(); for (Element groupElement : Objects.requireNonNull(rootElement).getChildren(ELEMENT_GROUP)) { for (GroupItem group : myGroups) { if (group.getName().equals(groupElement.getAttributeValue(ATTRIBUTE_NAME)))...
upgradePalette
47,861
void (final GroupItem group, final Element groupElement) { for (Element itemElement : groupElement.getChildren(ELEMENT_ITEM)) { if (itemElement.getAttributeValue(ATTRIBUTE_SINCE_VERSION, "").equals("2")) { processItemElement(itemElement, group, true); } final String className = LwXmlReader.getRequiredString(itemElement...
upgradeGroup
47,862
ComponentItem () { return myPanelItem; }
getPanelItem
47,863
List<GroupItem> () { return myGroups; }
getGroups
47,864
GroupItem[] () { GroupItem[] groups = new GroupItem[myGroups.size() + 1]; for (int i = 0; i < myGroups.size(); i++) { groups[i] = myGroups.get(i); } groups[myGroups.size()] = mySpecialGroup; return groups; }
getToolWindowGroups
47,865
void (final @NotNull ArrayList<GroupItem> groups) { myGroups.clear(); myGroups.addAll(groups); fireGroupsChanged(); }
setGroups
47,866
void (final @NotNull GroupItem group, final @NotNull ComponentItem item) { // class -> item final String componentClassName = item.getClassName(); if (getItem(componentClassName) != null) { Messages.showMessageDialog( UIDesignerBundle.message("error.item.already.added", componentClassName), ApplicationNamesInfo.getInst...
addItem
47,867
void (GroupItem group, ComponentItem oldItem, ComponentItem newItem) { group.replaceItem(oldItem, newItem); myClassName2Item.put(oldItem.getClassName(), newItem); }
replaceItem
47,868
void (final GroupItem group, final ComponentItem selectedItem) { group.removeItem(selectedItem); myClassName2Item.remove(selectedItem.getClassName()); }
removeItem
47,869
GroupItem (final ComponentItem componentItem) { for (GroupItem group : myGroups) { if (group.contains(componentItem)) { return group; } } return null; }
findGroup
47,870
GridConstraints (final @NotNull Element element) { final GridConstraints constraints = new GridConstraints(); // grid related attributes constraints.setVSizePolicy(LwXmlReader.getRequiredInt(element, ATTRIBUTE_VSIZE_POLICY)); constraints.setHSizePolicy(LwXmlReader.getRequiredInt(element, ATTRIBUTE_HSIZE_POLICY)); const...
processDefaultConstraintsElement
47,871
void (final @NotNull Element itemElement, final @NotNull GroupItem group, final boolean skipExisting) { // Class name. It's OK if class does not exist. final String className = LwXmlReader.getRequiredString(itemElement, ATTRIBUTE_CLASS); if (skipExisting && getItem(className) != null) { return; } // Icon (optional) fin...
processItemElement
47,872
void (@NotNull List<Element> groupElements) { for (Element groupElement : groupElements) { GroupItem group = new GroupItem(LwXmlReader.getRequiredString(groupElement, ATTRIBUTE_NAME)); myGroups.add(group); for (Element itemElement : groupElement.getChildren(ELEMENT_ITEM)) { try { processItemElement(itemElement, group, ...
processGroups
47,873
void (final @NotNull Element itemElement, final @NotNull GridConstraints c) { LOG.assertTrue(ELEMENT_ITEM.equals(itemElement.getName())); final Element element = new Element(ELEMENT_DEFAULT_CONSTRAINTS); itemElement.addContent(element); // grid related attributes { element.setAttribute(ATTRIBUTE_VSIZE_POLICY, Integer.t...
writeDefaultConstraintsElement
47,874
void ( final @NotNull Element itemElement, final @NotNull HashMap<String, StringDescriptor> name2value ) { LOG.assertTrue(ELEMENT_ITEM.equals(itemElement.getName())); if (name2value.size() == 0) { // do not append 'initial-values' subtag return; } final Element initialValuesElement = new Element(ELEMENT_INITIAL_VALUES)...
writeInitialValuesElement
47,875
void (final @NotNull Element groupElement, final @NotNull ComponentItem item) { LOG.assertTrue(ELEMENT_GROUP.equals(groupElement.getName())); final Element itemElement = new Element(ELEMENT_ITEM); groupElement.addContent(itemElement); // Class itemElement.setAttribute(ATTRIBUTE_CLASS, item.getClassName()); // Tooltip t...
writeComponentItem
47,876
void (@NotNull Element parentElement) { for (GroupItem group : myGroups) { Element groupElement = new Element(ELEMENT_GROUP); parentElement.addContent(groupElement); groupElement.setAttribute(ATTRIBUTE_NAME, group.getName()); for (ComponentItem aItemList : group.getItems()) { writeComponentItem(groupElement, aItemList)...
writeGroups
47,877
IntroIntProperty ( final String name, final Method readMethod, final Method writeMethod, final IntEnumEditor.Pair[] pairs ) { return new IntroIntProperty( name, readMethod, writeMethod, new IntEnumRenderer(pairs), new IntEnumEditor(pairs), false); }
createIntEnumProperty
47,878
boolean (final @NotNull GroupItem group) { final ComponentItem[] items = group.getItems(); for (int i = items.length - 1; i >= 0; i--) { if (!items[i].isRemovable()) { return false; } } return true; }
isRemovable
47,879
void (Property<?, ?> property) { PropertyRenderer<?> renderer = property.getRenderer(); renderer.updateUI(); PropertyEditor<?> editor = property.getEditor(); if (editor != null) { editor.updateUI(); } Property<?, ?>[] children = property.getChildren(null); for (int i = children.length - 1; i >= 0; i--) { updateUI(child...
updateUI
47,880
void (final @NotNull LafManager source) { for (final IntrospectedProperty<?>[] properties : myClass2Properties.values()) { LOG.assertTrue(properties != null); for (int j = properties.length - 1; j >= 0; j--) { updateUI(properties[j]); } } }
lookAndFeelChanged
47,881
RefactoringElementListener (PsiElement element) { if (element instanceof PsiClass psiClass) { final String oldName = ClassUtil.getJVMClassName(psiClass); if (oldName != null) { final ComponentItem item = Palette.getInstance(element.getProject()).getItem(oldName); if (item != null) { return new MyRefactoringElementListe...
getListener
47,882
void (@NotNull PsiElement newElement) { PsiClass psiClass = (PsiClass) newElement; final String qName = ClassUtil.getJVMClassName(psiClass); if (qName != null) { myItem.setClassName(qName); PaletteItemProvider.EP_NAME.findExtensionOrFail(UIDesignerPaletteProvider.class).fireGroupsChanged(); } }
elementRenamedOrMoved
47,883
void (@NotNull PsiElement newElement, @NotNull String oldQualifiedName) { myItem.setClassName(oldQualifiedName); PaletteItemProvider.EP_NAME.findExtensionOrFail(UIDesignerPaletteProvider.class).fireGroupsChanged(); }
undoElementMovedOrRenamed
47,884
void (@NotNull AnActionEvent e) { Project project = e.getData(CommonDataKeys.PROJECT); if (project == null) return; // Ask group name final String groupName = Messages.showInputDialog( project, UIDesignerBundle.message("message.enter.group.name"), UIDesignerBundle.message("title.add.group"), Messages.getQuestionIcon() ...
actionPerformed
47,885
ActionUpdateThread () { return ActionUpdateThread.BGT; }
getActionUpdateThread
47,886
boolean () { return myRemovable; }
isRemovable
47,887
String (@NotNull final String className) { final int lastDotIndex = className.lastIndexOf('.'); if (lastDotIndex != -1 && lastDotIndex != className.length() - 1/*not the last char in class name*/) { return className.substring(lastDotIndex + 1) + " (" + className.substring(0, lastDotIndex) + ")"; } else{ return classNam...
calcToolTipText
47,888
ComponentItem () { final ComponentItem result = new ComponentItem( myProject, myClassName, myIconPath, myToolTipText, (GridConstraints)myDefaultConstraints.clone(), (HashMap<String, StringDescriptor>)myPropertyName2initialValue.clone(), myRemovable, myAutoCreateBinding, myCanAttachLabel ); result.setIsContainer(myIsCon...
clone
47,889
Icon () { // Check cached value first if (myIcon != null) { return myIcon; } // Create new icon if (myIconPath != null && myIconPath.length() > 0) { final VirtualFile iconFile = ResourceFileUtil.findResourceFileInScope(myIconPath, myProject, GlobalSearchScope.allScope(myProject)); if (iconFile != null) { try { myIcon =...
getIcon
47,890
Icon () { // Check cached value first if(mySmallIcon != null){ return myIcon; } // [vova] It's safe to cast to ImageIcon here because all icons loaded by IconLoader // are ImageIcon(s). final Icon icon = getIcon(); if (icon instanceof ImageIcon imageIcon) { mySmallIcon = new MySmallIcon(imageIcon.getImage()); } else { ...
getSmallIcon
47,891
String () { return myClassName; }
getClassName
47,892
void (@NotNull final String className) { myClassName = className; }
setClassName
47,893
GridConstraints () { return myDefaultConstraints; }
getDefaultConstraints
47,894
Object (final IntrospectedProperty property) { return myPropertyName2initialValue.get(property.getName()); }
getInitialValue
47,895
boolean () { return myAutoCreateBinding; }
isAutoCreateBinding
47,896
void (final boolean autoCreateBinding) { myAutoCreateBinding = autoCreateBinding; }
setAutoCreateBinding
47,897
boolean () { return myCanAttachLabel; }
isCanAttachLabel
47,898
void (final boolean canAttachLabel) { myCanAttachLabel = canAttachLabel; }
setCanAttachLabel
47,899
boolean () { return myIsContainer; }
isContainer