当前位置: 首页>>代码示例>>Java>>正文


Java UIDesignerBundle类代码示例

本文整理汇总了Java中com.intellij.uiDesigner.UIDesignerBundle的典型用法代码示例。如果您正苦于以下问题:Java UIDesignerBundle类的具体用法?Java UIDesignerBundle怎么用?Java UIDesignerBundle使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


UIDesignerBundle类属于com.intellij.uiDesigner包,在下文中一共展示了UIDesignerBundle类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: addItem

import com.intellij.uiDesigner.UIDesignerBundle; //导入依赖的package包/类
/**
 * Adds specified <code>item</code> to the palette.
 *
 * @param item item to be added
 * @throws IllegalArgumentException if an item for the same class
 *                                            is already exists in the palette
 */
public void addItem(@NotNull final GroupItem group, @NotNull final ComponentItem item) {
  // class -> item
  final String componentClassName = item.getClassName();
  if (getItem(componentClassName) != null) {
    Messages.showMessageDialog(
      UIDesignerBundle.message("error.item.already.added", componentClassName),
      ApplicationNamesInfo.getInstance().getFullProductName(),
      Messages.getErrorIcon()
    );
    return;
  }
  myClassName2Item.put(componentClassName, item);

  // group -> items
  group.addItem(item);

  // Process special predefined item for JPanel
  if ("javax.swing.JPanel".equals(item.getClassName())) {
    myPanelItem = item;
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:29,代码来源:Palette.java

示例2: actionPerformed

import com.intellij.uiDesigner.UIDesignerBundle; //导入依赖的package包/类
public void actionPerformed(AnActionEvent e) {
  Project project = e.getData(CommonDataKeys.PROJECT);
  GroupItem groupToBeRemoved = e.getData(GroupItem.DATA_KEY);
  if (groupToBeRemoved == null || project == null) return;

  if(!Palette.isRemovable(groupToBeRemoved)){
    Messages.showInfoMessage(
      project,
      UIDesignerBundle.message("error.cannot.remove.default.group"),
      CommonBundle.getErrorTitle()
    );
    return;
  }

  Palette palette = Palette.getInstance(project);
  ArrayList<GroupItem> groups = new ArrayList<GroupItem>(palette.getGroups());
  groups.remove(groupToBeRemoved);
  palette.setGroups(groups);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:DeleteGroupAction.java

示例3: actionPerformed

import com.intellij.uiDesigner.UIDesignerBundle; //导入依赖的package包/类
public void actionPerformed(AnActionEvent e) {
  Project project = e.getData(CommonDataKeys.PROJECT);
  ComponentItem selectedItem = e.getData(ComponentItem.DATA_KEY);
  GroupItem groupItem = e.getData(GroupItem.DATA_KEY);
  if (project == null || selectedItem == null || groupItem == null) return;

  if(!selectedItem.isRemovable()){
    Messages.showInfoMessage(
      project,
      UIDesignerBundle.message("error.cannot.remove.default.palette"),
      CommonBundle.getErrorTitle()
    );
    return;
  }

  int rc = Messages.showYesNoDialog(project, UIDesignerBundle.message("delete.component.prompt", selectedItem.getClassShortName()),
                                    UIDesignerBundle.message("delete.component.title"), Messages.getQuestionIcon());
  if (rc != Messages.YES) return;

  final Palette palette = Palette.getInstance(project);
  palette.removeItem(groupItem, selectedItem);
  palette.fireGroupsChanged();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:24,代码来源:DeleteComponentAction.java

示例4: LightBulbComponentImpl

import com.intellij.uiDesigner.UIDesignerBundle; //导入依赖的package包/类
public LightBulbComponentImpl(@NotNull final QuickFixManager manager, @NotNull final Icon icon) {
  myManager = manager;
  myIcon = icon;

  setPreferredSize(new Dimension(icon.getIconWidth(), icon.getIconHeight()));
  final String acceleratorsText = KeymapUtil.getFirstKeyboardShortcutText(
    ActionManager.getInstance().getAction(IdeActions.ACTION_SHOW_INTENTION_ACTIONS));
  if (acceleratorsText.length() > 0) {
    setToolTipText(UIDesignerBundle.message("tooltip.press.accelerator", acceleratorsText));
  }

  new ClickListener() {
    @Override
    public boolean onClick(@NotNull MouseEvent e, int clickCount) {
      myManager.showIntentionPopup();
      return true;
    }
  }.installOn(this);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:LightBulbComponentImpl.java

示例5: run

import com.intellij.uiDesigner.UIDesignerBundle; //导入依赖的package包/类
public void run() {
  final PsiFile psiFile = myField.getContainingFile();
  if (psiFile == null) return;
  if (!FileModificationService.getInstance().preparePsiElementForWrite(psiFile)) return;
  ApplicationManager.getApplication().runWriteAction(new Runnable() {
    public void run() {
      CommandProcessor.getInstance().executeCommand(myField.getProject(), new Runnable() {
        public void run() {
          try {
            final PsiManager manager = myField.getManager();
            myField.getTypeElement().replace(JavaPsiFacade.getInstance(manager.getProject()).getElementFactory().createTypeElement(myNewType));
          }
          catch (final IncorrectOperationException e) {
            ApplicationManager.getApplication().invokeLater(new Runnable() {
              public void run() {
                Messages.showErrorDialog(myEditor, UIDesignerBundle.message("error.cannot.change.field.type", myField.getName(), e.getMessage()),
                                         CommonBundle.getErrorTitle());
              }
            });
          }
        }
      }, getName(), null);
    }
  });
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:26,代码来源:ChangeFieldTypeFix.java

示例6: getTableCellEditorComponent

import com.intellij.uiDesigner.UIDesignerBundle; //导入依赖的package包/类
public Component getTableCellEditorComponent(final JTable table, @NotNull final Object value, final boolean isSelected, final int row, final int column){
  final Property property=(Property)value;
  try {
    //noinspection unchecked
    final JComponent c = myEditor.getComponent(mySelection.get(0), getSelectionValue(property), null);
    if (c instanceof JComboBox) {
      c.putClientProperty("JComboBox.isTableCellEditor", Boolean.TRUE);
    } else if (c instanceof JCheckBox) {
      c.putClientProperty( "JComponent.sizeVariant", UIUtil.isUnderAquaLookAndFeel() ? "small" : null);
    }

    return c;
  }
  catch(Exception ex) {
    LOG.debug(ex);
    SimpleColoredComponent errComponent = new SimpleColoredComponent();
    errComponent.append(UIDesignerBundle.message("error.getting.value", ex.getMessage()), SimpleTextAttributes.ERROR_ATTRIBUTES);
    return errComponent;
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:21,代码来源:PropertyInspectorTable.java

示例7: findPropertyReferences

import com.intellij.uiDesigner.UIDesignerBundle; //导入依赖的package包/类
private static Collection<PsiReference> findPropertyReferences(final Property pproperty, final Module module) {
  final Collection<PsiReference> references = Collections.synchronizedList(new ArrayList<PsiReference>());
  ProgressManager.getInstance().runProcessWithProgressSynchronously(
        new Runnable() {
      public void run() {
        ReferencesSearch.search(pproperty).forEach(new Processor<PsiReference>() {
          public boolean process(final PsiReference psiReference) {
            PsiMethod method = PsiTreeUtil.getParentOfType(psiReference.getElement(), PsiMethod.class);
            if (method == null || !AsmCodeGenerator.SETUP_METHOD_NAME.equals(method.getName())) {
              references.add(psiReference);
            }
            return true;
          }
        });
      }
    }, UIDesignerBundle.message("edit.text.searching.references"), false, module.getProject()
  );
  return references;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:StringEditorDialog.java

示例8: saveCreatedProperty

import com.intellij.uiDesigner.UIDesignerBundle; //导入依赖的package包/类
public static boolean saveCreatedProperty(final PropertiesFile bundle, final String name, final String value,
                                          final PsiFile formFile) {
  final ReadonlyStatusHandler.OperationStatus operationStatus =
    ReadonlyStatusHandler.getInstance(bundle.getProject()).ensureFilesWritable(bundle.getVirtualFile());
  if (operationStatus.hasReadonlyFiles()) {
    return false;
  }
  CommandProcessor.getInstance().executeCommand(
    bundle.getProject(),
    new Runnable() {
      public void run() {
        UndoUtil.markPsiFileForUndo(formFile);
        ApplicationManager.getApplication().runWriteAction(new Runnable() {
          public void run() {
            try {
              bundle.addProperty(name, value);
            }
            catch (IncorrectOperationException e1) {
              LOG.error(e1);
            }
          }
        });
      }
    }, UIDesignerBundle.message("command.create.property"), null);
  return true;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:27,代码来源:StringEditorDialog.java

示例9: getValue

import com.intellij.uiDesigner.UIDesignerBundle; //导入依赖的package包/类
public T getValue() throws Exception {
  final Matcher matcher = myPattern.matcher(myTf.getText());
  if (!matcher.matches()) {
    throw new Exception("Incorrect dimension format");
  }

  Class[] paramTypes = new Class[myMinValues.length];
  Integer[] params = new Integer[myMinValues.length];
  for(int i=0; i<myMinValues.length; i++) {
    paramTypes [i] = int.class;
    final int value = Integer.parseInt(matcher.group(i + 1));
    if (value < myMinValues [i]) {
      throw new RuntimeException(UIDesignerBundle.message("error.value.should.not.be.less", myMinValues [i]));
    }
    params [i] = value;
  }

  return myValueClass.getConstructor(paramTypes).newInstance(params);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:IntRegexEditor.java

示例10: run

import com.intellij.uiDesigner.UIDesignerBundle; //导入依赖的package包/类
public void run() {
  if (!myEditor.ensureEditable()) {
    return;
  }
  Runnable runnable = new Runnable() {
    public void run() {
      final Palette palette = Palette.getInstance(myEditor.getProject());
      IntrospectedProperty[] props = palette.getIntrospectedProperties(myLabel);
      boolean modified = false;
      for(IntrospectedProperty prop: props) {
        if (prop.getName().equals(SwingProperties.LABEL_FOR) && prop instanceof IntroComponentProperty) {
          IntroComponentProperty icp = (IntroComponentProperty) prop;
          icp.setValueEx(myLabel, myComponent.getId());
          modified = true;
          break;
        }
      }
      if (modified) myEditor.refreshAndSave(false);
    }
  };
  CommandProcessor.getInstance().executeCommand(myEditor.getProject(), runnable,
                                                UIDesignerBundle.message("inspection.no.label.for.command"), null);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:24,代码来源:NoLabelForInspection.java

示例11: initToolWindow

import com.intellij.uiDesigner.UIDesignerBundle; //导入依赖的package包/类
@Override
protected void initToolWindow() {
  myToolWindow = ToolWindowManager.getInstance(myProject).registerToolWindow(UIDesignerBundle.message("toolwindow.ui.designer.name"),
                                                                             false, getAnchor(), myProject, true);
  myToolWindow.setIcon(UIDesignerIcons.ToolWindowUIDesigner);

  if (!ApplicationManager.getApplication().isHeadlessEnvironment()) {
    myToolWindow.getComponent().putClientProperty(ToolWindowContentUi.HIDE_ID_LABEL, "true");
  }

  initGearActions();

  ContentManager contentManager = myToolWindow.getContentManager();
  Content content =
    contentManager.getFactory()
      .createContent(myToolWindowPanel.getToolWindowPanel(), UIDesignerBundle.message("toolwindow.ui.designer.title"), false);
  content.setCloseable(false);
  content.setPreferredFocusableComponent(myToolWindowPanel.getComponentTree());
  contentManager.addContent(content);
  contentManager.setSelectedContent(content, true);
  myToolWindow.setAvailable(false, null);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:23,代码来源:DesignerToolWindowManager.java

示例12: createFormBody

import com.intellij.uiDesigner.UIDesignerBundle; //导入依赖的package包/类
protected String createFormBody(@Nullable String fqn, @NonNls String formName, String layoutManager) throws IncorrectOperationException {
  String s;
  try {
    s = FileUtil.loadTextAndClose(getClass().getResourceAsStream(formName));
  }
  catch (IOException e) {
    throw new IncorrectOperationException(UIDesignerBundle.message("error.cannot.read", formName), (Throwable)e);
  }

  if (fqn != null) {
    s = StringUtil.replace(s, "$CLASS$", fqn);
  }
  else {
    s = StringUtil.replace(s, "bind-to-class=\"$CLASS$\"", "");
  }

  s = StringUtil.replace(s, "$LAYOUT$", layoutManager);

  return StringUtil.convertLineSeparators(s);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:21,代码来源:AbstractCreateFormAction.java

示例13: actionPerformed

import com.intellij.uiDesigner.UIDesignerBundle; //导入依赖的package包/类
protected void actionPerformed(final GuiEditor editor, final List<RadComponent> selection, final AnActionEvent e) {
  Processor<ComponentItem> processor = new Processor<ComponentItem>() {
    public boolean process(final ComponentItem selectedValue) {
      if (selectedValue != null) {
        myLastCreatedComponent = selectedValue;
        editor.getMainProcessor().startInsertProcessor(selectedValue, getCreateLocation(editor, selection));
      }
      return true;
    }
  };

  PaletteListPopupStep step = new PaletteListPopupStep(editor, myLastCreatedComponent, processor,
                                                       UIDesignerBundle.message("create.component.title"));
  final ListPopup listPopup = JBPopupFactory.getInstance().createListPopup(step);

  if (selection.size() > 0) {
    FormEditingUtil.showPopupUnderComponent(listPopup, selection.get(0));
  }
  else {
    listPopup.showInCenterOf(editor.getRootContainer().getDelegee());
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:23,代码来源:CreateComponentAction.java

示例14: doPaste

import com.intellij.uiDesigner.UIDesignerBundle; //导入依赖的package包/类
private void doPaste(final ComponentDropLocation location) {
  if (location.canDrop(myPastedComponentList) && myEditor.ensureEditable()) {
    final RadComponent[] componentsToPaste = myComponentsToPaste.toArray(new RadComponent[myComponentsToPaste.size()]);
    CommandProcessor.getInstance().executeCommand(
      myEditor.getProject(),
      new Runnable() {
        public void run() {
          location.processDrop(myEditor, componentsToPaste, null, myPastedComponentList);
          for(RadComponent c: componentsToPaste) {
            FormEditingUtil.iterate(c, new FormEditingUtil.ComponentVisitor() {
              public boolean visit(final IComponent component) {
                if (component.getBinding() != null) {
                  InsertComponentProcessor.createBindingField(myEditor, (RadComponent) component);
                }
                return true;
              }
            });
          }
          FormEditingUtil.selectComponents(myEditor, myComponentsToPaste);
          myEditor.refreshAndSave(true);
        }
      }, UIDesignerBundle.message("command.paste"), null);
    endPaste();
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:26,代码来源:PasteProcessor.java

示例15: getInsertFeedbackTooltip

import com.intellij.uiDesigner.UIDesignerBundle; //导入依赖的package包/类
private String getInsertFeedbackTooltip() {
  StringBuilder result = new StringBuilder(myContainer.getDisplayName());
  result.append(" (");
  if (myXPart == 1 && myYPart == 1) {
    result.append(UIDesignerBundle.message("insert.feedback.fill"));
  }
  else {
    if (myYPart == 0) {
      result.append(UIDesignerBundle.message("insert.feedback.top"));
    }
    else if (myYPart == 2) {
      result.append(UIDesignerBundle.message("insert.feedback.bottom"));
    }
    if (myYPart != 1 && myXPart != 1) {
      result.append(" ");
    }
    if (myXPart == 0) {
      result.append(UIDesignerBundle.message("insert.feedback.left"));
    }
    else if (myXPart == 2) {
      result.append(UIDesignerBundle.message("insert.feedback.right"));
    }
  }
  result.append(")");
  return result.toString();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:27,代码来源:FirstComponentInsertLocation.java


注:本文中的com.intellij.uiDesigner.UIDesignerBundle类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。