-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
612 changed files
with
18,493 additions
and
4,705 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,26 @@ | ||
description = 'Extension allowing to insert alerts inside a SlideshowFX presentation' | ||
version = '1.1' | ||
version = '1.2' | ||
|
||
dependencies { | ||
compile project(':SlideshowFX-content-extension') | ||
compile configurations.felix | ||
|
||
testCompile configurations.junit | ||
} | ||
apply plugin: 'java-library' | ||
|
||
jar { | ||
manifest { | ||
attributes('Manifest-Version': '1.0', | ||
'Bundle-ManifestVersion': '2', | ||
'Bundle-Name': 'SlideshowFX alert extension', | ||
'Bundle-SymbolicName': 'com.twasyl.slideshowfx.content.extension.alert', | ||
'Bundle-Description': 'Support for inserting alert in slides', | ||
'Bundle-Version': "$project.version", | ||
'Bundle-Activator': 'com.twasyl.slideshowfx.content.extension.alert.activator.AlertContentExtensionActivator', | ||
'Bundle-Vendor': 'Thierry Wasylczenko', | ||
'Export-Package': 'com.twasyl.slideshowfx.content.extension.alert.controllers,com.twasyl.slideshowfx.content.extension.alert,com.twasyl.slideshowfx.content.extension.alert.activator', | ||
'Import-Package': 'org.osgi.framework', | ||
'Setup-Wizard-Label': 'Alert', | ||
'Setup-Wizard-Icon-Name': 'EXCLAMATION_TRIANGLE') | ||
} | ||
} | ||
|
||
bintray { | ||
|
||
configurations = ['archives'] | ||
dependencies { | ||
api project(':slideshowfx-content-extension') | ||
implementation project(':slideshowfx-icons') | ||
api project(':slideshowfx-markup') | ||
api project(':slideshowfx-plugin') | ||
api project(':slideshowfx-ui-controls') | ||
|
||
pkg { | ||
version { | ||
name = project.version | ||
desc = project.description | ||
released = new Date() | ||
vcsTag = "v${project.version}" | ||
} | ||
} | ||
testCompile "org.mockito:mockito-core:${rootProject.ext.dependencies.mockito.version}" | ||
} | ||
|
||
tasks.bintrayUpload.enabled = alertContentExtensionBintrayUploadEnabled | ||
ext.isPlugin = true | ||
ext.isContentExtension = true | ||
ext.bundle = [ | ||
name : 'SlideshowFX alert extension', | ||
symbolicName : 'com.twasyl.slideshowfx.content.extension.alert', | ||
description : 'Support for inserting alert in slides', | ||
activator : 'com.twasyl.slideshowfx.content.extension.alert.activator.AlertContentExtensionActivator', | ||
exportPackage : 'com.twasyl.slideshowfx.content.extension.alert.controllers,com.twasyl.slideshowfx.content.extension.alert,com.twasyl.slideshowfx.content.extension.alert.activator', | ||
setupWizardLabel : 'Alert', | ||
setupWizardIconName: 'EXCLAMATION_TRIANGLE' | ||
] |
88 changes: 61 additions & 27 deletions
88
...asyl/slideshowfx/content/extension/alert/controllers/AlertContentExtensionController.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 |
---|---|---|
@@ -1,76 +1,110 @@ | ||
package com.twasyl.slideshowfx.content.extension.alert.controllers; | ||
|
||
import com.twasyl.slideshowfx.content.extension.AbstractContentExtensionController; | ||
import com.twasyl.slideshowfx.ui.controls.ExtendedTextField; | ||
import com.twasyl.slideshowfx.ui.controls.validators.Validators; | ||
import javafx.beans.property.ReadOnlyBooleanProperty; | ||
import javafx.beans.property.ReadOnlyBooleanWrapper; | ||
import javafx.fxml.FXML; | ||
import javafx.fxml.Initializable; | ||
import javafx.scene.control.CheckBox; | ||
import javafx.scene.control.RadioButton; | ||
import javafx.scene.control.TextField; | ||
import javafx.scene.control.ToggleGroup; | ||
|
||
import java.net.URL; | ||
import java.util.ResourceBundle; | ||
|
||
/** | ||
* This class is the controller used by the {@code AlertContentExtension.fxml} file. | ||
* | ||
* @author Thierry Wasylczenko | ||
* @version 1.1 | ||
* @version 1.2 | ||
* @since SlideshowFX 1.0 | ||
*/ | ||
public class AlertContentExtensionController implements Initializable { | ||
public class AlertContentExtensionController extends AbstractContentExtensionController { | ||
|
||
@FXML private ExtendedTextField title; | ||
@FXML private ExtendedTextField text; | ||
@FXML private ToggleGroup typeGroup; | ||
@FXML private RadioButton infoRB; | ||
@FXML private RadioButton successRB; | ||
@FXML private RadioButton warningRB; | ||
@FXML private RadioButton errorRB; | ||
@FXML private CheckBox allowClickOutside; | ||
@FXML private CheckBox showCancelButton; | ||
@FXML private ExtendedTextField buttonText; | ||
@FXML | ||
private ExtendedTextField title; | ||
@FXML | ||
private ExtendedTextField text; | ||
@FXML | ||
private ToggleGroup typeGroup; | ||
@FXML | ||
private RadioButton infoRB; | ||
@FXML | ||
private RadioButton successRB; | ||
@FXML | ||
private RadioButton warningRB; | ||
@FXML | ||
private RadioButton errorRB; | ||
@FXML | ||
private CheckBox allowClickOutside; | ||
@FXML | ||
private CheckBox showCancelButton; | ||
@FXML | ||
private ExtendedTextField buttonText; | ||
|
||
/** | ||
* Return the title entered in the UI for this alert. | ||
* | ||
* @return The title of the alert. | ||
*/ | ||
public String getTitle() { return this.title.getText(); } | ||
public String getTitle() { | ||
return this.title.getText(); | ||
} | ||
|
||
/** | ||
* Return the additional text entered in the UI for this alert. | ||
* | ||
* @return The text for this alert. | ||
*/ | ||
public String getText() { return this.text.getText(); } | ||
public String getText() { | ||
return this.text.getText(); | ||
} | ||
|
||
/** | ||
* Return the type of the alert. Currently four values can be returned: | ||
* <ul> | ||
* <li>info</li> | ||
* <li>success</li> | ||
* <li>warning</li> | ||
* <li>error</li> | ||
* <li>info</li> | ||
* <li>success</li> | ||
* <li>warning</li> | ||
* <li>error</li> | ||
* </ul> | ||
* | ||
* @return Return the type of this alert. | ||
*/ | ||
public String getType() { | ||
String type = null; | ||
|
||
if(this.typeGroup.getSelectedToggle() == this.infoRB) type = "info"; | ||
else if(this.typeGroup.getSelectedToggle() == this.successRB) type = "success"; | ||
else if(this.typeGroup.getSelectedToggle() == this.warningRB) type = "warning"; | ||
else if(this.typeGroup.getSelectedToggle() == this.errorRB) type = "error"; | ||
if (this.typeGroup.getSelectedToggle() == this.infoRB) type = "info"; | ||
else if (this.typeGroup.getSelectedToggle() == this.successRB) type = "success"; | ||
else if (this.typeGroup.getSelectedToggle() == this.warningRB) type = "warning"; | ||
else if (this.typeGroup.getSelectedToggle() == this.errorRB) type = "error"; | ||
|
||
return type; | ||
} | ||
|
||
public boolean isClickOutsideAllowed() { return this.allowClickOutside.isSelected(); } | ||
public boolean isClickOutsideAllowed() { | ||
return this.allowClickOutside.isSelected(); | ||
} | ||
|
||
public boolean isCancelButtonVisible() { return this.showCancelButton.isSelected(); } | ||
public boolean isCancelButtonVisible() { | ||
return this.showCancelButton.isSelected(); | ||
} | ||
|
||
public String getButtonText() { return this.buttonText.getText(); } | ||
public String getButtonText() { | ||
return this.buttonText.getText(); | ||
} | ||
|
||
@Override | ||
public ReadOnlyBooleanProperty areInputsValid() { | ||
final ReadOnlyBooleanWrapper property = new ReadOnlyBooleanWrapper(); | ||
property.bind(this.title.validProperty()); | ||
|
||
return property; | ||
} | ||
|
||
@Override | ||
public void initialize(URL location, ResourceBundle resources) { | ||
this.title.setValidator(Validators.isNotEmpty()); | ||
} | ||
} |
Binary file modified
BIN
+3.42 KB
(130%)
...rc/main/resources/com/twasyl/slideshowfx/content/extension/alert/resources/sweetalert.zip
Binary file not shown.
Oops, something went wrong.