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


Java ElementsChooser类代码示例

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


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

示例1: init

import com.intellij.ide.util.ElementsChooser; //导入依赖的package包/类
@Override
protected void init() {
    this.fileChooser.addElementsMarkListener((ElementsChooser.ElementsMarkListener<HybrisModuleDescriptor>) (element, isMarked) -> {
        if (isMarked) {
            for (HybrisModuleDescriptor moduleDescriptor : element.getDependenciesPlainList()) {
                if (fileChooser.isElementMarked(moduleDescriptor)) {
                    continue;
                }

                fileChooser.setElementMarked(moduleDescriptor, true);
                if (selectionMode == MANDATORY) {
                    moduleDescriptor.setImportStatus(MANDATORY);
                }
            }
        }
        fileChooser.repaint();
    });
}
 
开发者ID:AlexanderBartash,项目名称:hybris-integration-intellij-idea-plugin,代码行数:19,代码来源:SelectHybrisModulesToImportStep.java

示例2: setupRenderersList

import com.intellij.ide.util.ElementsChooser; //导入依赖的package包/类
private void setupRenderersList() {
  myRendererChooser.getEmptyText().setText(DebuggerBundle.message("text.user.renderers.configurable.no.renderers"));

  myRendererChooser.addElementsMarkListener(new ElementsChooser.ElementsMarkListener<NodeRenderer>() {
    @Override
    public void elementMarkChanged(final NodeRenderer element, final boolean isMarked) {
      element.setEnabled(isMarked);
    }
  });
  myRendererChooser.addListSelectionListener(new ListSelectionListener() {
    @Override
    public void valueChanged(@NotNull ListSelectionEvent e) {
      if (!e.getValueIsAdjusting()) {
        updateCurrentRenderer(myRendererChooser.getSelectedElements());
      }
    }
  });
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:UserRenderersConfigurable.java

示例3: PyChooseRequirementsDialog

import com.intellij.ide.util.ElementsChooser; //导入依赖的package包/类
public PyChooseRequirementsDialog(@NotNull Project project, @NotNull List<PyRequirement> requirements) {
  super(project, false);
  setTitle("Choose Packages to Install");
  setOKButtonText("Install");
  myRequirementsChooser = new ElementsChooser<PyRequirement>(true) {
    @Override
    public String getItemText(@NotNull PyRequirement requirement) {
      return requirement.toString();
    }
  };
  myRequirementsChooser.setElements(requirements, true);
  myRequirementsChooser.addElementsMarkListener(new ElementsChooser.ElementsMarkListener<PyRequirement>() {
    @Override
    public void elementMarkChanged(PyRequirement element, boolean isMarked) {
      setOKActionEnabled(!myRequirementsChooser.getMarkedElements().isEmpty());
    }
  });
  init();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:PyChooseRequirementsDialog.java

示例4: ImportSourceRootsDialog

import com.intellij.ide.util.ElementsChooser; //导入依赖的package包/类
public ImportSourceRootsDialog(@NotNull Project project, @NotNull List<JavaModuleSourceRoot> sourceRoots) {
  super(project, false);

  setTitle(AndroidBundle.message("android.import.dependencies.source.roots.dialog.title"));

  mySourcePathsChooser = new ElementsChooser<JavaModuleSourceRoot>(true) {
    @Override
    public String getItemText(@NotNull JavaModuleSourceRoot sourceRoot) {
      final String packagePrefix = sourceRoot.getPackagePrefix();
      final String path = sourceRoot.getDirectory().getAbsolutePath();
      return packagePrefix.length() > 0 ? path + " (" + packagePrefix + ")" : path;
    }
  };
  mySourcePathsChooser.setElements(sourceRoots, true);

  init();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:ImportSourceRootsDialog.java

示例5: initBranchChooser

import com.intellij.ide.util.ElementsChooser; //导入依赖的package包/类
private void initBranchChooser() {
  myBranchChooser = new ElementsChooser<String>(true);
  myBranchChooser.setToolTipText(GitBundle.getString("merge.branches.tooltip"));
  GridBagConstraints c = new GridBagConstraints();
  c.insets = new Insets(0, 0, 0, 0);
  c.gridx = 0;
  c.gridy = 0;
  c.weightx = 1;
  c.weighty = 1;
  c.fill = GridBagConstraints.BOTH;
  myBranchToMergeContainer.add(myBranchChooser, c);
  GitMergeUtil.setupStrategies(myBranchChooser, myStrategy);
  final ElementsChooser.ElementsMarkListener<String> listener = new ElementsChooser.ElementsMarkListener<String>() {
    public void elementMarkChanged(final String element, final boolean isMarked) {
      setOKActionEnabled(myBranchChooser.getMarkedElements().size() != 0);
    }
  };
  listener.elementMarkChanged(null, true);
  myBranchChooser.addElementsMarkListener(listener);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:21,代码来源:GitMergeDialog.java

示例6: createRenderersList

import com.intellij.ide.util.ElementsChooser; //导入依赖的package包/类
private JComponent createRenderersList() {
  myRendererChooser = new ElementsChooser<NodeRenderer>(true);
  myRendererChooser.getEmptyText().setText(DebuggerBundle.message("text.user.renderers.configurable.no.renderers"));

  myRendererChooser.addElementsMarkListener(new ElementsChooser.ElementsMarkListener<NodeRenderer>() {
    public void elementMarkChanged(final NodeRenderer element, final boolean isMarked) {
      element.setEnabled(isMarked);
    }
  });
  myRendererChooser.addListSelectionListener(new ListSelectionListener() {
    public void valueChanged(ListSelectionEvent e) {
      if (!e.getValueIsAdjusting()) {
        updateCurrentRenderer(myRendererChooser.getSelectedElements());
      }
    }
  });
  return myRendererChooser;
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:19,代码来源:UserRenderersConfigurable.java

示例7: initBranchChooser

import com.intellij.ide.util.ElementsChooser; //导入依赖的package包/类
/**
 * Initialize {@link #myBranchChooser} component
 */
private void initBranchChooser() {
  myBranchChooser = new ElementsChooser<String>(true);
  myBranchChooser.setToolTipText(GitBundle.getString("merge.branches.tooltip"));
  GridBagConstraints c = new GridBagConstraints();
  c.insets = new Insets(0, 0, 0, 0);
  c.gridx = 0;
  c.gridy = 0;
  c.weightx = 1;
  c.weighty = 1;
  c.fill = GridBagConstraints.BOTH;
  myBranchToMergeContainer.add(myBranchChooser, c);
  GitMergeUtil.setupStrategies(myBranchChooser, myStrategy);
  final ElementsChooser.ElementsMarkListener<String> listener = new ElementsChooser.ElementsMarkListener<String>() {
    public void elementMarkChanged(final String element, final boolean isMarked) {
      setOKActionEnabled(myBranchChooser.getMarkedElements().size() != 0);
    }
  };
  listener.elementMarkChanged(null, true);
  myBranchChooser.addElementsMarkListener(listener);
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:24,代码来源:GitMergeDialog.java

示例8: setupRenderersList

import com.intellij.ide.util.ElementsChooser; //导入依赖的package包/类
private void setupRenderersList()
{
	myRendererChooser.getEmptyText().setText(DebuggerBundle.message("text.user.renderers.configurable.no.renderers"));

	myRendererChooser.addElementsMarkListener(new ElementsChooser.ElementsMarkListener<NodeRenderer>()
	{
		@Override
		public void elementMarkChanged(final NodeRenderer element, final boolean isMarked)
		{
			element.setEnabled(isMarked);
		}
	});
	myRendererChooser.addListSelectionListener(new ListSelectionListener()
	{
		@Override
		public void valueChanged(@NotNull ListSelectionEvent e)
		{
			if(!e.getValueIsAdjusting())
			{
				updateCurrentRenderer(myRendererChooser.getSelectedElements());
			}
		}
	});
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:25,代码来源:UserRenderersConfigurable.java

示例9: RunHotswapDialog

import com.intellij.ide.util.ElementsChooser; //导入依赖的package包/类
public RunHotswapDialog(Project project, List<DebuggerSession> sessions, boolean displayHangWarning) {
  super(project);
  myDisplayHangWarning = displayHangWarning;
  myPanel = new JPanel(new BorderLayout());
  final List<SessionItem> items = new ArrayList<SessionItem>(sessions.size());
  for (DebuggerSession session : sessions) {
    items.add(new SessionItem(session));
  }
  Collections.sort(items, new Comparator<SessionItem>() {
    public int compare(SessionItem debuggerSession, SessionItem debuggerSession1) {
      return debuggerSession.getSession().getSessionName().compareTo(debuggerSession1.getSession().getSessionName());
    }
  });
  myElementsChooser = new ElementsChooser<SessionItem>(items, true);
  myPanel.setBorder(IdeBorderFactory.createEmptyBorder(10, 0, 5, 0));
  //myElementsChooser.setBorder(IdeBorderFactory.createEmptyBorder(5, 0, 0, 0));
  if (sessions.size() > 0) {
    myElementsChooser.selectElements(items.subList(0, 1));
  }
  myPanel.add(myElementsChooser, BorderLayout.CENTER);
  //myPanel.add(new JLabel("Choose debug sessions to reload classes:"), BorderLayout.NORTH);
  if(sessions.size() == 1) {
    setTitle(DebuggerBundle.message("hotswap.dialog.title.with.session", sessions.get(0).getSessionName()));
    myPanel.setVisible(false);
  }
  else {
    setTitle(DebuggerBundle.message("hotswap.dialog.title"));
  }
  setButtonsAlignment(SwingUtilities.CENTER);
  this.init();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:32,代码来源:RunHotswapDialog.java

示例10: UserRenderersConfigurable

import com.intellij.ide.util.ElementsChooser; //导入依赖的package包/类
public UserRenderersConfigurable() {
  super(new BorderLayout(4, 0));

  myRendererChooser = new ElementsChooser<NodeRenderer>(true);
  setupRenderersList();

  ToolbarDecorator decorator = ToolbarDecorator.createDecorator((JTable)myRendererChooser.getComponent());
  decorator.setToolbarPosition(ActionToolbarPosition.TOP);
  decorator.setAddAction(new AddAction());
  decorator.setRemoveAction(new RemoveAction());
  decorator.setMoveUpAction(new MoveAction(true));
  decorator.setMoveDownAction(new MoveAction(false));
  decorator.addExtraAction(new CopyAction());

  myNameField = new JTextField();
  myNameFieldPanel = new JPanel(new BorderLayout());
  myNameFieldPanel.add(new JLabel(DebuggerBundle.message("label.user.renderers.configurable.renderer.name")), BorderLayout.WEST);
  myNameFieldPanel.add(myNameField, BorderLayout.CENTER);
  myNameFieldPanel.setVisible(false);

  final JPanel center = new JPanel(new BorderLayout(0, 4));
  center.add(myNameFieldPanel, BorderLayout.NORTH);
  center.add(myRendererDataConfigurable, BorderLayout.CENTER);

  myNameField.getDocument().addDocumentListener(new DocumentAdapter() {
    @Override
    protected void textChanged(DocumentEvent e) {
      if (myCurrentRenderer != null) {
        myCurrentRenderer.setName(myNameField.getText());
        myRendererChooser.refresh(myCurrentRenderer);
      }
    }
  });

  Splitter splitter = new Splitter(false);
  splitter.setProportion(0.3f);
  splitter.setFirstComponent(decorator.createPanel());
  splitter.setSecondComponent(center);
  add(splitter, BorderLayout.CENTER);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:41,代码来源:UserRenderersConfigurable.java

示例11: SplitDialog

import com.intellij.ide.util.ElementsChooser; //导入依赖的package包/类
private SplitDialog(final Collection<File> files) {
  super(myEntriesChooser, true);
  setTitle("Split " + StringUtil.capitalize(getElementTypeName()));

  myNameField = new JTextField();
  myChooser = new ElementsChooser<File>(true) {
    protected String getItemText(@NotNull final File value) {
      return getElementText(value);
    }
  };
  for (final File file : files) {
    myChooser.addElement(file, false, new ElementsChooser.ElementProperties() {
      public Icon getIcon() {
        return getElementIcon(file);
      }
      public Color getColor() {
        return null;
      }
    });
  }
  myChooser.selectElements(ContainerUtil.createMaybeSingletonList(ContainerUtil.getFirstItem(files)));
  myChooser.addElementsMarkListener(new ElementsChooser.ElementsMarkListener<File>() {
    @Override
    public void elementMarkChanged(File element, boolean isMarked) {
      updateOkButton();
    }
  });
  myNameField.getDocument().addDocumentListener(new DocumentAdapter() {
    @Override
    protected void textChanged(DocumentEvent e) {
      updateOkButton();
    }
  });

  init();
  updateOkButton();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:38,代码来源:ProjectLayoutPanel.java

示例12: createUIComponents

import com.intellij.ide.util.ElementsChooser; //导入依赖的package包/类
private void createUIComponents() {
  myValidators = new ElementsChooser<Compiler>(true) {
    @Override
    protected String getItemText(@NotNull final Compiler validator) {
      final String description = validator.getDescription();
      return description.replace(" Validator", "").replace(" validator", "");
    }
  };
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:ValidationConfigurable.java

示例13: setElements

import com.intellij.ide.util.ElementsChooser; //导入依赖的package包/类
public static <E> void setElements(ElementsChooser<E> chooser, Collection<E> all, Collection<E> selected, Comparator<E> comparator) {
  List<E> selection = chooser.getSelectedElements();
  chooser.clear();
  Collection<E> sorted = new TreeSet<E>(comparator);
  sorted.addAll(all);
  for (E element : sorted) {
    chooser.addElement(element, selected.contains(element));
  }
  chooser.selectElements(selection);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:ExternalSystemActionUtil.java

示例14: SelectEclipseImportedProjectsStep

import com.intellij.ide.util.ElementsChooser; //导入依赖的package包/类
public SelectEclipseImportedProjectsStep(WizardContext context) {
  super(context);
  fileChooser.addElementsMarkListener(new ElementsChooser.ElementsMarkListener<String>() {
    public void elementMarkChanged(final String element, final boolean isMarked) {
      duplicateNames = null;
      fileChooser.repaint();
    }
  });
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:SelectEclipseImportedProjectsStep.java

示例15: createUIComponents

import com.intellij.ide.util.ElementsChooser; //导入依赖的package包/类
private void createUIComponents() {
  moduleChooser = new ElementsChooser<Module>(true) {
    protected String getItemText(@NotNull final Module module) {
      return module.getName();
    }
  };
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:ExportEclipseProjectsDialog.java


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