Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ui] Add special highlighting for capacity methods.
Signed-off-by: Stéphane Galland <galland@arakhne.org>
- Loading branch information
1 parent
ad0568f
commit a0f5e00
Showing
13 changed files
with
175 additions
and
152 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
87 changes: 0 additions & 87 deletions
87
...gins/io.sarl.lang.ui/src-gen/io/sarl/lang/validation/SARLValidatorConfigurationBlock.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
63 changes: 63 additions & 0 deletions
63
...ugins/io.sarl.lang.ui/src/io/sarl/lang/ui/highlighting/SARLHighlightingConfiguration.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
/* | ||
* $Id$ | ||
* | ||
* SARL is an general-purpose agent programming language. | ||
* More details on http://www.sarl.io | ||
* | ||
* Copyright (C) 2014-2018 the original authors or authors. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package io.sarl.lang.ui.highlighting; | ||
|
||
import org.eclipse.swt.SWT; | ||
import org.eclipse.xtend.ide.highlighting.XtendHighlightingConfiguration; | ||
import org.eclipse.xtext.ui.editor.syntaxcoloring.IHighlightingConfigurationAcceptor; | ||
import org.eclipse.xtext.ui.editor.utils.TextStyle; | ||
|
||
/** | ||
* The configuration for the SARL highlithing system. | ||
* | ||
* <p>This configuration supports the highlighting with a specific color the calls to the capacity methods. | ||
* | ||
* @author $Author: sgalland$ | ||
* @version $FullVersion$ | ||
* @mavengroupid $GroupId$ | ||
* @mavenartifactid $ArtifactId$ | ||
* @since 0.8 | ||
*/ | ||
public class SARLHighlightingConfiguration extends XtendHighlightingConfiguration { | ||
|
||
@Override | ||
public void configure(IHighlightingConfigurationAcceptor acceptor) { | ||
super.configure(acceptor); | ||
acceptor.acceptDefaultHighlighting( | ||
SARLHighlightingStyles.CAPACITY_METHOD_INVOCATION, | ||
"Capacity method invocations", //$NON-NLS-1$ | ||
capacityMethodInvocation()); | ||
} | ||
|
||
/** Style for the capacity method extension. | ||
* | ||
* @return the style. | ||
*/ | ||
@SuppressWarnings("checkstyle:magicnumber") | ||
public TextStyle capacityMethodInvocation() { | ||
final TextStyle textStyle = extensionMethodInvocation().copy(); | ||
//textStyle.setColor(new RGB(128, 36, 0)); | ||
textStyle.setStyle(SWT.ITALIC); | ||
return textStyle; | ||
} | ||
|
||
} |
42 changes: 42 additions & 0 deletions
42
.../coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/highlighting/SARLHighlightingStyles.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/* | ||
* $Id$ | ||
* | ||
* SARL is an general-purpose agent programming language. | ||
* More details on http://www.sarl.io | ||
* | ||
* Copyright (C) 2014-2018 the original authors or authors. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package io.sarl.lang.ui.highlighting; | ||
|
||
import org.eclipse.xtend.ide.common.highlighting.XtendHighlightingStyles; | ||
|
||
/** | ||
* Highlighting styles for SARL. | ||
* | ||
* @author $Author: sgalland$ | ||
* @version $FullVersion$ | ||
* @mavengroupid $GroupId$ | ||
* @mavenartifactid $ArtifactId$ | ||
* @since 0.8 | ||
*/ | ||
@SuppressWarnings("checkstyle:interfaceistype") | ||
public interface SARLHighlightingStyles extends XtendHighlightingStyles { | ||
|
||
/** Style for a call to a capacity's method. | ||
*/ | ||
String CAPACITY_METHOD_INVOCATION = "sarl.capacity.method.invocation"; //$NON-NLS-1$ | ||
|
||
} |
Oops, something went wrong.