public ArrangementGroupingRulesControl(@NotNull ArrangementStandardSettingsManager settingsManager, @NotNull ArrangementColorsProvider colorsProvider) { super(new DefaultTableModel(0, 1)); mySettingsManager = settingsManager; setDefaultRenderer(Object.class, new MyRenderer()); getColumnModel().getColumn(0).setCellEditor(new MyEditor()); setShowColumns(false); setShowGrid(false); setBorder(IdeBorderFactory.createBorder()); setSelectionMode(ListSelectionModel.SINGLE_SELECTION); putClientProperty("terminateEditOnFocusLost", Boolean.TRUE); List<CompositeArrangementSettingsToken> groupingTokens = settingsManager.getSupportedGroupingTokens(); if (groupingTokens != null) { for (CompositeArrangementSettingsToken token : groupingTokens) { ArrangementGroupingComponent component = new ArrangementGroupingComponent(token, colorsProvider, settingsManager); myComponents.put(token.getToken(), component); getModel().addRow(new Object[]{component}); } } }
public ArrangementGroupingRulesControl(@Nonnull ArrangementStandardSettingsManager settingsManager, @Nonnull ArrangementColorsProvider colorsProvider) { super(new DefaultTableModel(0, 1)); mySettingsManager = settingsManager; setDefaultRenderer(Object.class, new MyRenderer()); getColumnModel().getColumn(0).setCellEditor(new MyEditor()); setShowColumns(false); setShowGrid(false); setBorder(IdeBorderFactory.createBorder()); setSelectionMode(ListSelectionModel.SINGLE_SELECTION); putClientProperty("terminateEditOnFocusLost", Boolean.TRUE); List<CompositeArrangementSettingsToken> groupingTokens = settingsManager.getSupportedGroupingTokens(); if (groupingTokens != null) { for (CompositeArrangementSettingsToken token : groupingTokens) { ArrangementGroupingComponent component = new ArrangementGroupingComponent(token, colorsProvider, settingsManager); myComponents.put(token.getToken(), component); getModel().addRow(new Object[]{component}); } } }
private ArrangementSectionRuleManager(@NotNull Language language, @NotNull ArrangementStandardSettingsManager settingsManager, @NotNull ArrangementColorsProvider colorsProvider, @NotNull ArrangementSectionRulesControl control) { myCommenter = LanguageCommenters.INSTANCE.forLanguage(language); myControl = control; final List<CompositeArrangementSettingsToken> tokens = ContainerUtil.newArrayList(); tokens.add(new CompositeArrangementSettingsToken(TYPE, ContainerUtil.newArrayList(START_SECTION, END_SECTION))); tokens.add(new CompositeArrangementSettingsToken(TEXT)); myEditor = new ArrangementMatchingRuleEditor(settingsManager, tokens, colorsProvider, control); }
private ArrangementSectionRuleManager(@Nonnull Language language, @Nonnull ArrangementStandardSettingsManager settingsManager, @Nonnull ArrangementColorsProvider colorsProvider, @Nonnull ArrangementMatchingRulesControl control) { myCommenter = LanguageCommenters.INSTANCE.forLanguage(language); myControl = control; final List<CompositeArrangementSettingsToken> tokens = ContainerUtil.newArrayList(); tokens.add(new CompositeArrangementSettingsToken(TYPE, ContainerUtil.newArrayList(START_SECTION, END_SECTION))); tokens.add(new CompositeArrangementSettingsToken(TEXT)); myEditor = new ArrangementMatchingRuleEditor(settingsManager, tokens, colorsProvider, control); }
@Nullable @Override public List<CompositeArrangementSettingsToken> getSupportedMatchingTokens() { return ContainerUtilRt.newArrayList(new CompositeArrangementSettingsToken(TYPE, SUPPORTED_TYPES), new CompositeArrangementSettingsToken(StdArrangementTokens.Regexp.NAME), new CompositeArrangementSettingsToken(StdArrangementTokens .Regexp.XML_NAMESPACE), new CompositeArrangementSettingsToken(ORDER, KEEP, BY_NAME)); }
@Nullable @Override public List<CompositeArrangementSettingsToken> getSupportedGroupingTokens() { return ContainerUtilRt.newArrayList(new CompositeArrangementSettingsToken(GETTERS_AND_SETTERS), new CompositeArrangementSettingsToken(OVERRIDDEN_METHODS, BY_NAME, KEEP), new CompositeArrangementSettingsToken(DEPENDENT_METHODS, BREADTH_FIRST, DEPTH_FIRST)); }
@Nullable @Override public List<CompositeArrangementSettingsToken> getSupportedMatchingTokens() { return ContainerUtilRt.newArrayList(new CompositeArrangementSettingsToken(TYPE, SUPPORTED_TYPES), new CompositeArrangementSettingsToken(MODIFIER, SUPPORTED_MODIFIERS), new CompositeArrangementSettingsToken(StdArrangementTokens .Regexp.NAME), new CompositeArrangementSettingsToken(ORDER, KEEP, BY_NAME)); }
private void buildWeights(@NotNull Collection<CompositeArrangementSettingsToken> compositeTokens) { for (CompositeArrangementSettingsToken token : compositeTokens) { myWeights.put(token.getToken(), myWeights.size()); buildWeights(token.getChildren()); } }
/** * @see ArrangementStandardSettingsAware#getSupportedGroupingTokens() */ @Nullable public List<CompositeArrangementSettingsToken> getSupportedGroupingTokens() { return myGroupingTokens; }
/** * @see ArrangementStandardSettingsAware#getSupportedMatchingTokens() */ @Nullable public List<CompositeArrangementSettingsToken> getSupportedMatchingTokens() { return myMatchingTokens; }
@Nullable @Override public List<CompositeArrangementSettingsToken> getSupportedGroupingTokens() { return null; }