Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,13 @@ jobs:
# Note: Assumes we're running on Ubuntu
# https://github.com/actions/runner-images/blob/main/images/ubuntu/Ubuntu2404-Readme.md
- name: Build with Gradle
run: xvfb-run ./gradlew build -xsign -xpublish --warning-mode all
run: xvfb-run ./gradlew build jacocoTestReport -xsign -xpublish --warning-mode all

- name: Submit coverage data to codecov
uses: codecov/codecov-action@v7
if: matrix.java == '25'
with:
token: ${{ secrets.CODECOV_TOKEN }}
disable_search: true
files: ./AutoComplete/build/reports/jacoco/test/jacocoTestReport.xml
name: codecov
9 changes: 8 additions & 1 deletion AutoComplete/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ plugins {
id 'java-library'
}

['base', 'distribution', 'maven-publish', 'signing'].each { apply plugin: it }
['base', 'jacoco', 'distribution', 'maven-publish', 'signing'].each { apply plugin: it }

base {
archivesName = 'autocomplete'
Expand All @@ -14,6 +14,13 @@ dependencies {

ext.isReleaseVersion = !project.version.endsWith('SNAPSHOT')

jacocoTestReport {
reports {
xml.required = true // codecov depends on xml format report
html.required = true
}
}

java {
withSourcesJar()
withJavadocJar()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ protected void fireAutoCompletionEvent(AutoCompletionEvent.Type type) {
* @see #setAutoActivationDelay(int)
*/
public int getAutoActivationDelay() {
return autoActivationListener.timer.getDelay();
return autoActivationListener.timer.getInitialDelay();
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,39 @@
package org.fife.ui.autocomplete;

import java.awt.Color;
import javax.swing.UIManager;
import javax.swing.plaf.ColorUIResource;


/**
* Manages the colors shared across the library.
* Manages the colors shared across the library. Default colors may be
* overridden by a {@code LookAndFeel} by registering a {@link Color} in
* {@link UIManager} under the relevant key.
*
* @author Robert Futrell
* @version 1.0
*/
public class AutoCompletionStyleContext {

/**
* The {@link UIManager} key for the color used to denote the ending
* caret position for parameterized completions.
*/
public static final String PROPERTY_PARAMETERIZED_COMPLETION_CURSOR_POSITION_COLOR =
"autocomplete.parameterizedCompletionCursorPositionColor";

/**
* The {@link UIManager} key for the color used to highlight copies of
* editable parameters in parameterized completions.
*/
public static final String PROPERTY_PARAMETER_COPY_COLOR = "autocomplete.parameterCopyColor";

/**
* The {@link UIManager} key for the color of the outline highlight used
* to denote editable parameters in parameterized completions.
*/
public static final String PROPERTY_PARAMETER_OUTLINE_COLOR = "autocomplete.parameterOutlineColor";

/**
* The color used to denote the ending caret position for parameterized
* completions.
Expand All @@ -38,9 +61,30 @@ public class AutoCompletionStyleContext {
* Constructor.
*/
public AutoCompletionStyleContext() {
setParameterOutlineColor(Color.GRAY);
setParameterCopyColor(new Color(0xb4d7ff));
setParameterizedCompletionCursorPositionColor(new Color(0x00b400));
setParameterOutlineColor(getDefaultColor(PROPERTY_PARAMETER_OUTLINE_COLOR, Color.GRAY));
setParameterCopyColor(getDefaultColor(PROPERTY_PARAMETER_COPY_COLOR, new Color(0xb4d7ff)));
setParameterizedCompletionCursorPositionColor(
getDefaultColor(PROPERTY_PARAMETERIZED_COMPLETION_CURSOR_POSITION_COLOR, new Color(0x00b400)));
}


/**
* Returns the color registered in {@link UIManager} under the specified
* key, or the specified default if none is registered. If no color is
* registered, {@code fallback} is cached in {@code UIManager} under
* {@code key} for future lookups.
*
* @param key The {@link UIManager} key to check.
* @param fallback The color to use, and cache, if none is registered.
* @return The color to use.
*/
private static Color getDefaultColor(String key, Color fallback) {
Color color = UIManager.getColor(key);
if (color == null) {
color = new ColorUIResource(fallback);
UIManager.put(key, color);
}
return color;
}


Expand Down
26 changes: 6 additions & 20 deletions AutoComplete/src/main/java/org/fife/ui/autocomplete/SizeGrip.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,21 @@
import java.awt.Point;
import java.awt.Window;
import java.awt.event.MouseEvent;
import java.io.File;
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
import javax.imageio.ImageIO;
import javax.swing.JPanel;
import javax.swing.SwingUtilities;
import javax.swing.UIManager;
import javax.swing.event.MouseInputAdapter;

import org.fife.ui.rsyntaxtextarea.OS;


/**
* A component that allows its parent window to be resizable, similar to the
* size grip seen on status bars. This is essentially a copy of the class with
* the same name in RSyntaxTextArea, but is duplicated to prevent a dependency
* on that library.
* the same name in RSyntaxTextArea.
*
* @author Robert Futrell
* @version 1.0
Expand Down Expand Up @@ -70,21 +69,8 @@ public void applyComponentOrientation(ComponentOrientation o) {
private Image createOSXSizeGrip() {
ClassLoader cl = getClass().getClassLoader();
URL url = cl.getResource("org/fife/ui/autocomplete/osx_sizegrip.png");
if (url==null) {
// We're not running in a jar - we may be debugging in Eclipse,
// for example
File f = new File("../AutoComplete/src/org/fife/ui/autocomplete/osx_sizegrip.png");
if (f.isFile()) {
try {
url = f.toURI().toURL();
} catch (MalformedURLException mue) { // Never happens
mue.printStackTrace();
return null;
}
}
else {
return null; // Can't find resource or image file
}
if (url == null) {
return null;
}
Image image = null;
try {
Expand Down Expand Up @@ -178,7 +164,7 @@ public void updateUI() {
super.updateUI();
// TODO: Key off of Aqua LaF, not just OS X, as this size grip looks
// bad on other LaFs on Mac such as Nimbus.
if (System.getProperty("os.name").contains("OS X")) {
if (OS.get() == OS.MAC_OS_X) {
if (osxSizeGrip==null) {
osxSizeGrip = createOSXSizeGrip();
}
Expand Down
Loading
Loading