本文整理汇总了Java中com.intellij.uiDesigner.lw.IRootContainer类的典型用法代码示例。如果您正苦于以下问题:Java IRootContainer类的具体用法?Java IRootContainer怎么用?Java IRootContainer使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
IRootContainer类属于com.intellij.uiDesigner.lw包,在下文中一共展示了IRootContainer类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: collectUsedBundleNames
import com.intellij.uiDesigner.lw.IRootContainer; //导入依赖的package包/类
public static Set<String> collectUsedBundleNames(final IRootContainer rootContainer)
{
final Set<String> bundleNames = new HashSet<String>();
iterateStringDescriptors(rootContainer, new StringDescriptorVisitor<IComponent>()
{
public boolean visit(final IComponent component, final StringDescriptor descriptor)
{
if(descriptor.getBundleName() != null && !bundleNames.contains(descriptor.getBundleName()))
{
bundleNames.add(descriptor.getBundleName());
}
return true;
}
});
return bundleNames;
}
示例2: setValueImpl
import com.intellij.uiDesigner.lw.IRootContainer; //导入依赖的package包/类
protected void setValueImpl(final RadComponent component, final Boolean value) throws Exception {
if (value.booleanValue() && component.getBinding() == null) {
String initialBinding = BindingProperty.getDefaultBinding(component);
String binding = Messages.showInputDialog(
component.getProject(),
UIDesignerBundle.message("custom.create.field.name.prompt"),
UIDesignerBundle.message("custom.create.title"), Messages.getQuestionIcon(),
initialBinding, new IdentifierValidator(component.getProject()));
if (binding == null) {
return;
}
try {
new BindingProperty(component.getProject()).setValue(component, binding);
}
catch (Exception e1) {
LOG.error(e1);
}
}
component.setCustomCreate(value.booleanValue());
if (value.booleanValue()) {
final IRootContainer root = FormEditingUtil.getRoot(component);
if (root.getClassToBind() != null && Utils.getCustomCreateComponentCount(root) == 1) {
final PsiClass aClass = FormEditingUtil.findClassToBind(component.getModule(), root.getClassToBind());
if (aClass != null && FormEditingUtil.findCreateComponentsMethod(aClass) == null) {
generateCreateComponentsMethod(aClass);
}
}
}
}
示例3: prepareActionGroup
import com.intellij.uiDesigner.lw.IRootContainer; //导入依赖的package包/类
@Nullable
public static DefaultActionGroup prepareActionGroup(final RadComponent component) {
final IRootContainer root = FormEditingUtil.getRoot(component);
final String classToBind = root == null ? null : root.getClassToBind();
if (classToBind != null) {
final PsiClass aClass = FormEditingUtil.findClassToBind(component.getModule(), classToBind);
if (aClass != null) {
final PsiField boundField = aClass.findFieldByName(component.getBinding(), false);
if (boundField != null) {
return buildNavigateActionGroup(component, boundField);
}
}
}
return null;
}
示例4: checkComponentProperties
import com.intellij.uiDesigner.lw.IRootContainer; //导入依赖的package包/类
protected void checkComponentProperties(Module module, 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) {
EditorQuickFixProvider quickFixProvider = null;
IContainer parent = component.getParentContainer();
for(int i=0; i<parent.getComponentCount(); i++) {
IComponent child = parent.getComponent(i);
if (child != component &&
FormInspectionUtil.isComponentClass(module, child, JRadioButton.class)) {
final GridConstraints c1 = component.getConstraints();
final GridConstraints c2 = child.getConstraints();
if (areCellsAdjacent(parent, c1, c2)) {
final String groupName = root.getButtonGroupName(child);
if (groupName == null) {
quickFixProvider = new EditorQuickFixProvider() {
public QuickFix createQuickFix(GuiEditor editor, RadComponent component) {
return new CreateGroupQuickFix(editor, component, c1.getColumn() == c2.getColumn());
}
};
break;
}
else {
quickFixProvider = new EditorQuickFixProvider() {
public QuickFix createQuickFix(GuiEditor editor, RadComponent component) {
return new AddToGroupQuickFix(editor, component, groupName);
}
};
}
}
}
}
collector.addError(getID(), component, null, UIDesignerBundle.message("inspection.no.button.group.error"), quickFixProvider);
}
}
}
示例5: checkComponentProperties
import com.intellij.uiDesigner.lw.IRootContainer; //导入依赖的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"));
}
}
示例6: getRoot
import com.intellij.uiDesigner.lw.IRootContainer; //导入依赖的package包/类
public static IRootContainer getRoot(IComponent component)
{
while(component != null)
{
if(component.getParentContainer() instanceof IRootContainer)
{
return (IRootContainer) component.getParentContainer();
}
component = component.getParentContainer();
}
return null;
}
示例7: collectUsedLocales
import com.intellij.uiDesigner.lw.IRootContainer; //导入依赖的package包/类
public static Locale[] collectUsedLocales(final Module module, final IRootContainer rootContainer)
{
final Set<Locale> locales = new HashSet<Locale>();
final PropertiesReferenceManager propManager = PropertiesReferenceManager.getInstance(module.getProject());
for(String bundleName : collectUsedBundleNames(rootContainer))
{
List<PropertiesFile> propFiles = propManager.findPropertiesFiles(module, bundleName.replace('/', '.'));
for(PropertiesFile propFile : propFiles)
{
locales.add(propFile.getLocale());
}
}
return locales.toArray(new Locale[locales.size()]);
}
示例8: findGroupForComponent
import com.intellij.uiDesigner.lw.IRootContainer; //导入依赖的package包/类
@Nullable
public static IButtonGroup findGroupForComponent(final IRootContainer radRootContainer, @NotNull final IComponent component)
{
for(IButtonGroup group : radRootContainer.getButtonGroups())
{
for(String id : group.getComponentIds())
{
if(component.getId().equals(id))
{
return group;
}
}
}
return null;
}
示例9: analyzeErrors
import com.intellij.uiDesigner.lw.IRootContainer; //导入依赖的package包/类
public static void analyzeErrors(final GuiEditor editor, final IRootContainer rootContainer, @Nullable final ProgressIndicator progress) {
analyzeErrors(editor.getModule(), editor.getFile(), editor, rootContainer, progress);
}
示例10: getFieldNames
import com.intellij.uiDesigner.lw.IRootContainer; //导入依赖的package包/类
private static String[] getFieldNames(final RadComponent component, final String currentName) {
final ArrayList<String> result = new ArrayList<String>();
if (currentName != null){
result.add(currentName);
}
final IRootContainer root = FormEditingUtil.getRoot(component);
final String className = root.getClassToBind();
if (className == null) {
return ArrayUtil.toStringArray(result);
}
final PsiClass aClass = FormEditingUtil.findClassToBind(component.getModule(), className);
if (aClass == null) {
return ArrayUtil.toStringArray(result);
}
final PsiField[] fields = aClass.getFields();
for (final PsiField field : fields) {
if (field.hasModifierProperty(PsiModifier.STATIC)) {
continue;
}
final String fieldName = field.getName();
if (Comparing.equal(currentName, fieldName)) {
continue;
}
if (!FormEditingUtil.isBindingUnique(component, fieldName, root)) {
continue;
}
final String componentClassName;
if (component instanceof RadErrorComponent) {
componentClassName = component.getComponentClassName();
}
else if (component instanceof RadHSpacer || component instanceof RadVSpacer) {
componentClassName = Spacer.class.getName();
}
else {
componentClassName = component.getComponentClass().getName();
}
final PsiType componentType;
try {
componentType =
JavaPsiFacade.getInstance(component.getProject()).getElementFactory().createTypeFromText(componentClassName, null);
}
catch (IncorrectOperationException e) {
continue;
}
final PsiType fieldType = field.getType();
if (!fieldType.isAssignableFrom(componentType)) {
continue;
}
result.add(fieldName);
}
String text = FormInspectionUtil.getText(component.getModule(), component);
if (text != null) {
String binding = BindingProperty.suggestBindingFromText(component, text);
if (binding != null && !result.contains(binding)) {
result.add(binding);
}
}
final String[] names = ArrayUtil.toStringArray(result);
Arrays.sort(names);
return names;
}
示例11: startCheckForm
import com.intellij.uiDesigner.lw.IRootContainer; //导入依赖的package包/类
public void startCheckForm(IRootContainer rootContainer) {
}
示例12: doneCheckForm
import com.intellij.uiDesigner.lw.IRootContainer; //导入依赖的package包/类
public void doneCheckForm(IRootContainer rootContainer) {
}
示例13: startCheckForm
import com.intellij.uiDesigner.lw.IRootContainer; //导入依赖的package包/类
void startCheckForm(IRootContainer radRootContainer);
示例14: doneCheckForm
import com.intellij.uiDesigner.lw.IRootContainer; //导入依赖的package包/类
void doneCheckForm(IRootContainer radRootContainer);