mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
@Override
This commit is contained in:
@@ -31,6 +31,7 @@ public class IndentOptionsEditor extends OptionGroup {
|
||||
protected JLabel myTabSizeLabel;
|
||||
protected JLabel myIndentLabel;
|
||||
|
||||
@Override
|
||||
public JPanel createPanel() {
|
||||
addComponents();
|
||||
|
||||
|
||||
@@ -31,6 +31,7 @@ public class SmartIndentOptionsEditor extends IndentOptionsEditor {
|
||||
private JTextField myContinuationIndentField;
|
||||
private JLabel myContinuationIndentLabel;
|
||||
|
||||
@Override
|
||||
protected void addTabOptions() {
|
||||
super.addTabOptions();
|
||||
|
||||
@@ -38,6 +39,7 @@ public class SmartIndentOptionsEditor extends IndentOptionsEditor {
|
||||
add(myCbSmartTabs, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void addComponents() {
|
||||
super.addComponents();
|
||||
|
||||
@@ -46,6 +48,7 @@ public class SmartIndentOptionsEditor extends IndentOptionsEditor {
|
||||
add(myContinuationIndentLabel, myContinuationIndentField);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isModified(final CodeStyleSettings settings, final CommonCodeStyleSettings.IndentOptions options) {
|
||||
boolean isModified = super.isModified(settings, options);
|
||||
isModified |= isFieldModified(myCbSmartTabs, options.SMART_TABS);
|
||||
@@ -53,18 +56,21 @@ public class SmartIndentOptionsEditor extends IndentOptionsEditor {
|
||||
return isModified;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void apply(final CodeStyleSettings settings, final CommonCodeStyleSettings.IndentOptions options) {
|
||||
super.apply(settings, options);
|
||||
options.CONTINUATION_INDENT_SIZE = getFieldValue(myContinuationIndentField, 0, options.CONTINUATION_INDENT_SIZE);
|
||||
options.SMART_TABS = isSmartTabValid(options.INDENT_SIZE, options.TAB_SIZE) && myCbSmartTabs.isSelected();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void reset(@NotNull final CodeStyleSettings settings, @NotNull final CommonCodeStyleSettings.IndentOptions options) {
|
||||
super.reset(settings, options);
|
||||
myContinuationIndentField.setText(String.valueOf(options.CONTINUATION_INDENT_SIZE));
|
||||
myCbSmartTabs.setSelected(options.SMART_TABS);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setEnabled(final boolean enabled) {
|
||||
super.setEnabled(enabled);
|
||||
|
||||
|
||||
@@ -41,6 +41,7 @@ public class CharTailType extends TailType {
|
||||
return !context.shouldAddCompletionChar() || context.getCompletionChar() != myChar;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int processTail(final Editor editor, final int tailOffset) {
|
||||
return insertChar(editor, tailOffset, myChar, myOverwrite);
|
||||
}
|
||||
|
||||
@@ -116,6 +116,7 @@ public class PsiEquivalenceUtil {
|
||||
final List<Pair<PsiElement, PsiElement>> result,
|
||||
PsiElement scope) {
|
||||
findChildRangeDuplicates(first, last, scope, new PairConsumer<PsiElement, PsiElement>() {
|
||||
@Override
|
||||
public void consume(final PsiElement start, final PsiElement end) {
|
||||
result.add(new Pair<PsiElement, PsiElement>(start, end));
|
||||
}
|
||||
|
||||
@@ -57,6 +57,7 @@ public abstract class TailType {
|
||||
}
|
||||
|
||||
public static final TailType UNKNOWN = new TailType(){
|
||||
@Override
|
||||
public int processTail(final Editor editor, final int tailOffset) {
|
||||
return tailOffset;
|
||||
}
|
||||
@@ -68,6 +69,7 @@ public abstract class TailType {
|
||||
};
|
||||
|
||||
public static final TailType NONE = new TailType(){
|
||||
@Override
|
||||
public int processTail(final Editor editor, final int tailOffset) {
|
||||
return tailOffset;
|
||||
}
|
||||
@@ -81,6 +83,7 @@ public abstract class TailType {
|
||||
@Deprecated public static final TailType EXCLAMATION = new CharTailType('!');
|
||||
|
||||
public static final TailType COMMA = new TailType(){
|
||||
@Override
|
||||
public int processTail(final Editor editor, int tailOffset) {
|
||||
CommonCodeStyleSettings styleSettings = getLocalCodeStyleSettings(editor, tailOffset);
|
||||
if (styleSettings.SPACE_BEFORE_COMMA) tailOffset = insertChar(editor, tailOffset, ' ');
|
||||
@@ -149,6 +152,7 @@ public abstract class TailType {
|
||||
|
||||
public static final TailType CASE_COLON = new CharTailType(':');
|
||||
public static final TailType COND_EXPR_COLON = new TailType(){
|
||||
@Override
|
||||
public int processTail(final Editor editor, final int tailOffset) {
|
||||
Document document = editor.getDocument();
|
||||
int textLength = document.getTextLength();
|
||||
@@ -177,6 +181,7 @@ public abstract class TailType {
|
||||
return CodeStyleSettingsManager.getSettings(editor.getProject()).SPACE_AROUND_ASSIGNMENT_OPERATORS;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int processTail(final Editor editor, int tailOffset) {
|
||||
Document document = editor.getDocument();
|
||||
int textLength = document.getTextLength();
|
||||
|
||||
+4
-2
@@ -62,7 +62,7 @@ import java.util.List;
|
||||
* Most often this string is an identifier (see {@link com.intellij.codeInsight.completion.CompletionInitializationContext#DUMMY_IDENTIFIER}).
|
||||
* This is usually done to guarantee that there'll always be some non-empty element there, which will be easy to describe via {@link ElementPattern}s.
|
||||
* Also a reference can suddenly appear in that position, which will certainly help invoking its {@link PsiReference#getVariants()}.
|
||||
* Dummy identifier string can be easily changed in {@link #beforeCompletion(CompletionInitializationContext)} method.<p>
|
||||
* Dummy identifier string can be easily changed in {@link #beforeCompletion(CompletionInitializationContext)} method.<p>
|
||||
*
|
||||
* Q: How do I get automatic lookup element filtering by prefix?<br>
|
||||
* A: When you return variants from reference ({@link PsiReference#getVariants()}), the filtering will be done
|
||||
@@ -119,7 +119,7 @@ import java.util.List;
|
||||
* If your contributor isn't even invoked, probably there was another contributor that said 'stop' to the system, and yours happened to be ordered after
|
||||
* that contributor. To test this hypothesis, put a breakpoint to
|
||||
* {@link CompletionService#getVariantsFromContributors(CompletionParameters, CompletionContributor, com.intellij.util.Consumer)},
|
||||
* to the 'return false' line.<p>
|
||||
* to the 'return false' line.<p>
|
||||
*
|
||||
* @author peter
|
||||
*/
|
||||
@@ -228,6 +228,7 @@ public abstract class CompletionContributor {
|
||||
|
||||
public static List<CompletionContributor> forParameters(final CompletionParameters parameters) {
|
||||
return ApplicationManager.getApplication().runReadAction(new Computable<List<CompletionContributor>>() {
|
||||
@Override
|
||||
public List<CompletionContributor> compute() {
|
||||
return forLanguage(PsiUtilBase.getLanguageAtOffset(parameters.getPosition().getContainingFile(), parameters.getOffset()));
|
||||
}
|
||||
@@ -256,6 +257,7 @@ public abstract class CompletionContributor {
|
||||
return buildExtensions(allowed);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String keyToString(Language key) {
|
||||
return key.getID();
|
||||
}
|
||||
|
||||
@@ -64,7 +64,7 @@ public abstract class CompletionService {
|
||||
|
||||
/**
|
||||
* Run all contributors until any of them returns false or the list is exhausted. If from parameter is not null, contributors
|
||||
* will be run starting from the next one after that.
|
||||
* will be run starting from the next one after that.
|
||||
* @param parameters
|
||||
* @param from
|
||||
* @param consumer
|
||||
@@ -90,7 +90,7 @@ public abstract class CompletionService {
|
||||
|
||||
/**
|
||||
* Create a {@link com.intellij.codeInsight.completion.CompletionResultSet} that will filter variants based on default camel-hump
|
||||
* {@link com.intellij.codeInsight.completion.PrefixMatcher} and give the filtered variants to consumer.
|
||||
* {@link com.intellij.codeInsight.completion.PrefixMatcher} and give the filtered variants to consumer.
|
||||
* @param parameters
|
||||
* @param consumer
|
||||
* @param contributor
|
||||
@@ -113,6 +113,7 @@ public abstract class CompletionService {
|
||||
final Collection<LookupElement> lookupSet = new LinkedHashSet<LookupElement>();
|
||||
|
||||
getVariantsFromContributors(parameters, null, new Consumer<CompletionResult>() {
|
||||
@Override
|
||||
public void consume(final CompletionResult result) {
|
||||
if (lookupSet.add(result.getLookupElement())) {
|
||||
consumer.consume(result);
|
||||
|
||||
@@ -23,5 +23,6 @@ import com.intellij.psi.statistics.StatisticsInfo;
|
||||
* @author peter
|
||||
*/
|
||||
public abstract class CompletionStatistician extends Statistician<LookupElement,CompletionLocation> {
|
||||
@Override
|
||||
public abstract StatisticsInfo serialize(final LookupElement element, final CompletionLocation location);
|
||||
}
|
||||
|
||||
@@ -24,5 +24,6 @@ import org.jetbrains.annotations.NotNull;
|
||||
*/
|
||||
public abstract class CompletionWeigher extends Weigher<LookupElement, CompletionLocation> {
|
||||
|
||||
@Override
|
||||
public abstract Comparable weigh(@NotNull final LookupElement element, @NotNull final CompletionLocation location);
|
||||
}
|
||||
|
||||
@@ -30,6 +30,7 @@ public class DummyIdentifierPatcher extends FileCopyPatcher {
|
||||
myDummyIdentifier = dummyIdentifier;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void patchFileCopy(@NotNull final PsiFile fileCopy, @NotNull final Document document, @NotNull final OffsetMap map) {
|
||||
if (StringUtil.isEmpty(myDummyIdentifier)) return;
|
||||
int startOffset = map.getOffset(CompletionInitializationContext.START_OFFSET);
|
||||
|
||||
@@ -114,6 +114,7 @@ public class OffsetMap implements Disposable {
|
||||
return myModified.contains(key);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dispose() {
|
||||
myDisposed = true;
|
||||
for (RangeMarker rangeMarker : myMap.values()) {
|
||||
|
||||
+3
@@ -31,11 +31,13 @@ import org.jetbrains.annotations.Nullable;
|
||||
*/
|
||||
public abstract class ParenthesesInsertHandler<T extends LookupElement> implements InsertHandler<T> {
|
||||
public static final ParenthesesInsertHandler<LookupElement> WITH_PARAMETERS = new ParenthesesInsertHandler<LookupElement>() {
|
||||
@Override
|
||||
protected boolean placeCaretInsideParentheses(final InsertionContext context, final LookupElement item) {
|
||||
return true;
|
||||
}
|
||||
};
|
||||
public static final ParenthesesInsertHandler<LookupElement> NO_PARAMETERS = new ParenthesesInsertHandler<LookupElement>() {
|
||||
@Override
|
||||
protected boolean placeCaretInsideParentheses(final InsertionContext context, final LookupElement item) {
|
||||
return false;
|
||||
}
|
||||
@@ -87,6 +89,7 @@ public abstract class ParenthesesInsertHandler<T extends LookupElement> implemen
|
||||
|
||||
protected abstract boolean placeCaretInsideParentheses(final InsertionContext context, final T item);
|
||||
|
||||
@Override
|
||||
public void handleInsert(final InsertionContext context, final T item) {
|
||||
final Editor editor = context.getEditor();
|
||||
final Document document = editor.getDocument();
|
||||
|
||||
@@ -26,6 +26,7 @@ import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public class LineMover extends StatementUpDownMover {
|
||||
|
||||
@Override
|
||||
public boolean checkAvailable(@NotNull final Editor editor, @NotNull final PsiFile file, @NotNull final MoveInfo info, final boolean down) {
|
||||
LineRange range = StatementUpDownMover.getLineRangeFromSelection(editor);
|
||||
|
||||
|
||||
@@ -38,11 +38,13 @@ public class MemberChooserObjectBase implements MemberChooserObject {
|
||||
myIcon = icon;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderTreeNode(SimpleColoredComponent component, JTree tree) {
|
||||
SpeedSearchUtil.appendFragmentsForSpeedSearch(tree, getText(), getTextAttributes(tree), false, component);
|
||||
component.setIcon(myIcon);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getText() {
|
||||
return myText;
|
||||
}
|
||||
|
||||
+2
@@ -28,12 +28,14 @@ import org.jetbrains.annotations.NotNull;
|
||||
public class DefaultImplementationTextSelectioner implements ImplementationTextSelectioner {
|
||||
private static final Logger LOG = Logger.getInstance("#" + DefaultImplementationTextSelectioner.class.getName());
|
||||
|
||||
@Override
|
||||
public int getTextStartOffset(@NotNull final PsiElement parent) {
|
||||
final TextRange textRange = parent.getTextRange();
|
||||
LOG.assertTrue(textRange != null, parent);
|
||||
return textRange.getStartOffset();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTextEndOffset(@NotNull PsiElement element) {
|
||||
final TextRange textRange = element.getTextRange();
|
||||
LOG.assertTrue(textRange != null, element);
|
||||
|
||||
@@ -26,15 +26,18 @@ import com.intellij.psi.PsiFile;
|
||||
*/
|
||||
public abstract class AbstractIntentionAction implements IntentionAction {
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public String getFamilyName() {
|
||||
return getText();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isAvailable(@NotNull Project project, Editor editor, PsiFile file) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean startInWriteAction() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -55,6 +55,7 @@ public class IntentionActionBean extends CustomLoadingExtensionPointBean {
|
||||
final String[] keys = categoryKey.split("/");
|
||||
if (keys.length > 1) {
|
||||
return ContainerUtil.map2Array(keys, String.class, new Function<String, String>() {
|
||||
@Override
|
||||
public String fun(final String s) {
|
||||
return CommonBundle.message(bundle, s);
|
||||
}
|
||||
|
||||
@@ -142,6 +142,7 @@ public final class LookupElementBuilder extends LookupElement {
|
||||
Collections.unmodifiableSet(set), myCaseSensitive);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCaseSensitive() {
|
||||
return myCaseSensitive;
|
||||
}
|
||||
|
||||
@@ -37,6 +37,7 @@ public abstract class LookupElementDecorator<T extends LookupElement> extends Lo
|
||||
return myDelegate;
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public String getLookupString() {
|
||||
return myDelegate.getLookupString();
|
||||
@@ -100,7 +101,8 @@ public abstract class LookupElementDecorator<T extends LookupElement> extends Lo
|
||||
final T t = super.as(conditionKey);
|
||||
return t == null ? myDelegate.as(conditionKey) : t;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean isCaseSensitive() {
|
||||
return myDelegate.isCaseSensitive();
|
||||
}
|
||||
|
||||
@@ -26,6 +26,7 @@ import javax.swing.*;
|
||||
* @author peter
|
||||
*/
|
||||
public abstract class MutableLookupElement<T> extends LookupElement{
|
||||
@Override
|
||||
@NotNull
|
||||
public abstract T getObject();
|
||||
|
||||
|
||||
@@ -33,6 +33,7 @@ public class TextResult implements Result{
|
||||
return myText;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equalsToText(String text, PsiElement context) {
|
||||
return text.equals(myText);
|
||||
}
|
||||
@@ -41,6 +42,7 @@ public class TextResult implements Result{
|
||||
return myText;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleFocused(final PsiFile psiFile, final Document document, final int segmentStart, final int segmentEnd) {
|
||||
}
|
||||
}
|
||||
@@ -121,6 +121,7 @@ public abstract class GlobalInspectionTool extends InspectionProfileEntry {
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean isEnabledByDefault() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ import com.intellij.util.xmlb.annotations.Attribute;
|
||||
*/
|
||||
public class LocalInspectionEP extends InspectionEP implements LocalInspectionTool.LocalDefaultNameProvider {
|
||||
|
||||
public final static ExtensionPointName<LocalInspectionEP> LOCAL_INSPECTION = ExtensionPointName.create("com.intellij.localInspection");
|
||||
public static final ExtensionPointName<LocalInspectionEP> LOCAL_INSPECTION = ExtensionPointName.create("com.intellij.localInspection");
|
||||
|
||||
@Attribute("suppressId")
|
||||
public String id;
|
||||
|
||||
@@ -29,5 +29,6 @@ public interface RefFile extends RefElement {
|
||||
*
|
||||
* @return the file for the node.
|
||||
*/
|
||||
@Override
|
||||
PsiFile getElement();
|
||||
}
|
||||
|
||||
@@ -38,6 +38,7 @@ public class ListEditForm {
|
||||
final ListWrappingTableModel tableModel = table.getModel();
|
||||
tableModel.addRow();
|
||||
EventQueue.invokeLater(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
final int lastRowIndex = tableModel.getRowCount() - 1;
|
||||
final Rectangle rectangle =
|
||||
|
||||
@@ -47,10 +47,12 @@ public class ListTable extends JBTable {
|
||||
setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ListWrappingTableModel getModel() {
|
||||
return (ListWrappingTableModel) super.getModel();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setModel(TableModel dataModel) {
|
||||
if (!(dataModel instanceof ListWrappingTableModel)) {
|
||||
throw new IllegalArgumentException(
|
||||
@@ -59,6 +61,7 @@ public class ListTable extends JBTable {
|
||||
super.setModel(dataModel);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Component prepareRenderer(TableCellRenderer renderer, int row,
|
||||
int column) {
|
||||
final Component component =
|
||||
|
||||
@@ -72,6 +72,7 @@ public class ListWrappingTableModel extends AbstractTableModel {
|
||||
return String.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getColumnCount() {
|
||||
return columnNames.size();
|
||||
}
|
||||
@@ -84,6 +85,7 @@ public class ListWrappingTableModel extends AbstractTableModel {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRowCount() {
|
||||
final List<String> column0 = list.get(0);
|
||||
if (column0 == null) {
|
||||
@@ -92,6 +94,7 @@ public class ListWrappingTableModel extends AbstractTableModel {
|
||||
return column0.size();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getValueAt(int rowIndex, int columnIndex) {
|
||||
return list.get(columnIndex).get(rowIndex);
|
||||
}
|
||||
|
||||
@@ -90,6 +90,7 @@ public class MultipleCheckboxOptionsPanel extends JPanel {
|
||||
this.model = model;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void stateChanged(ChangeEvent e) {
|
||||
setPropertyValue(owner, property, model.isSelected());
|
||||
}
|
||||
|
||||
@@ -76,6 +76,7 @@ public class SingleCheckboxOptionsPanel extends JPanel {
|
||||
this.model = model;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void stateChanged(ChangeEvent e) {
|
||||
setPropertyValue(owner, property, model.isSelected());
|
||||
}
|
||||
|
||||
+1
@@ -93,6 +93,7 @@ public class SingleIntegerFieldOptionsPanel extends JPanel {
|
||||
textField.setValue(getPropertyValue(owner, property));
|
||||
final Document document = textField.getDocument();
|
||||
document.addDocumentListener(new DocumentAdapter() {
|
||||
@Override
|
||||
public void textChanged(DocumentEvent e) {
|
||||
try {
|
||||
textField.commitEdit();
|
||||
|
||||
@@ -43,6 +43,7 @@ public abstract class AdditionalTabComponent extends JPanel implements Component
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public JComponent getComponent(){
|
||||
return this;
|
||||
|
||||
@@ -49,6 +49,7 @@ import java.util.regex.Pattern;
|
||||
@SuppressWarnings({"AssignmentToStaticFieldFromInstanceMethod"})
|
||||
public class LogConsolePreferences extends LogFilterRegistrar {
|
||||
private final SortedMap<LogFilter, Boolean> myRegisteredLogFilters = new TreeMap<LogFilter, Boolean>(new Comparator<LogFilter>() {
|
||||
@Override
|
||||
public int compare(final LogFilter o1, final LogFilter o2) {
|
||||
return -1;
|
||||
}
|
||||
@@ -143,6 +144,7 @@ public class LogConsolePreferences extends LogFilterRegistrar {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Element getState() {
|
||||
@NonNls Element element = new Element("LogFilters");
|
||||
try {
|
||||
@@ -160,6 +162,7 @@ public class LogConsolePreferences extends LogFilterRegistrar {
|
||||
return element;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadState(final Element object) {
|
||||
try {
|
||||
final List children = object.getChildren(FILTER);
|
||||
@@ -176,14 +179,17 @@ public class LogConsolePreferences extends LogFilterRegistrar {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerFilter(LogFilter filter) {
|
||||
myRegisteredLogFilters.put(filter, Boolean.FALSE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<LogFilter> getRegisteredLogFilters() {
|
||||
return new ArrayList<LogFilter>(myRegisteredLogFilters.keySet());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFilterSelected(LogFilter filter) {
|
||||
final Boolean isSelected = myRegisteredLogFilters.get(filter);
|
||||
if (isSelected != null) {
|
||||
@@ -195,6 +201,7 @@ public class LogConsolePreferences extends LogFilterRegistrar {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFilterSelected(LogFilter filter, boolean state) {
|
||||
if (filter instanceof IndependentLogFilter) {
|
||||
((IndependentLogFilter)filter).selectFilter();
|
||||
|
||||
@@ -97,10 +97,12 @@ public class LogFilter implements JDOMExternalizable {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readExternal(Element element) throws InvalidDataException {
|
||||
DefaultJDOMExternalizer.readExternal(this, element);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeExternal(Element element) throws WriteExternalException {
|
||||
DefaultJDOMExternalizer.writeExternal(this, element);
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@ public abstract class BeforeRunTask<T extends BeforeRunTask> implements Cloneabl
|
||||
public void writeExternal(Element element) {
|
||||
element.setAttribute("enabled", String.valueOf(myIsEnabled));
|
||||
}
|
||||
|
||||
|
||||
public void readExternal(Element element) {
|
||||
String attribValue = element.getAttributeValue("enabled");
|
||||
if (attribValue == null) {
|
||||
@@ -65,6 +65,7 @@ public abstract class BeforeRunTask<T extends BeforeRunTask> implements Cloneabl
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BeforeRunTask clone() {
|
||||
try {
|
||||
return (BeforeRunTask)super.clone();
|
||||
|
||||
@@ -52,10 +52,12 @@ public class DefaultExecutionResult implements ExecutionResult {
|
||||
myActions = actions;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ExecutionConsole getExecutionConsole() {
|
||||
return myConsole;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AnAction[] getActions() {
|
||||
return myActions;
|
||||
}
|
||||
@@ -76,11 +78,12 @@ public class DefaultExecutionResult implements ExecutionResult {
|
||||
myStopActions.add(action);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@NotNull
|
||||
public AnAction[] getAdditionalStopActions() {
|
||||
return myStopActions.toArray(new AnAction[myStopActions.size()]);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ProcessHandler getProcessHandler() {
|
||||
return myProcessHandler;
|
||||
}
|
||||
@@ -94,6 +97,7 @@ public class DefaultExecutionResult implements ExecutionResult {
|
||||
myProcessHandler = processHandler;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void actionPerformed(final AnActionEvent e) {
|
||||
if(myProcessHandler.detachIsDefault()) {
|
||||
myProcessHandler.detachProcess();
|
||||
@@ -103,6 +107,7 @@ public class DefaultExecutionResult implements ExecutionResult {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update(final AnActionEvent event) {
|
||||
event.getPresentation().setEnabled(!myProcessHandler.isProcessTerminating() && !myProcessHandler.isProcessTerminated());
|
||||
}
|
||||
|
||||
@@ -44,11 +44,13 @@ public class PsiLocation<E extends PsiElement> extends Location<E> {
|
||||
myModule = module;
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public E getPsiElement() {
|
||||
return myPsiElement;
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public Project getProject() {
|
||||
return myProject;
|
||||
@@ -59,15 +61,18 @@ public class PsiLocation<E extends PsiElement> extends Location<E> {
|
||||
return myModule;
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public <T extends PsiElement> Iterator<Location<T>> getAncestors(@NotNull final Class<T> ancestorClass, final boolean strict) {
|
||||
final T first = strict || !ancestorClass.isInstance(myPsiElement) ? findNext(myPsiElement, ancestorClass) : (T)myPsiElement;
|
||||
return new Iterator<Location<T>>() {
|
||||
private T myCurrent = first;
|
||||
@Override
|
||||
public boolean hasNext() {
|
||||
return myCurrent != null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Location<T> next() {
|
||||
if (myCurrent == null) throw new NoSuchElementException();
|
||||
final PsiLocation<T> psiLocation = new PsiLocation<T>(myProject, myCurrent);
|
||||
@@ -75,12 +80,14 @@ public class PsiLocation<E extends PsiElement> extends Location<E> {
|
||||
return psiLocation;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void remove() {
|
||||
LOG.assertTrue(false);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public PsiLocation<E> toPsiLocation() {
|
||||
return this;
|
||||
|
||||
@@ -24,10 +24,12 @@ public class RunConfigurationConfigurableAdapter<T extends RunConfiguration> ex
|
||||
super(settingsEditor, configuration);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDisplayName() {
|
||||
return getSettings().getName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getHelpTopic() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -114,10 +114,12 @@ class PreferredProducerFind {
|
||||
super(configurationType);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PsiElement getSourceElement() {
|
||||
return myPsiElement;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
protected RunnerAndConfigurationSettings createConfigurationByElement(final Location location, final ConfigurationContext context) {
|
||||
myPsiElement = location.getPsiElement();
|
||||
@@ -141,6 +143,7 @@ class PreferredProducerFind {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo(final Object o) {
|
||||
return PREFERED;
|
||||
}
|
||||
|
||||
+5
@@ -66,6 +66,7 @@ public class EnvironmentVariablesComponent extends LabeledComponent<TextFieldWit
|
||||
setComponent(envsTestField);
|
||||
setText(ExecutionBundle.message("environment.variables.component.title"));
|
||||
getComponent().addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(final ActionEvent e) {
|
||||
new MyEnvironmentVariablesDialog().show();
|
||||
}
|
||||
@@ -167,10 +168,12 @@ public class EnvironmentVariablesComponent extends LabeledComponent<TextFieldWit
|
||||
return ArrayUtil.find(val.split(File.pathSeparator), "$" + envKey + "$") != -1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addChangeListener(final ChangeListener changeListener) {
|
||||
myListeners.add(changeListener);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeChangeListener(final ChangeListener changeListener) {
|
||||
myListeners.remove(changeListener);
|
||||
}
|
||||
@@ -201,11 +204,13 @@ public class EnvironmentVariablesComponent extends LabeledComponent<TextFieldWit
|
||||
init();
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
protected JComponent createCenterPanel() {
|
||||
return myWholePanel;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void doOKAction() {
|
||||
myEnvVariablesTable.stopEditing();
|
||||
final Map<String, String> envs = new LinkedHashMap<String, String>();
|
||||
|
||||
@@ -35,7 +35,7 @@ import org.jetbrains.annotations.Nullable;
|
||||
|
||||
public abstract class CommandLineState implements RunnableState {
|
||||
private static final Logger LOG = Logger.getInstance("#com.intellij.execution.configurations.CommandLineState");
|
||||
private TextConsoleBuilder myConsoleBuilder;
|
||||
private TextConsoleBuilder myConsoleBuilder;
|
||||
|
||||
private final ExecutionEnvironment myEnvironment;
|
||||
|
||||
@@ -47,10 +47,12 @@ public abstract class CommandLineState implements RunnableState {
|
||||
return myEnvironment;
|
||||
}
|
||||
|
||||
@Override
|
||||
public RunnerSettings getRunnerSettings() {
|
||||
return myEnvironment.getRunnerSettings();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ConfigurationPerRunnerSettings getConfigurationSettings() {
|
||||
return myEnvironment.getConfigurationSettings();
|
||||
}
|
||||
@@ -60,6 +62,7 @@ public abstract class CommandLineState implements RunnableState {
|
||||
return myEnvironment.getExecutionTarget();
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public ExecutionResult execute(@NotNull final Executor executor, @NotNull final ProgramRunner runner) throws ExecutionException {
|
||||
final ProcessHandler processHandler = startProcess();
|
||||
@@ -73,8 +76,8 @@ public abstract class CommandLineState implements RunnableState {
|
||||
@Nullable
|
||||
protected ConsoleView createConsole(@NotNull final Executor executor) throws ExecutionException {
|
||||
final TextConsoleBuilder builder = getConsoleBuilder();
|
||||
|
||||
return builder != null ? builder.getConsole()
|
||||
|
||||
return builder != null ? builder.getConsole()
|
||||
: null;
|
||||
}
|
||||
|
||||
@@ -110,19 +113,23 @@ public abstract class CommandLineState implements RunnableState {
|
||||
myProcessHandler = processHandler;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSelected(final AnActionEvent event) {
|
||||
return myConsole.isOutputPaused();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setSelected(final AnActionEvent event, final boolean flag) {
|
||||
myConsole.setOutputPaused(flag);
|
||||
ApplicationManager.getApplication().invokeLater(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
update(event);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update(final AnActionEvent event) {
|
||||
super.update(event);
|
||||
final Presentation presentation = event.getPresentation();
|
||||
@@ -141,6 +148,7 @@ public abstract class CommandLineState implements RunnableState {
|
||||
else {
|
||||
presentation.setEnabled(true);
|
||||
myConsole.performWhenNoDeferredOutput(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
update(event);
|
||||
}
|
||||
|
||||
+2
@@ -37,12 +37,14 @@ public final class ConfigurationPerRunnerSettings implements JDOMExternalizable
|
||||
return mySettings;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readExternal(Element element) throws InvalidDataException {
|
||||
if (mySettings != null) {
|
||||
mySettings.readExternal(element);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeExternal(Element element) throws WriteExternalException {
|
||||
if (mySettings != null) {
|
||||
mySettings.writeExternal(element);
|
||||
|
||||
@@ -50,23 +50,28 @@ public abstract class ConfigurationTypeBase implements ConfigurationType {
|
||||
myFactories = newFactories.toArray(new ConfigurationFactory[newFactories.size()]);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDisplayName() {
|
||||
return myDisplayName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getConfigurationTypeDescription() {
|
||||
return myDescription;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Icon getIcon() {
|
||||
return myIcon;
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public String getId() {
|
||||
return myId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ConfigurationFactory[] getConfigurationFactories() {
|
||||
return myFactories;
|
||||
}
|
||||
|
||||
@@ -177,6 +177,7 @@ public class LogFileOptions implements JDOMExternalizable {
|
||||
myCharset = charset;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readExternal(Element element) throws InvalidDataException {
|
||||
String file = element.getAttributeValue(PATH);
|
||||
if (file != null){
|
||||
@@ -206,6 +207,7 @@ public class LogFileOptions implements JDOMExternalizable {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeExternal(Element element) throws WriteExternalException {
|
||||
element.setAttribute(PATH, FileUtil.toSystemIndependentName(getPathPattern()));
|
||||
element.setAttribute(CHECKED, String.valueOf(isEnabled()));
|
||||
|
||||
@@ -30,6 +30,7 @@ public class MockCommandLineState extends CommandLineState {
|
||||
super(env);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected OSProcessHandler startProcess() throws ExecutionException {
|
||||
return null;
|
||||
}
|
||||
|
||||
+5
@@ -55,9 +55,11 @@ public abstract class ModuleBasedConfiguration<ConfigurationModule extends RunCo
|
||||
myModule.setModule(module);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readExternal(Element element) throws InvalidDataException{
|
||||
super.readExternal(element);
|
||||
}
|
||||
@Override
|
||||
public void writeExternal(Element element) throws WriteExternalException{
|
||||
super.writeExternal(element);
|
||||
}
|
||||
@@ -76,6 +78,7 @@ public abstract class ModuleBasedConfiguration<ConfigurationModule extends RunCo
|
||||
|
||||
protected abstract ModuleBasedConfiguration createInstance();
|
||||
|
||||
@Override
|
||||
public ModuleBasedConfiguration clone() {
|
||||
final Element element = new Element(TO_CLONE_ELEMENT_NAME);
|
||||
try {
|
||||
@@ -94,9 +97,11 @@ public abstract class ModuleBasedConfiguration<ConfigurationModule extends RunCo
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public Module[] getModules() {
|
||||
return ApplicationManager.getApplication().runReadAction(new Computable<Module[]>() {
|
||||
@Override
|
||||
@SuppressWarnings({"ConstantConditions"})
|
||||
public Module[] compute() {
|
||||
final Module module = getConfigurationModule().getModule();
|
||||
|
||||
@@ -71,11 +71,13 @@ public class PredefinedLogFile implements JDOMExternalizable {
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void readExternal(Element element) throws InvalidDataException {
|
||||
myId = element.getAttributeValue(ID_ATTRIBUTE);
|
||||
myEnabled = Boolean.parseBoolean(element.getAttributeValue(ENABLED_ATTRIBUTE));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeExternal(Element element) throws WriteExternalException {
|
||||
element.setAttribute(ID_ATTRIBUTE, myId);
|
||||
element.setAttribute(ENABLED_ATTRIBUTE, String.valueOf(myEnabled));
|
||||
|
||||
@@ -64,31 +64,38 @@ public abstract class RunConfigurationBase extends UserDataHolderBase implements
|
||||
myIcon = factory.getIcon();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getUniqueID() {
|
||||
return System.identityHashCode(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public final ConfigurationFactory getFactory() {
|
||||
return myFactory;
|
||||
}
|
||||
|
||||
@Override
|
||||
public final void setName(final String name) {
|
||||
myName = name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public final Project getProject() {
|
||||
return myProject;
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public ConfigurationType getType() {
|
||||
return myFactory.getType();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Icon getIcon() {
|
||||
return myIcon;
|
||||
}
|
||||
|
||||
@Override
|
||||
public final String getName() {
|
||||
return myName;
|
||||
}
|
||||
@@ -104,6 +111,7 @@ public abstract class RunConfigurationBase extends UserDataHolderBase implements
|
||||
public void checkSettingsBeforeRun() throws RuntimeConfigurationException {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canRunOn(@NotNull ExecutionTarget target) {
|
||||
return true;
|
||||
}
|
||||
@@ -112,6 +120,7 @@ public abstract class RunConfigurationBase extends UserDataHolderBase implements
|
||||
return super.equals(obj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RunConfiguration clone() {
|
||||
final RunConfigurationBase runConfiguration = (RunConfigurationBase)super.clone();
|
||||
runConfiguration.myLogFiles = new ArrayList<LogFileOptions>(myLogFiles);
|
||||
@@ -176,6 +185,7 @@ public abstract class RunConfigurationBase extends UserDataHolderBase implements
|
||||
public void customizeLogConsole(LogConsole console) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readExternal(Element element) throws InvalidDataException {
|
||||
myLogFiles.clear();
|
||||
for (final Object o : element.getChildren(LOG_FILE)) {
|
||||
@@ -200,6 +210,7 @@ public abstract class RunConfigurationBase extends UserDataHolderBase implements
|
||||
myShowConsoleOnStdErr = Boolean.parseBoolean(element.getAttributeValue(SHOW_CONSOLE_ON_STD_ERR));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeExternal(Element element) throws WriteExternalException {
|
||||
for (final LogFileOptions options : myLogFiles) {
|
||||
Element logFile = new Element(LOG_FILE);
|
||||
|
||||
+2
@@ -42,6 +42,7 @@ public class RunConfigurationModule implements JDOMExternalizable {
|
||||
myProject = project;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings({"unchecked"})
|
||||
public void readExternal(final Element element) throws InvalidDataException {
|
||||
final List<Element> modules = (List<Element>)element.getChildren(ELEMENT);
|
||||
@@ -55,6 +56,7 @@ public class RunConfigurationModule implements JDOMExternalizable {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeExternal(final Element parent) throws WriteExternalException {
|
||||
final Element element = new Element(ELEMENT);
|
||||
element.setAttribute(ATTRIBUTE, getModuleName());
|
||||
|
||||
@@ -37,12 +37,14 @@ public final class RunnerSettings<T extends JDOMExternalizable> implements JDOME
|
||||
return myConfig;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readExternal(Element element) throws InvalidDataException {
|
||||
if (myData != null) {
|
||||
myData.readExternal(element);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeExternal(Element element) throws WriteExternalException {
|
||||
if (myData != null) {
|
||||
myData.writeExternal(element);
|
||||
|
||||
@@ -33,31 +33,38 @@ public abstract class RuntimeConfiguration extends RunConfigurationBase implemen
|
||||
super(project, factory, name);
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public Module[] getModules() {
|
||||
return Module.EMPTY_ARRAY;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void checkConfiguration() throws RuntimeConfigurationException {
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public RuntimeConfiguration clone() {
|
||||
return (RuntimeConfiguration)super.clone();
|
||||
}
|
||||
|
||||
@Override
|
||||
public JDOMExternalizable createRunnerSettings(ConfigurationInfoProvider provider) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SettingsEditor<JDOMExternalizable> getRunnerSettingsEditor(ProgramRunner runner) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isGeneratedName() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
@NonNls public String suggestedName() {
|
||||
return null;
|
||||
}
|
||||
|
||||
+5
@@ -31,23 +31,28 @@ public class UnknownConfigurationType implements ConfigurationType {
|
||||
|
||||
public static final String NAME = "Unknown";
|
||||
|
||||
@Override
|
||||
public String getDisplayName() {
|
||||
return getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getConfigurationTypeDescription() {
|
||||
return "Configuration which cannot be loaded due to some reasons";
|
||||
}
|
||||
|
||||
@Override
|
||||
public Icon getIcon() {
|
||||
return AllIcons.RunConfigurations.Unknown;
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public String getId() {
|
||||
return NAME;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ConfigurationFactory[] getConfigurationFactories() {
|
||||
return new ConfigurationFactory[] {new ConfigurationFactory(new UnknownConfigurationType()) {
|
||||
@Override
|
||||
|
||||
+19
@@ -56,6 +56,7 @@ public class UnknownRunConfiguration implements RunConfiguration {
|
||||
myDoNotStore = b;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public Icon getIcon() {
|
||||
return null;
|
||||
@@ -65,35 +66,43 @@ public class UnknownRunConfiguration implements RunConfiguration {
|
||||
return myDoNotStore;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ConfigurationFactory getFactory() {
|
||||
return myFactory;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setName(final String name) {
|
||||
myName = name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SettingsEditor<? extends RunConfiguration> getConfigurationEditor() {
|
||||
return new UnknownSettingsEditor();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Project getProject() {
|
||||
return myProject;
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public ConfigurationType getType() {
|
||||
return UnknownConfigurationType.INSTANCE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public JDOMExternalizable createRunnerSettings(final ConfigurationInfoProvider provider) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SettingsEditor<JDOMExternalizable> getRunnerSettingsEditor(final ProgramRunner runner) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public RunConfiguration clone() {
|
||||
try {
|
||||
final UnknownRunConfiguration cloned = (UnknownRunConfiguration) super.clone();
|
||||
@@ -104,14 +113,17 @@ public class UnknownRunConfiguration implements RunConfiguration {
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getUniqueID() {
|
||||
return System.identityHashCode(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RunProfileState getState(@NotNull final Executor executor, @NotNull final ExecutionEnvironment env) throws ExecutionException {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
if (myName == null) {
|
||||
myName = String.format("Unknown%s", myUniqueName.getAndAdd(1));
|
||||
@@ -120,14 +132,17 @@ public class UnknownRunConfiguration implements RunConfiguration {
|
||||
return myName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void checkConfiguration() throws RuntimeConfigurationException {
|
||||
throw new RuntimeConfigurationException("Broken configuration due to unavailable plugin or invalid configuration data.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readExternal(final Element element) throws InvalidDataException {
|
||||
myStoredElement = (Element) element.clone();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeExternal(final Element element) throws WriteExternalException {
|
||||
if (myStoredElement != null) {
|
||||
final List attributeList = myStoredElement.getAttributes();
|
||||
@@ -154,17 +169,21 @@ public class UnknownRunConfiguration implements RunConfiguration {
|
||||
myPanel.add(new JLabel("This configuration cannot be edited", JLabel.CENTER));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void resetEditorFrom(final UnknownRunConfiguration s) {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void applyEditorTo(final UnknownRunConfiguration s) throws ConfigurationException {
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
protected JComponent createEditor() {
|
||||
return myPanel;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void disposeEditor() {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,46 +33,56 @@ import javax.swing.*;
|
||||
public class DefaultRunExecutor extends Executor {
|
||||
@NonNls public static final String EXECUTOR_ID = ToolWindowId.RUN;
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public String getStartActionText() {
|
||||
return ExecutionBundle.message("default.runner.start.action.text");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getToolWindowId() {
|
||||
return ToolWindowId.RUN;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Icon getToolWindowIcon() {
|
||||
return AllIcons.Toolwindows.ToolWindowRun;
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public Icon getIcon() {
|
||||
return AllIcons.Actions.Execute;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Icon getDisabledIcon() {
|
||||
return AllIcons.Process.DisabledRun;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDescription() {
|
||||
return ExecutionBundle.message("standard.runner.description");
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public String getActionName() {
|
||||
return UIBundle.message("tool.window.name.run");
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public String getId() {
|
||||
return EXECUTOR_ID;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getContextActionId() {
|
||||
return "RunClass";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getHelpId() {
|
||||
return "ideaInterface.run";
|
||||
}
|
||||
|
||||
@@ -50,6 +50,7 @@ public final class OpenFileHyperlinkInfo implements FileHyperlinkInfo {
|
||||
this(project, file, line, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public OpenFileDescriptor getDescriptor() {
|
||||
if (!myFile.isValid()) {
|
||||
return null;
|
||||
@@ -63,8 +64,10 @@ public final class OpenFileHyperlinkInfo implements FileHyperlinkInfo {
|
||||
return new OpenFileDescriptor(myProject, myFile, myDocumentLine, myDocumentColumn);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void navigate(final Project project) {
|
||||
ApplicationManager.getApplication().runReadAction(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
final VirtualFile file = myFile;
|
||||
if (file.isValid()) {
|
||||
|
||||
@@ -135,6 +135,7 @@ public class RegexpFilter implements Filter {
|
||||
return expression;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result applyFilter(final String line, final int entireLength) {
|
||||
|
||||
final Matcher matcher = myPattern.matcher(line);
|
||||
|
||||
+6
-2
@@ -34,7 +34,7 @@ import org.jetbrains.annotations.Nullable;
|
||||
import java.util.Comparator;
|
||||
|
||||
public abstract class RuntimeConfigurationProducer implements Comparable, Cloneable {
|
||||
public static final ExtensionPointName<RuntimeConfigurationProducer> RUNTIME_CONFIGURATION_PRODUCER = ExtensionPointName.create("com.intellij.configurationProducer");
|
||||
public static final ExtensionPointName<RuntimeConfigurationProducer> RUNTIME_CONFIGURATION_PRODUCER = ExtensionPointName.create("com.intellij.configurationProducer");
|
||||
|
||||
public static final Comparator<RuntimeConfigurationProducer> COMPARATOR = new ProducerComparator();
|
||||
protected static final int PREFERED = -1;
|
||||
@@ -98,6 +98,7 @@ public abstract class RuntimeConfigurationProducer implements Comparable, Clonea
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public RuntimeConfigurationProducer clone() {
|
||||
assert !isClone;
|
||||
try {
|
||||
@@ -128,7 +129,7 @@ public abstract class RuntimeConfigurationProducer implements Comparable, Clonea
|
||||
public ConfigurationType getConfigurationType() {
|
||||
return myConfigurationFactory.getType();
|
||||
}
|
||||
|
||||
|
||||
public void perform(ConfigurationContext context, Runnable performRunnable){
|
||||
performRunnable.run();
|
||||
}
|
||||
@@ -145,6 +146,7 @@ public abstract class RuntimeConfigurationProducer implements Comparable, Clonea
|
||||
}
|
||||
|
||||
private static class ProducerComparator implements Comparator<RuntimeConfigurationProducer> {
|
||||
@Override
|
||||
public int compare(final RuntimeConfigurationProducer producer1, final RuntimeConfigurationProducer producer2) {
|
||||
final PsiElement psiElement1 = producer1.getSourceElement();
|
||||
final PsiElement psiElement2 = producer2.getSourceElement();
|
||||
@@ -170,6 +172,7 @@ public abstract class RuntimeConfigurationProducer implements Comparable, Clonea
|
||||
myConfig = config;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SettingsEditor<? extends RunConfiguration> getConfigurationEditor() {
|
||||
return myConfig.getConfigurationEditor();
|
||||
}
|
||||
@@ -180,6 +183,7 @@ public abstract class RuntimeConfigurationProducer implements Comparable, Clonea
|
||||
return new DelegatingRuntimeConfiguration<T>((T)myConfig.clone());
|
||||
}
|
||||
|
||||
@Override
|
||||
public RunProfileState getState(@NotNull Executor executor, @NotNull ExecutionEnvironment env) throws ExecutionException {
|
||||
return myConfig.getState(executor, env);
|
||||
}
|
||||
|
||||
@@ -224,6 +224,7 @@ public class ExecutionEnvironment extends UserDataHolderBase {
|
||||
@Deprecated
|
||||
public DataContext getDataContext() {
|
||||
return new DataContext() {
|
||||
@Override
|
||||
public Object getData(@NonNls String dataId) {
|
||||
return PlatformDataKeys.PROJECT.is(dataId) ? myProject : null;
|
||||
}
|
||||
|
||||
@@ -37,31 +37,38 @@ public abstract class GenericProgramRunner<Settings extends JDOMExternalizable>
|
||||
public static final DataKey<RunContentDescriptor> CONTENT_TO_REUSE_DATA_KEY = DataKey.create("contentToReuse");
|
||||
@Deprecated @NonNls public static final String CONTENT_TO_REUSE = CONTENT_TO_REUSE_DATA_KEY.getName();
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public Settings createConfigurationData(final ConfigurationInfoProvider settingsProvider) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void checkConfiguration(final RunnerSettings settings, final ConfigurationPerRunnerSettings configurationPerRunnerSettings)
|
||||
throws RuntimeConfigurationException {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onProcessStarted(final RunnerSettings settings, final ExecutionResult executionResult) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public AnAction[] createActions(final ExecutionResult executionResult) {
|
||||
return AnAction.EMPTY_ARRAY;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public SettingsEditor<Settings> getSettingsEditor(final Executor executor, final RunConfiguration configuration) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(@NotNull final Executor executor, @NotNull final ExecutionEnvironment environment) throws ExecutionException {
|
||||
execute(executor, environment, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(@NotNull final Executor executor, @NotNull final ExecutionEnvironment env, @Nullable final Callback callback)
|
||||
throws ExecutionException {
|
||||
|
||||
|
||||
@@ -26,6 +26,7 @@ import org.jetbrains.annotations.Nullable;
|
||||
|
||||
public abstract class BaseViewAction extends DumbAwareAction {
|
||||
|
||||
@Override
|
||||
public final void update(final AnActionEvent e) {
|
||||
ViewContext context = getViewFacade(e);
|
||||
Content[] content = getContent(e);
|
||||
@@ -55,13 +56,14 @@ public abstract class BaseViewAction extends DumbAwareAction {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public final void actionPerformed(final AnActionEvent e) {
|
||||
actionPerformed(e, getViewFacade(e), getContent(e));
|
||||
}
|
||||
|
||||
|
||||
protected abstract void actionPerformed(AnActionEvent e, ViewContext context, Content[] content);
|
||||
|
||||
|
||||
|
||||
@Nullable
|
||||
private ViewContext getViewFacade(final AnActionEvent e) {
|
||||
|
||||
@@ -40,6 +40,7 @@ public class CloseAction extends AnAction implements DumbAware {
|
||||
templatePresentation.setDescription(null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void actionPerformed(AnActionEvent e) {
|
||||
final RunContentDescriptor contentDescriptor = getContentDescriptor();
|
||||
if (contentDescriptor == null) {
|
||||
@@ -60,6 +61,7 @@ public class CloseAction extends AnAction implements DumbAware {
|
||||
return myExecutor;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update(AnActionEvent e) {
|
||||
e.getPresentation().setEnabled(myContentDescriptor != null);
|
||||
}
|
||||
|
||||
@@ -34,11 +34,13 @@ public interface CellTransform {
|
||||
myActions.add(restore);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ActionCallback restoreInGrid() {
|
||||
myRestoringNow = true;
|
||||
if (myActions.size() == 0) return new ActionCallback.Done();
|
||||
final ActionCallback topCallback = restore(0);
|
||||
return topCallback.doWhenDone(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
myActions.clear();
|
||||
myRestoringNow = false;
|
||||
@@ -51,6 +53,7 @@ public interface CellTransform {
|
||||
final Restore action = myActions.get(index);
|
||||
final ActionCallback actionCalback = action.restoreInGrid();
|
||||
actionCalback.doWhenDone(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (index < myActions.size() - 1) {
|
||||
restore(index + 1).notifyWhenDone(result);
|
||||
@@ -73,5 +76,5 @@ public interface CellTransform {
|
||||
interface Facade {
|
||||
void minimize(Content content, Restore restore);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -26,10 +26,12 @@ public abstract class LayoutAttractionPolicy {
|
||||
public abstract void clearAttraction(Content content, RunnerLayoutUi ui);
|
||||
|
||||
public static class Bounce extends LayoutAttractionPolicy {
|
||||
@Override
|
||||
public void attract(final Content content, final RunnerLayoutUi ui) {
|
||||
ui.setBouncing(content, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clearAttraction(final Content content, final RunnerLayoutUi ui) {
|
||||
ui.setBouncing(content, false);
|
||||
}
|
||||
@@ -48,6 +50,7 @@ public abstract class LayoutAttractionPolicy {
|
||||
myRequestFocus = requestFocus;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void attract(final Content content, final RunnerLayoutUi ui) {
|
||||
if (!myWasAttracted) {
|
||||
myWasAttracted = true;
|
||||
@@ -57,16 +60,19 @@ public abstract class LayoutAttractionPolicy {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clearAttraction(final Content content, final RunnerLayoutUi ui) {
|
||||
ui.setBouncing(content, false);
|
||||
}
|
||||
}
|
||||
|
||||
public static class FocusAlways extends LayoutAttractionPolicy {
|
||||
@Override
|
||||
public void attract(final Content content, final RunnerLayoutUi ui) {
|
||||
ui.selectAndFocus(content, true, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clearAttraction(final Content content, final RunnerLayoutUi ui) {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,14 +26,17 @@ public class EnvVariablesTable extends ListTableWithButtons<EnvironmentVariable>
|
||||
@Override
|
||||
protected ListTableModel createListModel() {
|
||||
final ColumnInfo name = new ElementsColumnInfoBase<EnvironmentVariable>("Name") {
|
||||
@Override
|
||||
public String valueOf(EnvironmentVariable environmentVariable) {
|
||||
return environmentVariable.getName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCellEditable(EnvironmentVariable environmentVariable) {
|
||||
return environmentVariable.getNameIsWriteable();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setValue(EnvironmentVariable environmentVariable, String s) {
|
||||
if (s.equals(valueOf(environmentVariable))) {
|
||||
return;
|
||||
@@ -49,14 +52,17 @@ public class EnvVariablesTable extends ListTableWithButtons<EnvironmentVariable>
|
||||
};
|
||||
|
||||
final ColumnInfo value = new ElementsColumnInfoBase<EnvironmentVariable>("Value") {
|
||||
@Override
|
||||
public String valueOf(EnvironmentVariable environmentVariable) {
|
||||
return environmentVariable.getValue();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCellEditable(EnvironmentVariable environmentVariable) {
|
||||
return !environmentVariable.getIsPredefined();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setValue(EnvironmentVariable environmentVariable, String s) {
|
||||
if (s.equals(valueOf(environmentVariable))) {
|
||||
return;
|
||||
|
||||
@@ -62,10 +62,12 @@ public class EnvironmentVariable implements JDOMExternalizable, Cloneable {
|
||||
return IS_PREDEFINED;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readExternal(Element element) throws InvalidDataException {
|
||||
DefaultJDOMExternalizer.readExternal(this, element);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeExternal(Element element) throws WriteExternalException {
|
||||
DefaultJDOMExternalizer.writeExternal(this, element);
|
||||
}
|
||||
@@ -74,6 +76,7 @@ public class EnvironmentVariable implements JDOMExternalizable, Cloneable {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnvironmentVariable clone() {
|
||||
try {
|
||||
return (EnvironmentVariable)super.clone();
|
||||
|
||||
@@ -51,6 +51,7 @@ public abstract class ListTableWithButtons<T> extends Observable {
|
||||
myTableView.stopEditing();
|
||||
setModified();
|
||||
SwingUtilities.invokeLater(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
myElements.add(createElement());
|
||||
myTableView.getTableViewModel().setItems(myElements);
|
||||
|
||||
@@ -24,14 +24,17 @@ final class PathMappingTable extends ListTableWithButtons<PathMappingSettings.Pa
|
||||
@Override
|
||||
protected ListTableModel createListModel() {
|
||||
ColumnInfo local = new ElementsColumnInfoBase<PathMappingSettings.PathMapping>("Local path") {
|
||||
@Override
|
||||
public String valueOf(PathMappingSettings.PathMapping pathMapping) {
|
||||
return pathMapping.getLocalRoot();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCellEditable(PathMappingSettings.PathMapping pathMapping) {
|
||||
return canDeleteElement(pathMapping);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setValue(PathMappingSettings.PathMapping pathMapping, String s) {
|
||||
if (s.equals(valueOf(pathMapping))) {
|
||||
return;
|
||||
@@ -47,14 +50,17 @@ final class PathMappingTable extends ListTableWithButtons<PathMappingSettings.Pa
|
||||
};
|
||||
|
||||
ColumnInfo remote = new ElementsColumnInfoBase<PathMappingSettings.PathMapping>("Remote path") {
|
||||
@Override
|
||||
public String valueOf(PathMappingSettings.PathMapping pathMapping) {
|
||||
return pathMapping.getRemoteRoot();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCellEditable(PathMappingSettings.PathMapping pathMapping) {
|
||||
return canDeleteElement(pathMapping);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setValue(PathMappingSettings.PathMapping pathMapping, String s) {
|
||||
if (s.equals(valueOf(pathMapping))) {
|
||||
return;
|
||||
|
||||
@@ -34,6 +34,7 @@ public final class PathMappingsComponent extends LabeledComponent<TextFieldWithB
|
||||
setComponent(pathTextField);
|
||||
setText("Path mappings:");
|
||||
getComponent().addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(final ActionEvent e) {
|
||||
showConfigureMappingsDialog();
|
||||
}
|
||||
@@ -73,10 +74,12 @@ public final class PathMappingsComponent extends LabeledComponent<TextFieldWithB
|
||||
getComponent().setText(sb.toString());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addChangeListener(final ChangeListener changeListener) {
|
||||
myListeners.add(changeListener);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeChangeListener(final ChangeListener changeListener) {
|
||||
myListeners.remove(changeListener);
|
||||
}
|
||||
@@ -104,11 +107,13 @@ public final class PathMappingsComponent extends LabeledComponent<TextFieldWithB
|
||||
init();
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
protected JComponent createCenterPanel() {
|
||||
return myWholePanel;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void doOKAction() {
|
||||
myPathMappingTable.stopEditing();
|
||||
|
||||
|
||||
@@ -87,6 +87,7 @@ public class Facet<C extends FacetConfiguration> extends UserDataHolderBase impl
|
||||
public void disposeFacet() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public final void dispose() {
|
||||
assert !isDisposed;
|
||||
isDisposed = true;
|
||||
|
||||
@@ -46,12 +46,14 @@ public interface FacetConfiguration extends JDOMExternalizable {
|
||||
/**
|
||||
* @deprecated implement {@link com.intellij.openapi.components.PersistentStateComponent#loadState(Object)} instead
|
||||
*/
|
||||
@Override
|
||||
@Deprecated
|
||||
void readExternal(final Element element) throws InvalidDataException;
|
||||
|
||||
/**
|
||||
* @deprecated implement {@link com.intellij.openapi.components.PersistentStateComponent#getState()} instead
|
||||
*/
|
||||
@Override
|
||||
@Deprecated
|
||||
void writeExternal(final Element element) throws WriteExternalException;
|
||||
}
|
||||
|
||||
@@ -22,24 +22,31 @@ import org.jetbrains.annotations.NotNull;
|
||||
* @author nik
|
||||
*/
|
||||
public abstract class FacetManagerAdapter implements FacetManagerListener {
|
||||
@Override
|
||||
public void beforeFacetAdded(@NotNull Facet facet) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void beforeFacetRemoved(@NotNull Facet facet) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void beforeFacetRenamed(@NotNull final Facet facet) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void facetRenamed(@NotNull final Facet facet, @NotNull final String oldName) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void facetAdded(@NotNull Facet facet) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void facetRemoved(@NotNull Facet facet) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void facetConfigurationChanged(@NotNull Facet facet) {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,21 +20,27 @@ package com.intellij.facet;
|
||||
* @author nik
|
||||
*/
|
||||
public abstract class ProjectWideFacetAdapter<F extends Facet> implements ProjectWideFacetListener<F> {
|
||||
@Override
|
||||
public void firstFacetAdded() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void facetAdded(final F facet) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void facetConfigurationChanged(final F facet) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void beforeFacetRemoved(final F facet) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void facetRemoved(final F facet) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void allFacetsRemoved() {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -105,6 +105,7 @@ public class LibrariesDownloadAssistant {
|
||||
@Nullable
|
||||
private static Artifact findVersion(@Nullable Artifact[] versions, @NotNull final String versionId) {
|
||||
return versions == null ? null : ContainerUtil.find(versions, new Condition<Artifact>() {
|
||||
@Override
|
||||
public boolean value(final Artifact springVersion) {
|
||||
return versionId.equals(springVersion.getVersion());
|
||||
}
|
||||
|
||||
@@ -71,6 +71,7 @@ public abstract class FacetBasedFrameworkSupportProvider<F extends Facet> extend
|
||||
return getProviderId(type);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public String getUnderlyingFrameworkId() {
|
||||
FacetTypeId<?> typeId = myFacetType.getUnderlyingFacetType();
|
||||
@@ -81,18 +82,22 @@ public abstract class FacetBasedFrameworkSupportProvider<F extends Facet> extend
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isEnabledForModuleType(@NotNull final ModuleType moduleType) {
|
||||
return myFacetType.isSuitableModuleType(moduleType);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSupportAlreadyAdded(@NotNull final Module module, @NotNull FacetsProvider facetsProvider) {
|
||||
return !facetsProvider.getFacetsByType(module, myFacetType.getId()).isEmpty();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Icon getIcon() {
|
||||
return myFacetType.getIcon();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void addSupport(@NotNull final Module module, @NotNull final ModifiableRootModel rootModel, final FrameworkVersion version, final @Nullable Library library) {
|
||||
FacetManager facetManager = FacetManager.getInstance(module);
|
||||
ModifiableFacetModel model = facetManager.createModifiableModel();
|
||||
|
||||
@@ -32,6 +32,7 @@ import javax.swing.*;
|
||||
*/
|
||||
public abstract class FacetEditorTab implements Configurable {
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
@NonNls
|
||||
public String getHelpTopic() {
|
||||
|
||||
@@ -657,6 +657,7 @@ public class FindModel extends UserDataHolderBase implements Cloneable {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object clone() {
|
||||
return super.clone();
|
||||
}
|
||||
|
||||
@@ -23,10 +23,12 @@ import com.intellij.openapi.progress.PerformInBackgroundOption;
|
||||
* @author max
|
||||
*/
|
||||
public class SearchInBackgroundOption implements PerformInBackgroundOption {
|
||||
@Override
|
||||
public boolean shouldStartInBackground() {
|
||||
return GeneralSettings.getInstance().isSearchInBackground();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void processSentToBackground() {
|
||||
GeneralSettings.getInstance().setSearchInBackground(true);
|
||||
}
|
||||
|
||||
@@ -86,6 +86,7 @@ public class FileContentPattern extends ObjectPattern<FileContent, FileContentPa
|
||||
|
||||
public FileContentPattern xmlWithRootTagNamespace(final ElementPattern<String> namespacePattern) {
|
||||
return with(new PatternCondition<FileContent>("xmlWithRootTagNamespace") {
|
||||
@Override
|
||||
public boolean accepts(@NotNull final FileContent fileContent, final ProcessingContext context) {
|
||||
try {
|
||||
String rootTagNamespace = parseHeaderWithException(fileContent).getRootTagNamespace();
|
||||
|
||||
@@ -61,6 +61,7 @@ public abstract class CreateElementActionBase extends AnAction {
|
||||
|
||||
protected abstract String getActionName(PsiDirectory directory, String newName);
|
||||
|
||||
@Override
|
||||
public final void actionPerformed(final AnActionEvent e) {
|
||||
final DataContext dataContext = e.getDataContext();
|
||||
|
||||
@@ -80,6 +81,7 @@ public abstract class CreateElementActionBase extends AnAction {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update(final AnActionEvent e) {
|
||||
final DataContext dataContext = e.getDataContext();
|
||||
final Presentation presentation = e.getPresentation();
|
||||
@@ -90,6 +92,7 @@ public abstract class CreateElementActionBase extends AnAction {
|
||||
presentation.setEnabled(enabled);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isDumbAware() {
|
||||
return false;
|
||||
}
|
||||
@@ -130,6 +133,7 @@ public abstract class CreateElementActionBase extends AnAction {
|
||||
myDirectory = directory;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkInput(final String inputString) {
|
||||
return true;
|
||||
}
|
||||
@@ -144,6 +148,7 @@ public abstract class CreateElementActionBase extends AnAction {
|
||||
return CreateElementActionBase.this.getActionName(myDirectory, newName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canClose(final String inputString) {
|
||||
myCreatedElements = tryCreate(inputString);
|
||||
return myCreatedElements.length > 0;
|
||||
|
||||
@@ -64,6 +64,7 @@ public abstract class ElementCreator {
|
||||
|
||||
final String commandName = getActionName(inputString);
|
||||
new WriteCommandAction(myProject, commandName) {
|
||||
@Override
|
||||
protected void run(Result result) throws Throwable {
|
||||
LocalHistoryAction action = LocalHistoryAction.NULL;
|
||||
try {
|
||||
|
||||
@@ -46,6 +46,7 @@ public class FileTemplateGroupDescriptor extends FileTemplateDescriptor {
|
||||
return myTemplates.toArray(new FileTemplateDescriptor[myTemplates.size()]);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDisplayName() {
|
||||
return getTitle();
|
||||
}
|
||||
|
||||
@@ -73,6 +73,7 @@ public abstract class ProjectViewNode <Value> extends AbstractTreeNode<Value> im
|
||||
*
|
||||
* @return the virtual file instance, or null if the project view node doesn't represent a virtual file.
|
||||
*/
|
||||
@Override
|
||||
@Nullable
|
||||
public VirtualFile getVirtualFile() {
|
||||
return null;
|
||||
@@ -162,6 +163,7 @@ public abstract class ProjectViewNode <Value> extends AbstractTreeNode<Value> im
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<VirtualFile> getRoots() {
|
||||
Value value = getValue();
|
||||
|
||||
@@ -182,10 +184,12 @@ public abstract class ProjectViewNode <Value> extends AbstractTreeNode<Value> im
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected boolean hasProblemFileBeneath() {
|
||||
if (!Registry.is("projectView.showHierarchyErrors")) return false;
|
||||
|
||||
return WolfTheProblemSolver.getInstance(getProject()).hasProblemFilesBeneath(new Condition<VirtualFile>() {
|
||||
@Override
|
||||
public boolean value(final VirtualFile virtualFile) {
|
||||
return contains(virtualFile)
|
||||
// in case of flattened packages, when package node a.b.c contains error file, node a.b might not.
|
||||
|
||||
@@ -26,30 +26,37 @@ public interface ViewSettings extends NodeOptions {
|
||||
* The default view settings for the project view.
|
||||
*/
|
||||
ViewSettings DEFAULT = new ViewSettings() {
|
||||
@Override
|
||||
public boolean isShowMembers() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isAbbreviatePackageNames() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFlattenPackages() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isHideEmptyMiddlePackages() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isShowLibraryContents() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isStructureView() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isShowModules() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -33,6 +33,7 @@ public class StructureViewModelBase extends TextEditorBasedStructureViewModel {
|
||||
myRoot = root;
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public StructureViewTreeElement getRoot() {
|
||||
return myRoot;
|
||||
|
||||
+6
-1
@@ -62,6 +62,7 @@ public class FrameworkSupportConfigurableBase extends FrameworkSupportConfigurab
|
||||
});
|
||||
updateAvailableVersions(versions);
|
||||
myVersionComboBox.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
fireFrameworkVersionChanged();
|
||||
}
|
||||
@@ -92,10 +93,11 @@ public class FrameworkSupportConfigurableBase extends FrameworkSupportConfigurab
|
||||
myVersionComboBox.setVisible(hasMoreThanOneVersion);
|
||||
}
|
||||
|
||||
@Override
|
||||
public JComponent getComponent() {
|
||||
return myVersions.size() > 1 ? myMainPanel : null;
|
||||
}
|
||||
|
||||
|
||||
protected void reloadVersions(List<? extends FrameworkVersion> frameworkVersions) {
|
||||
myVersions.clear();
|
||||
for (FrameworkVersion version : frameworkVersions) {
|
||||
@@ -103,6 +105,7 @@ public class FrameworkSupportConfigurableBase extends FrameworkSupportConfigurab
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public List<? extends FrameworkVersion> getVersions() {
|
||||
return myVersions;
|
||||
@@ -113,10 +116,12 @@ public class FrameworkSupportConfigurableBase extends FrameworkSupportConfigurab
|
||||
return getSelectedVersion().getLibraries();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addSupport(@NotNull final Module module, @NotNull final ModifiableRootModel rootModel, final @Nullable Library library) {
|
||||
myFrameworkSupportProvider.addSupport(module, rootModel, getSelectedVersion(), library);
|
||||
}
|
||||
|
||||
@Override
|
||||
public FrameworkVersion getSelectedVersion() {
|
||||
return (FrameworkVersion)myVersionComboBox.getSelectedItem();
|
||||
}
|
||||
|
||||
+1
@@ -46,6 +46,7 @@ public abstract class FrameworkSupportProviderBase extends FrameworkSupportProvi
|
||||
return "Version:";
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public FrameworkSupportConfigurableBase createConfigurable(final @NotNull FrameworkSupportModel model) {
|
||||
return new FrameworkSupportConfigurableBase(this, model, getVersions(), getVersionLabelText());
|
||||
|
||||
@@ -39,6 +39,7 @@ public interface ChooseByNamePopupComponent {
|
||||
* @author Konstantin Bulenkov
|
||||
*/
|
||||
abstract class MultiElementsCallback extends Callback {
|
||||
@Override
|
||||
public final void elementChosen(Object element){}
|
||||
public abstract void elementsChosen(List<Object> elements);
|
||||
}
|
||||
|
||||
@@ -25,18 +25,22 @@ import com.intellij.openapi.options.ConfigurationException;
|
||||
import com.intellij.openapi.roots.ModifiableRootModel;
|
||||
|
||||
public class EmptyModuleBuilder extends ModuleBuilder{
|
||||
@Override
|
||||
public boolean isOpenProjectSettingsAfter() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canCreateModule() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setupRootModel(ModifiableRootModel modifiableRootModel) throws ConfigurationException {
|
||||
//do nothing
|
||||
}
|
||||
|
||||
@Override
|
||||
public ModuleType getModuleType() {
|
||||
return ModuleType.EMPTY;
|
||||
}
|
||||
|
||||
@@ -31,6 +31,7 @@ public abstract class ModuleWizardStep extends StepAdapter {
|
||||
protected static final Icon ICON = IconLoader.getIcon("/addmodulewizard.png");
|
||||
public static final ModuleWizardStep[] EMPTY_ARRAY = new ModuleWizardStep[0];
|
||||
|
||||
@Override
|
||||
public abstract JComponent getComponent();
|
||||
public abstract void updateDataModel();
|
||||
|
||||
@@ -50,6 +51,7 @@ public abstract class ModuleWizardStep extends StepAdapter {
|
||||
// empty by default
|
||||
}
|
||||
|
||||
@Override
|
||||
public Icon getIcon() {
|
||||
return ICON;
|
||||
}
|
||||
|
||||
@@ -24,6 +24,7 @@ import com.intellij.codeInsight.completion.CompletionService;
|
||||
import com.intellij.psi.tree.IElementType;
|
||||
|
||||
public class DefaultWordCompletionFilter implements WordCompletionElementFilter {
|
||||
@Override
|
||||
public boolean isWordCompletionEnabledIn(final IElementType element) {
|
||||
final ParserDefinition parserDefinition = LanguageParserDefinitions.INSTANCE.forLanguage(element.getLanguage());
|
||||
return parserDefinition != null && parserDefinition.getCommentTokens().contains(element);
|
||||
|
||||
@@ -32,6 +32,7 @@ public class LanguageDocumentation extends LanguageExtension<DocumentationProvid
|
||||
super("com.intellij.lang.documentationProvider");
|
||||
}
|
||||
|
||||
@Override
|
||||
public DocumentationProvider forLanguage(@NotNull final Language l) {
|
||||
final List<DocumentationProvider> providers = allForLanguage(l);
|
||||
if (providers.size() < 2) {
|
||||
|
||||
@@ -26,14 +26,17 @@ public class LanguageLiteralEscapers extends LanguageExtension<LiteralEscaper> {
|
||||
|
||||
private LanguageLiteralEscapers() {
|
||||
super("com.intellij.lang.literalEscaper", new LiteralEscaper() {
|
||||
@Override
|
||||
public String getEscapedText(final PsiElement context, final String originalText) {
|
||||
return originalText;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String escapeText(String originalText) {
|
||||
return originalText;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String unescapeText(String originalText) {
|
||||
return originalText;
|
||||
}
|
||||
|
||||
@@ -28,8 +28,9 @@ public class LanguageNamesValidation extends LanguageExtension<NamesValidator> {
|
||||
private LanguageNamesValidation() {
|
||||
super("com.intellij.lang.namesValidator", new DefaultNamesValidator());
|
||||
}
|
||||
|
||||
|
||||
protected static class DefaultNamesValidator implements NamesValidator {
|
||||
@Override
|
||||
public boolean isIdentifier(final String name, final Project project) {
|
||||
final int len = name.length();
|
||||
if (len == 0) return false;
|
||||
@@ -43,6 +44,7 @@ public class LanguageNamesValidation extends LanguageExtension<NamesValidator> {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isKeyword(final String name, final Project project) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -23,14 +23,17 @@ import com.intellij.psi.tree.IElementType;
|
||||
|
||||
public interface NodeStructure<T> {
|
||||
NodeStructure<LighterASTNode> LIGHTER_NODE_STRUCTURE = new NodeStructure<LighterASTNode>() {
|
||||
@Override
|
||||
public int getStartOffset(LighterASTNode node) {
|
||||
return node.getStartOffset();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getEndOffset(LighterASTNode node) {
|
||||
return node.getEndOffset();
|
||||
}
|
||||
|
||||
@Override
|
||||
public IElementType getTokenType(LighterASTNode node) {
|
||||
return node.getTokenType();
|
||||
}
|
||||
@@ -38,19 +41,22 @@ public interface NodeStructure<T> {
|
||||
|
||||
|
||||
NodeStructure<ASTNode> AST_NODE_STRUCTURE = new NodeStructure<ASTNode>() {
|
||||
@Override
|
||||
public int getStartOffset(ASTNode node) {
|
||||
return node.getTextRange().getStartOffset();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getEndOffset(ASTNode node) {
|
||||
return node.getTextRange().getEndOffset();
|
||||
}
|
||||
|
||||
@Override
|
||||
public IElementType getTokenType(ASTNode node) {
|
||||
return node.getElementType();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
int getStartOffset(T node);
|
||||
int getEndOffset(T node);
|
||||
IElementType getTokenType(T node);
|
||||
|
||||
@@ -47,6 +47,7 @@ public class CacheBuilderEP implements PluginAware {
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void setPluginDescriptor(PluginDescriptor pluginDescriptor) {
|
||||
myPluginDescriptor = pluginDescriptor;
|
||||
}
|
||||
|
||||
+10
-4
@@ -64,7 +64,7 @@ public class CompositeDocumentationProvider extends DocumentationProviderEx impl
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -75,7 +75,7 @@ public class CompositeDocumentationProvider extends DocumentationProviderEx impl
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -86,7 +86,7 @@ public class CompositeDocumentationProvider extends DocumentationProviderEx impl
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -98,10 +98,11 @@ public class CompositeDocumentationProvider extends DocumentationProviderEx impl
|
||||
return ((ExternalDocumentationHandler)provider).fetchExternalDocumentation(link, project);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
throw new IllegalStateException("Unable to find a provider to fetch documentation link!");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getQuickNavigateInfo(PsiElement element, PsiElement originalElement) {
|
||||
for ( DocumentationProvider provider : myProviders ) {
|
||||
String result = provider.getQuickNavigateInfo(element, originalElement);
|
||||
@@ -114,6 +115,7 @@ public class CompositeDocumentationProvider extends DocumentationProviderEx impl
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getUrlFor(PsiElement element, PsiElement originalElement) {
|
||||
for ( DocumentationProvider provider : myProviders ) {
|
||||
List<String> result = provider.getUrlFor(element,originalElement);
|
||||
@@ -126,6 +128,7 @@ public class CompositeDocumentationProvider extends DocumentationProviderEx impl
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String generateDoc(PsiElement element, PsiElement originalElement) {
|
||||
for ( DocumentationProvider provider : myProviders ) {
|
||||
String result = provider.generateDoc(element,originalElement);
|
||||
@@ -138,6 +141,7 @@ public class CompositeDocumentationProvider extends DocumentationProviderEx impl
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PsiElement getDocumentationElementForLookupItem(PsiManager psiManager, Object object, PsiElement element) {
|
||||
for ( DocumentationProvider provider : myProviders ) {
|
||||
PsiElement result = provider.getDocumentationElementForLookupItem(psiManager,object,element);
|
||||
@@ -150,6 +154,7 @@ public class CompositeDocumentationProvider extends DocumentationProviderEx impl
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PsiElement getDocumentationElementForLink(PsiManager psiManager, String link, PsiElement context) {
|
||||
for ( DocumentationProvider provider : myProviders ) {
|
||||
PsiElement result = provider.getDocumentationElementForLink(psiManager,link,context);
|
||||
@@ -173,6 +178,7 @@ public class CompositeDocumentationProvider extends DocumentationProviderEx impl
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String fetchExternalDocumentation(Project project, PsiElement element, List<String> docUrls) {
|
||||
for (DocumentationProvider provider : myProviders) {
|
||||
if (provider instanceof ExternalDocumentationProvider) {
|
||||
|
||||
@@ -46,6 +46,7 @@ public interface InlineHandler {
|
||||
* Special settings for the case when inline cannot be performed due to already reported (by error hint) problem
|
||||
*/
|
||||
Settings CANNOT_INLINE_SETTINGS = new Settings() {
|
||||
@Override
|
||||
public boolean isOnlyOneReferenceToInline() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -29,16 +29,19 @@ public abstract class CompositeLexer extends LexerBase {
|
||||
|
||||
protected abstract IElementType getCompositeTokenType(IElementType type1, IElementType type2);
|
||||
|
||||
@Override
|
||||
public void start(CharSequence buffer, int startOffset, int endOffset, int initialState) {
|
||||
myLexer1.start(buffer, startOffset, endOffset, (initialState >> 16) & 0xFFFF);
|
||||
myLexer2.start(buffer, startOffset, endOffset, initialState & 0xFFFF);
|
||||
myCurOffset = startOffset;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CharSequence getBufferSequence() {
|
||||
return myLexer1.getBufferSequence();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getState() {
|
||||
final int state = myLexer1.getState();
|
||||
final int state2 = myLexer2.getState();
|
||||
@@ -51,6 +54,7 @@ public abstract class CompositeLexer extends LexerBase {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IElementType getTokenType() {
|
||||
IElementType type1 = myLexer1.getTokenType();
|
||||
if (type1 == null) return null;
|
||||
@@ -58,14 +62,17 @@ public abstract class CompositeLexer extends LexerBase {
|
||||
return getCompositeTokenType(type1, type2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTokenStart() {
|
||||
return myCurOffset;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTokenEnd() {
|
||||
return Math.min(myLexer1.getTokenEnd(), myLexer2.getTokenEnd());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void advance() {
|
||||
int end1 = myLexer1.getTokenEnd();
|
||||
int end2 = myLexer2.getTokenEnd();
|
||||
@@ -78,6 +85,7 @@ public abstract class CompositeLexer extends LexerBase {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getBufferEnd() {
|
||||
return myLexer1.getBufferEnd();
|
||||
}
|
||||
|
||||
@@ -34,6 +34,7 @@ public class FilterLexer extends DelegateLexer {
|
||||
mySet = set;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean reject(IElementType type) {
|
||||
return mySet.contains(type);
|
||||
}
|
||||
@@ -53,6 +54,7 @@ public class FilterLexer extends DelegateLexer {
|
||||
return getDelegate();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void start(CharSequence buffer, int startOffset, int endOffset, int initialState) {
|
||||
super.start(buffer, startOffset, endOffset, initialState);
|
||||
myPrevTokenEnd = -1;
|
||||
@@ -60,6 +62,7 @@ public class FilterLexer extends DelegateLexer {
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void advance() {
|
||||
myPrevTokenEnd = getDelegate().getTokenEnd();
|
||||
super.advance();
|
||||
@@ -70,10 +73,12 @@ public class FilterLexer extends DelegateLexer {
|
||||
return myPrevTokenEnd;
|
||||
}
|
||||
|
||||
@Override
|
||||
public LexerPosition getCurrentPosition() {
|
||||
return getDelegate().getCurrentPosition(); //To change body of overridden methods use File | Settings | File Templates.
|
||||
}
|
||||
|
||||
@Override
|
||||
public void restore(LexerPosition position) {
|
||||
getDelegate().restore(position);
|
||||
myPrevTokenEnd = -1;
|
||||
|
||||
@@ -73,7 +73,8 @@ public class LayeredLexer extends DelegateLexer {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void start(CharSequence buffer, int startOffset, int endOffset, int initialState) {
|
||||
LOG.assertTrue(initialState != IN_LAYER_STATE, "Restoring to layer is not supported.");
|
||||
myState = initialState;
|
||||
@@ -83,10 +84,12 @@ public class LayeredLexer extends DelegateLexer {
|
||||
activateLayerIfNecessary();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getState() {
|
||||
return myState;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IElementType getTokenType() {
|
||||
if (myState == IN_LAYER_LEXER_FINISHED_STATE) {
|
||||
return myCurrentBaseTokenType;
|
||||
@@ -94,6 +97,7 @@ public class LayeredLexer extends DelegateLexer {
|
||||
return isLayerActive() ? myCurrentLayerLexer.getTokenType() : super.getTokenType();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTokenStart() {
|
||||
if (myState == IN_LAYER_LEXER_FINISHED_STATE) {
|
||||
return myLayerLeftPart;
|
||||
@@ -101,6 +105,7 @@ public class LayeredLexer extends DelegateLexer {
|
||||
return isLayerActive() ? myCurrentLayerLexer.getTokenStart() : super.getTokenStart();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTokenEnd() {
|
||||
if (myState == IN_LAYER_LEXER_FINISHED_STATE) {
|
||||
return myBaseTokenEnd;
|
||||
@@ -108,6 +113,7 @@ public class LayeredLexer extends DelegateLexer {
|
||||
return isLayerActive() ? myCurrentLayerLexer.getTokenEnd() : super.getTokenEnd();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void advance() {
|
||||
if (myState == IN_LAYER_LEXER_FINISHED_STATE){
|
||||
myState = super.getState();
|
||||
@@ -151,10 +157,12 @@ public class LayeredLexer extends DelegateLexer {
|
||||
myState = isLayerActive() ? IN_LAYER_STATE : super.getState();
|
||||
}
|
||||
|
||||
@Override
|
||||
public LexerPosition getCurrentPosition() {
|
||||
return new LexerPositionImpl(getTokenStart(), getState());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void restore(LexerPosition position) {
|
||||
start(getBufferSequence(), position.getOffset(), getBufferEnd(), position.getState());
|
||||
}
|
||||
|
||||
@@ -36,6 +36,7 @@ public class StoppableLexerAdapter extends DelegateLexer {
|
||||
myStopped = myCondition.stopsAt(original.getTokenType(), original.getTokenStart(), original.getTokenEnd());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void advance() {
|
||||
if (myStopped) return;
|
||||
super.advance();
|
||||
@@ -50,18 +51,22 @@ public class StoppableLexerAdapter extends DelegateLexer {
|
||||
return delegate instanceof StoppableLexerAdapter ? ((StoppableLexerAdapter)delegate).getPrevTokenEnd() : ((FilterLexer)delegate).getPrevTokenEnd();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTokenEnd() {
|
||||
return myStopped ? super.getTokenStart() : super.getTokenEnd();
|
||||
}
|
||||
|
||||
@Override
|
||||
public IElementType getTokenType() {
|
||||
return myStopped ? null : super.getTokenType();
|
||||
}
|
||||
|
||||
@Override
|
||||
public LexerPosition getCurrentPosition() {
|
||||
return getDelegate().getCurrentPosition();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void restore(LexerPosition position) {
|
||||
getDelegate().restore(position);
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user