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


Java ComponentTree类代码示例

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


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

示例1: renderComponent

import com.intellij.uiDesigner.componentTree.ComponentTree; //导入依赖的package包/类
private void renderComponent(@Nullable final RadComponent target, boolean selected) {
  clear();
  final SimpleTextAttributes baseAttributes =
    selected ? SimpleTextAttributes.SELECTED_SIMPLE_CELL_ATTRIBUTES : SimpleTextAttributes.SIMPLE_CELL_ATTRIBUTES;
  if (target == null) {
    append(UIDesignerBundle.message("component.none"), baseAttributes);
    return;
  }
  setIcon(ComponentTree.getComponentIcon(target));
  String binding = target.getBinding();
  if (binding != null) {
    append(binding, baseAttributes);
  }
  else {
    final String componentTitle = target.getComponentTitle();
    if (componentTitle != null && componentTitle.length() > "\"\"".length()) {
      append(componentTitle, baseAttributes);
    }
    else {
      append(target.getComponentClass().getSimpleName(),
             selected ? SimpleTextAttributes.SELECTED_SIMPLE_CELL_ATTRIBUTES : SimpleTextAttributes.GRAYED_ATTRIBUTES);
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:25,代码来源:ComponentRenderer.java

示例2: dragExit

import com.intellij.uiDesigner.componentTree.ComponentTree; //导入依赖的package包/类
public void dragExit(DropTargetEvent dte) {
  try {
    ComponentTree componentTree = DesignerToolWindowManager.getInstance(myEditor).getComponentTree();
    if (componentTree != null) {
      componentTree.setDropTargetComponent(null);
    }
    myUseDragDelta = false;
    if (myDraggedComponentList != null) {
      cancelDrag();
      setDraggingState(myDraggedComponentList, false);
      myEditor.getActiveDecorationLayer().removeFeedback();
      myDraggedComponentList = null;
      myEditor.setDesignTimeInsets(2);
    }
    myDraggedComponentsCopy = null;
  }
  catch (Exception e) {
    LOG.error(e);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:21,代码来源:DesignDropTargetListener.java

示例3: initToolWindow

import com.intellij.uiDesigner.componentTree.ComponentTree; //导入依赖的package包/类
private void initToolWindow() {
  myToolWindowPanel = new MyToolWindowPanel();
  myComponentTree = new ComponentTree(myProject);
  for (TreeSelectionListener listener : myPendingListeners) {
    myComponentTree.addTreeSelectionListener(listener);
  }
  myPendingListeners.clear();
  final JScrollPane scrollPane = ScrollPaneFactory.createScrollPane(myComponentTree);
  scrollPane.setBorder(IdeBorderFactory.createBorder(SideBorder.BOTTOM));
  scrollPane.setPreferredSize(new Dimension(250, -1));
  myComponentTree.initQuickFixManager(scrollPane.getViewport());
  myPropertyInspector= new PropertyInspector(myProject, myComponentTree);
  myToolWindowPanel.setFirstComponent(scrollPane);
  myToolWindowPanel.setSecondComponent(myPropertyInspector);
  myToolWindow = ToolWindowManager.getInstance(myProject).registerToolWindow(UIDesignerBundle.message("toolwindow.ui.designer"),
                                                                             myToolWindowPanel,
                                                                             ToolWindowAnchor.LEFT, myProject, true);
  myToolWindow.setIcon(UIDesignerIcons.ToolWindowUIDesigner);
  myToolWindow.setAvailable(false, null);
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:21,代码来源:UIDesignerToolWindowManager.java

示例4: dragExit

import com.intellij.uiDesigner.componentTree.ComponentTree; //导入依赖的package包/类
public void dragExit(DropTargetEvent dte)
{
	try
	{
		ComponentTree componentTree = DesignerToolWindowManager.getInstance(myEditor).getComponentTree();
		if(componentTree != null)
		{
			componentTree.setDropTargetComponent(null);
		}
		myUseDragDelta = false;
		if(myDraggedComponentList != null)
		{
			cancelDrag();
			setDraggingState(myDraggedComponentList, false);
			myEditor.getActiveDecorationLayer().removeFeedback();
			myDraggedComponentList = null;
			myEditor.setDesignTimeInsets(2);
		}
		myDraggedComponentsCopy = null;
	}
	catch(Exception e)
	{
		LOG.error(e);
	}
}
 
开发者ID:consulo,项目名称:consulo-ui-designer,代码行数:26,代码来源:DesignDropTargetListener.java

示例5: DesignerToolWindow

import com.intellij.uiDesigner.componentTree.ComponentTree; //导入依赖的package包/类
public DesignerToolWindow(Project project) {
  myComponentTree = new ComponentTree(project);

  JScrollPane scrollPane = ScrollPaneFactory.createScrollPane(myComponentTree);
  scrollPane.setBorder(IdeBorderFactory.createBorder(SideBorder.BOTTOM));
  scrollPane.setPreferredSize(new Dimension(250, -1));
  myComponentTree.initQuickFixManager(scrollPane.getViewport());

  myPropertyInspector = new PropertyInspector(project, myComponentTree);

  myToolWindowPanel.setFirstComponent(scrollPane);
  myToolWindowPanel.setSecondComponent(myPropertyInspector);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:14,代码来源:DesignerToolWindow.java

示例6: actionPerformed

import com.intellij.uiDesigner.componentTree.ComponentTree; //导入依赖的package包/类
protected void actionPerformed(final GuiEditor editor, final List<RadComponent> selection, final AnActionEvent e) {
  final ListPopup groupPopup = JBPopupFactory.getInstance()
    .createActionGroupPopup(UIDesignerBundle.message("surround.with.popup.title"), myActionGroup, e.getDataContext(),
                            JBPopupFactory.ActionSelectionAid.ALPHA_NUMBERING, true);

  final JComponent component = (JComponent)e.getData(PlatformDataKeys.CONTEXT_COMPONENT);
  if (component instanceof ComponentTree) {
    groupPopup.show(JBPopupFactory.getInstance().guessBestPopupLocation(component));
  }
  else {
    RadComponent selComponent = selection.get(0);
    FormEditingUtil.showPopupUnderComponent(groupPopup, selComponent);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:15,代码来源:SurroundPopupAction.java

示例7: getData

import com.intellij.uiDesigner.componentTree.ComponentTree; //导入依赖的package包/类
/**
 * Provides {@link PlatformDataKeys#NAVIGATABLE} to navigate to
 * binding of currently selected component (if any)
 */
public Object getData(final String dataId) {
  if(CommonDataKeys.NAVIGATABLE.is(dataId)) {
    final ComponentTree componentTree = DesignerToolWindowManager.getInstance(myEditor).getComponentTree();
    if (componentTree != null) {
      return componentTree.getData(dataId);
    }
  }
  return null;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:14,代码来源:GlassLayer.java

示例8: dragOver

import com.intellij.uiDesigner.componentTree.ComponentTree; //导入依赖的package包/类
public void dragOver(DropTargetDragEvent dtde) {
  try {
    if (myComponentDragObject == null) {
      dtde.rejectDrag();
      return;
    }
    final int dx = dtde.getLocation().x - myLastPoint.x;
    final int dy = dtde.getLocation().y - myLastPoint.y;

    if (myDraggedComponentsCopy != null && myDraggedComponentList != null) {
      for (RadComponent aMySelection : myDraggedComponentsCopy) {
        aMySelection.shift(dx, dy);
      }
    }

    myLastPoint = dtde.getLocation();
    myEditor.getDragLayer().repaint();

    ComponentDropLocation location = myGridInsertProcessor.processDragEvent(dtde.getLocation(), myComponentDragObject);
    ComponentTree componentTree = DesignerToolWindowManager.getInstance(myEditor).getComponentTree();

    if (!location.canDrop(myComponentDragObject) ||
        (myDraggedComponentList != null && FormEditingUtil.isDropOnChild(myDraggedComponentList, location))) {
      if (componentTree != null) {
        componentTree.setDropTargetComponent(null);
      }
      dtde.rejectDrag();
    }
    else {
      if (componentTree != null) {
        componentTree.setDropTargetComponent(location.getContainer());
      }
      dtde.acceptDrag(dtde.getDropAction());
    }
  }
  catch (Exception e) {
    LOG.error(e);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:40,代码来源:DesignDropTargetListener.java

示例9: refreshProperties

import com.intellij.uiDesigner.componentTree.ComponentTree; //导入依赖的package包/类
private void refreshProperties() {
  final Ref<Boolean> anythingModified = new Ref<Boolean>();
  FormEditingUtil.iterate(myRootContainer, new FormEditingUtil.ComponentVisitor() {
    public boolean visit(final IComponent component) {
      final RadComponent radComponent = (RadComponent)component;
      boolean componentModified = false;
      for (IProperty prop : component.getModifiedProperties()) {
        if (prop instanceof IntroStringProperty) {
          IntroStringProperty strProp = (IntroStringProperty)prop;
          componentModified = strProp.refreshValue(radComponent) || componentModified;
        }
      }

      if (component instanceof RadContainer) {
        componentModified = ((RadContainer)component).updateBorder() || componentModified;
      }

      if (component.getParentContainer() instanceof RadTabbedPane) {
        componentModified = ((RadTabbedPane)component.getParentContainer()).refreshChildTitle(radComponent) || componentModified;
      }
      if (componentModified) {
        anythingModified.set(Boolean.TRUE);
      }

      return true;
    }
  });
  if (!anythingModified.isNull()) {
    refresh();
    DesignerToolWindow designerToolWindow = DesignerToolWindowManager.getInstance(this);
    ComponentTree tree = designerToolWindow.getComponentTree();
    if (tree != null) tree.repaint();
    PropertyInspector inspector = designerToolWindow.getPropertyInspector();
    if (inspector != null) inspector.synchWithTree(true);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:37,代码来源:GuiEditor.java

示例10: getData

import com.intellij.uiDesigner.componentTree.ComponentTree; //导入依赖的package包/类
/**
 * Provides {@link PlatformDataKeys#NAVIGATABLE} to navigate to
 * binding of currently selected component (if any)
 */
public Object getData(final String dataId) {
  if(PlatformDataKeys.NAVIGATABLE.is(dataId)) {
    final ComponentTree componentTree = UIDesignerToolWindowManager.getInstance(myEditor.getProject()).getComponentTree();
    if (componentTree != null) {
      return componentTree.getData(dataId);
    }
  }
  return null;
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:14,代码来源:GlassLayer.java

示例11: DesignerToolWindow

import com.intellij.uiDesigner.componentTree.ComponentTree; //导入依赖的package包/类
public DesignerToolWindow(Project project)
{
	myComponentTree = new ComponentTree(project);

	JScrollPane scrollPane = ScrollPaneFactory.createScrollPane(myComponentTree);
	scrollPane.setBorder(IdeBorderFactory.createBorder(SideBorder.BOTTOM));
	scrollPane.setPreferredSize(new Dimension(250, -1));
	myComponentTree.initQuickFixManager(scrollPane.getViewport());

	myPropertyInspector = new PropertyInspector(project, myComponentTree);

	myToolWindowPanel.setFirstComponent(scrollPane);
	myToolWindowPanel.setSecondComponent(myPropertyInspector);
}
 
开发者ID:consulo,项目名称:consulo-ui-designer,代码行数:15,代码来源:DesignerToolWindow.java

示例12: getData

import com.intellij.uiDesigner.componentTree.ComponentTree; //导入依赖的package包/类
/**
 * Provides {@link PlatformDataKeys#NAVIGATABLE} to navigate to
 * binding of currently selected component (if any)
 */
@Override
public Object getData(@NotNull Key<?> dataId)
{
	if(CommonDataKeys.NAVIGATABLE == dataId)
	{
		final ComponentTree componentTree = DesignerToolWindowManager.getInstance(myEditor).getComponentTree();
		if(componentTree != null)
		{
			return componentTree.getData(dataId);
		}
	}
	return null;
}
 
开发者ID:consulo,项目名称:consulo-ui-designer,代码行数:18,代码来源:GlassLayer.java

示例13: PropertyInspector

import com.intellij.uiDesigner.componentTree.ComponentTree; //导入依赖的package包/类
public PropertyInspector(Project project, @NotNull final ComponentTree componentTree) {
  super(new CardLayout());

  myInspectorTable = new PropertyInspectorTable(project, componentTree);
  myComponentTree = componentTree;

  // Card with property inspector
  final JPanel inspectorCard = new JPanel(new GridBagLayout());
  final JScrollPane inspectorScrollPane = ScrollPaneFactory.createScrollPane(myInspectorTable);
  inspectorScrollPane.setBorder(IdeBorderFactory.createBorder(SideBorder.BOTTOM));
  inspectorCard.add(inspectorScrollPane,
    new GridBagConstraints(0, 0, 0, 1, 1, 1, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0)
  );
  final JCheckBox chkShowExpertProperties = new JCheckBox(UIDesignerBundle.message("chk.show.expert.properties"));
  inspectorCard.add(
    chkShowExpertProperties,
    new GridBagConstraints(0, 1, 1, 1, 1, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)
  );
  chkShowExpertProperties.addActionListener(
    new ActionListener() {
      public void actionPerformed(final ActionEvent e) {
        myInspectorTable.setShowExpertProperties(chkShowExpertProperties.isSelected());
      }
    }
  );
  add(inspectorCard, INSPECTOR_CARD);

  // Empty card
  final MultiLineLabel label = new MultiLineLabel(UIDesignerBundle.message("label.select.single.component.to.edit.its.properties")){
    public void updateUI() {
      super.updateUI();
      setBackground(myInspectorTable.getBackground());
    }
  };
  label.setOpaque(true);
  label.setHorizontalAlignment(SwingConstants.CENTER);
  add(label, EMPTY_CARD);
  add(myCustomPropertiesScrollPane, CUSTOM_CARD);

  myComponentSelectionListener = new MyComponentSelectionListener();
  synchWithTree(false);

  // Install light bulb
  myQuickFixManager = new QuickFixManagerImpl(null, myInspectorTable, inspectorScrollPane.getViewport());

  myCustomPropertiesChangeListener = new ChangeListener() {
    public void stateChanged(ChangeEvent e) {
      if (myPropertiesPanelContainer != null) {
        myPropertiesPanelContainer.revalidate();
      }
      if (myEditor.ensureEditable()) {
        myEditor.refreshAndSave(true);
      }
    }
  };
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:57,代码来源:PropertyInspector.java

示例14: getComponentTree

import com.intellij.uiDesigner.componentTree.ComponentTree; //导入依赖的package包/类
public ComponentTree getComponentTree() {
  return myComponentTree;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:4,代码来源:DesignerToolWindow.java

示例15: drop

import com.intellij.uiDesigner.componentTree.ComponentTree; //导入依赖的package包/类
public void drop(final DropTargetDropEvent dtde) {
  try {
    ComponentTree componentTree = DesignerToolWindowManager.getInstance(myEditor).getComponentTree();
    if (componentTree != null) {
      componentTree.setDropTargetComponent(null);
    }


    final DraggedComponentList dcl = DraggedComponentList.fromTransferable(dtde.getTransferable());
    if (dcl != null) {
      CommandProcessor.getInstance().executeCommand(myEditor.getProject(),
                                                    new Runnable() {
                                                      public void run() {
                                                        if (processDrop(dcl, dtde.getLocation(), dtde.getDropAction())) {
                                                          myEditor.refreshAndSave(true);
                                                        }
                                                      }
                                                    }, UIDesignerBundle.message("command.drop.components"), null);
    }
    else {
      ComponentItem componentItem = SimpleTransferable.getData(dtde.getTransferable(), ComponentItem.class);
      if (componentItem != null) {
        myEditor.getMainProcessor().setInsertFeedbackEnabled(false);
        new InsertComponentProcessor(myEditor).processComponentInsert(dtde.getLocation(), componentItem);
        ApplicationManager.getApplication().invokeLater(new Runnable() {
          public void run() {
            PaletteToolWindowManager.getInstance(myEditor).clearActiveItem();
            myEditor.getActiveDecorationLayer().removeFeedback();
            myEditor.getLayeredPane().setCursor(null);
            myEditor.getGlassLayer().requestFocus();
            myEditor.getMainProcessor().setInsertFeedbackEnabled(true);
          }
        });
      }
    }
    myDraggedComponentsCopy = null;
    myEditor.repaintLayeredPane();
  }
  catch (Exception e) {
    LOG.error(e);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:43,代码来源:DesignDropTargetListener.java


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