Java 类com.intellij.uiDesigner.componentTree.ComponentPtr 实例源码

项目:consulo-ui-designer    文件:ExpandSelectionAction.java   
@Override
public void update(final AnActionEvent e)
{
    final Presentation presentation = e.getPresentation();
    final GuiEditor editor = FormEditingUtil.getEditorFromContext(e.getDataContext());

    if(editor == null)
    {
        presentation.setEnabled(false);
        return;
    }

    final SelectionState selectionState = editor.getSelectionState();
    selectionState.setInsideChange(true);
    final Stack<ComponentPtr[]> history = selectionState.getSelectionHistory();

    presentation.setEnabled(!history.isEmpty());
}
项目:intellij-ce-playground    文件:SelectionState.java   
public static ComponentPtr[] getSelection(final GuiEditor editor){
  final ArrayList<RadComponent> selection = FormEditingUtil.getAllSelectedComponents(editor);
  final ComponentPtr[] ptrs = new ComponentPtr[selection.size()];
  for(int i = selection.size() - 1; i >= 0; i--){
    ptrs[i] = new ComponentPtr(editor, selection.get(i));
  }
  return ptrs;
}
项目:intellij-ce-playground    文件:SelectionState.java   
public static void restoreSelection(final GuiEditor editor, final ComponentPtr[] ptrs) {
  FormEditingUtil.clearSelection(editor.getRootContainer());
  for(int i = ptrs.length - 1; i >= 0; i--){
    final ComponentPtr ptr = ptrs[i];
    ptr.validate();
    if(ptr.isValid()){
      ptr.getComponent().setSelected(true);
    }
  }
}
项目:intellij-ce-playground    文件:ExpandSelectionAction.java   
public void update(final AnActionEvent e) {
  final Presentation presentation = e.getPresentation();
  final GuiEditor editor = FormEditingUtil.getEditorFromContext(e.getDataContext());

  if(editor == null){
    presentation.setEnabled(false);
    return;
  }

  final SelectionState selectionState = editor.getSelectionState();
  selectionState.setInsideChange(true);
  final Stack<ComponentPtr[]> history = selectionState.getSelectionHistory();

  presentation.setEnabled(!history.isEmpty());
}
项目:intellij-ce-playground    文件:ShrinkSelectionAction.java   
public void update(final AnActionEvent e) {
  final Presentation presentation = e.getPresentation();
  final GuiEditor editor = FormEditingUtil.getEditorFromContext(e.getDataContext());
  if(editor == null){
    presentation.setEnabled(false);
    return;
  }

  final Stack<ComponentPtr[]> history = editor.getSelectionState().getSelectionHistory();
  presentation.setEnabled(history.size() > 1);
}
项目:tools-idea    文件:SelectionState.java   
public static ComponentPtr[] getSelection(final GuiEditor editor){
  final ArrayList<RadComponent> selection = FormEditingUtil.getAllSelectedComponents(editor);
  final ComponentPtr[] ptrs = new ComponentPtr[selection.size()];
  for(int i = selection.size() - 1; i >= 0; i--){
    ptrs[i] = new ComponentPtr(editor, selection.get(i));
  }
  return ptrs;
}
项目:tools-idea    文件:SelectionState.java   
public static void restoreSelection(final GuiEditor editor, final ComponentPtr[] ptrs) {
  FormEditingUtil.clearSelection(editor.getRootContainer());
  for(int i = ptrs.length - 1; i >= 0; i--){
    final ComponentPtr ptr = ptrs[i];
    ptr.validate();
    if(ptr.isValid()){
      ptr.getComponent().setSelected(true);
    }
  }
}
项目:tools-idea    文件:ExpandSelectionAction.java   
public void update(final AnActionEvent e) {
  final Presentation presentation = e.getPresentation();
  final GuiEditor editor = FormEditingUtil.getEditorFromContext(e.getDataContext());

  if(editor == null){
    presentation.setEnabled(false);
    return;
  }

  final SelectionState selectionState = editor.getSelectionState();
  selectionState.setInsideChange(true);
  final Stack<ComponentPtr[]> history = selectionState.getSelectionHistory();

  presentation.setEnabled(!history.isEmpty());
}
项目:tools-idea    文件:ShrinkSelectionAction.java   
public void update(final AnActionEvent e) {
  final Presentation presentation = e.getPresentation();
  final GuiEditor editor = FormEditingUtil.getEditorFromContext(e.getDataContext());
  if(editor == null){
    presentation.setEnabled(false);
    return;
  }

  final Stack<ComponentPtr[]> history = editor.getSelectionState().getSelectionHistory();
  presentation.setEnabled(history.size() > 1);
}
项目:consulo-ui-designer    文件:SelectionState.java   
public static ComponentPtr[] getSelection(final GuiEditor editor){
  final ArrayList<RadComponent> selection = FormEditingUtil.getAllSelectedComponents(editor);
  final ComponentPtr[] ptrs = new ComponentPtr[selection.size()];
  for(int i = selection.size() - 1; i >= 0; i--){
    ptrs[i] = new ComponentPtr(editor, selection.get(i));
  }
  return ptrs;
}
项目:consulo-ui-designer    文件:SelectionState.java   
public static void restoreSelection(final GuiEditor editor, final ComponentPtr[] ptrs) {
  FormEditingUtil.clearSelection(editor.getRootContainer());
  for(int i = ptrs.length - 1; i >= 0; i--){
    final ComponentPtr ptr = ptrs[i];
    ptr.validate();
    if(ptr.isValid()){
      ptr.getComponent().setSelected(true);
    }
  }
}
项目:consulo-ui-designer    文件:ShrinkSelectionAction.java   
@Override
public void update(final AnActionEvent e)
{
    final Presentation presentation = e.getPresentation();
    final GuiEditor editor = FormEditingUtil.getEditorFromContext(e.getDataContext());
    if(editor == null)
    {
        presentation.setEnabled(false);
        return;
    }

    final Stack<ComponentPtr[]> history = editor.getSelectionState().getSelectionHistory();
    presentation.setEnabled(history.size() > 1);
}
项目:intellij-ce-playground    文件:SelectionState.java   
public SelectionState(@NotNull final GuiEditor editor) {
  mySelectionHistory = new Stack<ComponentPtr[]>();
  editor.addComponentSelectionListener(new MyComponentSelectionListener());
}
项目:intellij-ce-playground    文件:SelectionState.java   
public Stack<ComponentPtr[]> getSelectionHistory() {
  return mySelectionHistory;
}
项目:intellij-ce-playground    文件:GuiEditor.java   
public void setSelectionAnchor(final RadComponent component) {
  mySelectionAnchor = new ComponentPtr(this, component);
}
项目:intellij-ce-playground    文件:GuiEditor.java   
public void setSelectionLead(final RadComponent component) {
  mySelectionLead = new ComponentPtr(this, component);
}
项目:tools-idea    文件:SelectionState.java   
public SelectionState(@NotNull final GuiEditor editor) {
  mySelectionHistory = new Stack<ComponentPtr[]>();
  editor.addComponentSelectionListener(new MyComponentSelectionListener());
}
项目:tools-idea    文件:SelectionState.java   
public Stack<ComponentPtr[]> getSelectionHistory() {
  return mySelectionHistory;
}
项目:tools-idea    文件:GuiEditor.java   
public void setSelectionAnchor(final RadComponent component) {
  mySelectionAnchor = new ComponentPtr(this, component);
}
项目:tools-idea    文件:GuiEditor.java   
public void setSelectionLead(final RadComponent component) {
  mySelectionLead = new ComponentPtr(this, component);
}
项目:consulo-ui-designer    文件:SelectionState.java   
public SelectionState(@NotNull final GuiEditor editor) {
  mySelectionHistory = new Stack<ComponentPtr[]>();
  editor.addComponentSelectionListener(new MyComponentSelectionListener());
}
项目:consulo-ui-designer    文件:SelectionState.java   
public Stack<ComponentPtr[]> getSelectionHistory() {
  return mySelectionHistory;
}
项目:consulo-ui-designer    文件:GuiEditor.java   
public void setSelectionAnchor(final RadComponent component)
{
    mySelectionAnchor = new ComponentPtr(this, component);
}
项目:consulo-ui-designer    文件:GuiEditor.java   
public void setSelectionLead(final RadComponent component)
{
    mySelectionLead = new ComponentPtr(this, component);
}