本文整理汇总了Java中com.intellij.uiDesigner.FormEditingUtil.findComponent方法的典型用法代码示例。如果您正苦于以下问题:Java FormEditingUtil.findComponent方法的具体用法?Java FormEditingUtil.findComponent怎么用?Java FormEditingUtil.findComponent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.uiDesigner.FormEditingUtil
的用法示例。
在下文中一共展示了FormEditingUtil.findComponent方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: updateLabelForBinding
import com.intellij.uiDesigner.FormEditingUtil; //导入方法依赖的package包/类
void updateLabelForBinding(final RadComponent component) {
String value = getValue(component);
String text = FormInspectionUtil.getText(component.getModule(), component);
if (text != null && value != null) {
RadRootContainer root = (RadRootContainer) FormEditingUtil.getRoot(component);
if (root != null) {
RadComponent valueComponent = (RadComponent)FormEditingUtil.findComponent(root, value);
if (valueComponent != null) {
if (valueComponent instanceof RadScrollPane && ((RadScrollPane) valueComponent).getComponentCount() == 1) {
valueComponent = ((RadScrollPane) valueComponent).getComponent(0);
}
BindingProperty.checkCreateBindingFromText(valueComponent, text);
}
}
}
}
示例2: getComponent
import com.intellij.uiDesigner.FormEditingUtil; //导入方法依赖的package包/类
public JComponent getComponent(final RadRootContainer rootContainer, String value, boolean selected, boolean hasFocus) {
clear();
setBackground(selected ? UIUtil.getTableSelectionBackground() : UIUtil.getTableBackground());
if (value != null && value.length() > 0) {
RadComponent target = (RadComponent)FormEditingUtil.findComponent(rootContainer, value);
if (target != null) {
renderComponent(target, selected);
}
else {
append(UIDesignerBundle.message("component.not.found"), SimpleTextAttributes.ERROR_ATTRIBUTES);
}
}
return this;
}
示例3: checkComponentProperties
import com.intellij.uiDesigner.FormEditingUtil; //导入方法依赖的package包/类
protected void checkComponentProperties(Module module, 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.getButtonGroupComponentIds(groupName);
for(String id: sameGroupComponents) {
final IComponent otherComponent = FormEditingUtil.findComponent(root, id);
if (otherComponent != null && otherComponent != component) {
return;
}
}
collector.addError(getID(), component, null, UIDesignerBundle.message("inspection.one.button.group.error"));
}
}
示例4: getGroupContents
import com.intellij.uiDesigner.FormEditingUtil; //导入方法依赖的package包/类
public List<RadComponent> getGroupContents(final RadButtonGroup group) {
ArrayList<RadComponent> result = new ArrayList<RadComponent>();
for(String id: group.getComponentIds()) {
RadComponent component = (RadComponent) FormEditingUtil.findComponent(this, id);
if (component != null) {
result.add(component);
}
}
return result;
}
示例5: createDescriptor
import com.intellij.uiDesigner.FormEditingUtil; //导入方法依赖的package包/类
@NotNull
public NodeDescriptor createDescriptor(final Object element,final NodeDescriptor parentDescriptor){
if(element==myRootElement){
return new RootDescriptor(parentDescriptor,myRootElement);
}
else if(element instanceof ComponentPtr){
return new ComponentPtrDescriptor(parentDescriptor,(ComponentPtr)element);
}
else if (element instanceof LwInspectionSuppression[]) {
return new SuppressionGroupDescriptor(parentDescriptor, (LwInspectionSuppression[]) element);
}
else if (element instanceof LwInspectionSuppression) {
final LwInspectionSuppression suppression = (LwInspectionSuppression)element;
RadComponent target = (RadComponent)(suppression.getComponentId() == null
? null
: FormEditingUtil.findComponent(myEditor.getRootContainer(), suppression.getComponentId()));
return new SuppressionDescriptor(parentDescriptor, target, suppression);
}
else if (element instanceof RadButtonGroup[]) {
return new ButtonGroupListDescriptor(parentDescriptor, (RadButtonGroup[]) element);
}
else if (element instanceof RadButtonGroup) {
return new ButtonGroupDescriptor(parentDescriptor, (RadButtonGroup) element);
}
else{
throw new IllegalArgumentException("unknown element: "+element);
}
}
示例6: setState
import com.intellij.uiDesigner.FormEditingUtil; //导入方法依赖的package包/类
public void setState(@NotNull final FileEditorState state){
FormEditingUtil.clearSelection(myEditor.getRootContainer());
final String[] ids = ((MyEditorState)state).getSelectedComponentIds();
for (final String id : ids) {
final RadComponent component = (RadComponent)FormEditingUtil.findComponent(myEditor.getRootContainer(), id);
if (component != null) {
component.setSelected(true);
}
}
}
示例7: getChildElements
import com.intellij.uiDesigner.FormEditingUtil; //导入方法依赖的package包/类
public Object[] getChildElements(final Object element){
if(element==myRootElement){
ArrayList<Object> elements = new ArrayList<Object>();
final RadRootContainer rootContainer=myEditor.getRootContainer();
elements.add(new ComponentPtr(myEditor, rootContainer));
final LwInspectionSuppression[] suppressions = rootContainer.getInspectionSuppressions();
if (suppressions.length > 0) {
elements.add(suppressions);
}
RadButtonGroup[] buttonGroups = rootContainer.getButtonGroups();
if (buttonGroups.length > 0) {
elements.add(buttonGroups);
}
return elements.toArray();
}
else if(element instanceof ComponentPtr){
final ComponentPtr ptr=(ComponentPtr)element;
LOG.assertTrue(ptr.isValid()); // pointer must be valid
final RadComponent component=ptr.getComponent();
if(component instanceof RadContainer){
final RadContainer container=(RadContainer)component;
final ComponentPtr[] ptrs=new ComponentPtr[container.getComponentCount()];
for(int i=0;i<ptrs.length;i++){
ptrs[i]=new ComponentPtr(myEditor,container.getComponent(i));
}
return ptrs;
}else{
return ourEmptyObjectArray;
}
}
else if (element instanceof LwInspectionSuppression[]) {
ArrayList<LwInspectionSuppression> result = new ArrayList<LwInspectionSuppression>();
for(LwInspectionSuppression suppression: (LwInspectionSuppression[]) element) {
if (suppression.getComponentId() == null ||
FormEditingUtil.findComponent(myEditor.getRootContainer(), suppression.getComponentId()) != null) {
result.add(suppression);
}
}
return ArrayUtil.toObjectArray(result);
}
else if (element instanceof RadButtonGroup[]) {
return (RadButtonGroup[]) element;
}
else if (element instanceof LwInspectionSuppression || element instanceof RadButtonGroup) {
return ArrayUtil.EMPTY_OBJECT_ARRAY;
}
else{
throw new IllegalArgumentException("unknown element: "+element);
}
}
示例8: validate
import com.intellij.uiDesigner.FormEditingUtil; //导入方法依赖的package包/类
/**
* Validates (updates) the state of the pointer
*/
public void validate(){
// Try to find component with myId starting from root container
final RadContainer container=myEditor.getRootContainer();
myComponent= (RadComponent)FormEditingUtil.findComponent(container,myId);
}
示例9: selectComponentById
import com.intellij.uiDesigner.FormEditingUtil; //导入方法依赖的package包/类
public void selectComponentById(@NotNull final String id) {
final RadComponent component = (RadComponent)FormEditingUtil.findComponent(myEditor.getRootContainer(), id);
if (component != null) {
FormEditingUtil.selectSingleComponent(getEditor(), component);
}
}