Skip to content

Instantly share code, notes, and snippets.

View hendrikebbers's full-sized avatar
:octocat:
Doing Java

Hendrik Ebbers hendrikebbers

:octocat:
Doing Java
View GitHub Profile
View gist:72ad8fa24548c3253f7c4977d8f0533a
# Name of the project
This is a short section that explains in an non-complexe way the main usage of the project. Should be like 3-8 sentences.
table of contents need to be added at this place.
## Getting Started / Installation
Since Github is used mostly by developers it makes sense to start with a section that shows how the content of the repo
@hendrikebbers
hendrikebbers / first-timers-support.md
Last active September 22, 2020 08:44
first-timers-support
View first-timers-support.md

🆕🐥 First Timers Support

We love open source. Based on this we develop everything in the AdoptOpenJDK community as open source projects. If you are new to open source development we have some specific issues for you. Just have a look at all issues with the good first issue label. This issues are reserved for people who never contributed to Open Source before. We know that the process of creating a pull request is the biggest barrier for new contributors. This issues are for you 💝 We use such issues for example to get involved at Hacktoberfest. If you want to know more about open source development and contribution in general you should have a look at this introduction.

@hendrikebbers
hendrikebbers / good-first-issue.md
Last active September 22, 2020 08:44
Template for a good first issue that can be used for AdoptOpenJDK
View good-first-issue.md

🆕🐥 First Timers Only

This issue is reserved for people who never contributed to Open Source before. We know that the process of creating a pull request is the biggest barrier for new contributors. This issue is for you 💝

👾 Description of the issue

The following text is a sample of a a description. It is important that such descriptions contains enough information (maybe by links) to allow a newcomer to work on the issue :)

IcedTea-Web should have a Travis build. Information how a Java project can be build by Travis can be found here. IcedTea-Web is based on Maven and a mvn clean verify should be executed by the Travis build. Today we do not have a maven wrapper but that can be added when solving this issue (optional). IcedTea-Web should be build on the last Java 8 release of AdoptOpenJDK. Providing an additional build that is based on Java 11 would be a big benefit

View gist:4c14db0967ce14ce623baa1f698b230c
final String content = "client_id=" + appName + "&username=" + user + "&password=" + password + "&grant_type=password"
final byte[] rawContent = content.getBytes(PlatformConstants.CHARSET);
final URI url = new URI(authEndpoint + "/auth/realms/" + realmName + "/protocol/openid-connect/token");
final HttpURLConnection connection = new DefaultHttpURLConnectionFactory().create(url);
connection.setRequestMethod(RequestMethod.POST.getRawName());
connection.setRequestProperty("charset", "UTF-8");
connection.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
connection.setRequestProperty("Content-Length", rawContent.length + "");
connection.setDoOutput(true);
connection.setDoInput(true);
View gist:2c544b52ddbcc16836db6d040f16fbb0
tree.setCellRenderer(new DefaultTreeCellRenderer() {
@Override
public IRendererComponent getTreeCellRendererComponent(ULCTree tree, Object value, boolean selected, boolean expanded, boolean leaf, boolean hasFocus) {
IRendererComponent renderer = super.getTreeCellRendererComponent(tree, value, selected, expanded, leaf, hasFocus);
if (value != null && value instanceof ApplicationMetadata) {
setText(((ApplicationMetadata) value).getName());
}
return renderer;
}
View style.css
.exploding-button:exploding {
-fx-background-color: red;
}
View MyCustomButton.java
public class MyCustomButton extends Button {
private static PseudoClass EXPLODING_PSEUDO_CLASS = PseudoClass.getPseudoClass("exploding");
BooleanProperty exploding;
public MyCustomButton() {
exploding = new SimpleBooleanProperty(false);
exploding.addListener(e -> pseudoClassStateChanged(EXPLODING_PSEUDO_CLASS, exploding.get()));
View MyCustomButton.java
public class MyCustomButton extends Button {
private static PseudoClass EXPLODING_PSEUDO_CLASS = PseudoClass.getPseudoClass("exploding");
BooleanProperty exploding = new BooleanPropertyBase(false) {
public void invalidated() {
pseudoClassStateChanged(EXPLODING_PSEUDO_CLASS, get());
}
@Override public Object getBean() {
View Button.java
public class MyCustomButton extends Button {
private static PseudoClass EXPLODING_PSEUDO_CLASS = PseudoClass.getPseudoClass("exploding");
}
View button.css
.button:hover {
-fx-text-fill: orange;
}