You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pivot.apache.org by sm...@apache.org on 2013/10/05 01:45:53 UTC
svn commit: r1529349 [7/44] - in /pivot/trunk:
charts/src/org/apache/pivot/charts/
charts/src/org/apache/pivot/charts/skin/ core/src/org/apache/pivot/beans/
core/src/org/apache/pivot/collections/
core/src/org/apache/pivot/collections/adapter/ core/src/...
Modified: pivot/trunk/demos/src/org/apache/pivot/demos/dnd/FileDropTargetDemo.java
URL: http://svn.apache.org/viewvc/pivot/trunk/demos/src/org/apache/pivot/demos/dnd/FileDropTargetDemo.java?rev=1529349&r1=1529348&r2=1529349&view=diff
==============================================================================
--- pivot/trunk/demos/src/org/apache/pivot/demos/dnd/FileDropTargetDemo.java (original)
+++ pivot/trunk/demos/src/org/apache/pivot/demos/dnd/FileDropTargetDemo.java Fri Oct 4 23:45:40 2013
@@ -44,8 +44,10 @@ import org.apache.pivot.wtk.TableView;
import org.apache.pivot.wtk.Window;
public class FileDropTargetDemo extends Window implements Bindable {
- @BXML private TableView fileTableView;
- @BXML private PushButton uploadButton;
+ @BXML
+ private TableView fileTableView;
+ @BXML
+ private PushButton uploadButton;
private FileList fileList = null;
@@ -64,8 +66,7 @@ public class FileDropTargetDemo extends
public void itemsRemoved(List<File> list, int index, Sequence<File> files) {
uploadButton.setEnabled(list.getLength() > 0);
- if (fileTableView.isFocused()
- && index < list.getLength()) {
+ if (fileTableView.isFocused() && index < list.getLength()) {
fileTableView.setSelectedIndex(index);
}
}
@@ -73,9 +74,9 @@ public class FileDropTargetDemo extends
fileTableView.getComponentKeyListeners().add(new ComponentKeyListener.Adapter() {
@Override
- public boolean keyPressed(Component component, int keyCode, Keyboard.KeyLocation keyLocation) {
- if (keyCode == Keyboard.KeyCode.DELETE
- || keyCode == Keyboard.KeyCode.BACKSPACE) {
+ public boolean keyPressed(Component component, int keyCode,
+ Keyboard.KeyLocation keyLocation) {
+ if (keyCode == Keyboard.KeyCode.DELETE || keyCode == Keyboard.KeyCode.BACKSPACE) {
Sequence<Span> selectedRanges = fileTableView.getSelectedRanges();
for (int i = selectedRanges.getLength() - 1; i >= 0; i--) {
@@ -128,7 +129,7 @@ public class FileDropTargetDemo extends
if (dragContent.containsFileList()) {
try {
- FileList tableData = (FileList)fileTableView.getTableData();
+ FileList tableData = (FileList) fileTableView.getTableData();
FileList fileListLocal = dragContent.getFileList();
for (File file : fileListLocal) {
if (file.isDirectory()) {
@@ -139,7 +140,7 @@ public class FileDropTargetDemo extends
}
dropAction = DropAction.COPY;
- } catch(IOException exception) {
+ } catch (IOException exception) {
System.err.println(exception);
}
}
Modified: pivot/trunk/demos/src/org/apache/pivot/demos/dom/DOMInteractionDemo.java
URL: http://svn.apache.org/viewvc/pivot/trunk/demos/src/org/apache/pivot/demos/dom/DOMInteractionDemo.java?rev=1529349&r1=1529348&r2=1529349&view=diff
==============================================================================
--- pivot/trunk/demos/src/org/apache/pivot/demos/dom/DOMInteractionDemo.java (original)
+++ pivot/trunk/demos/src/org/apache/pivot/demos/dom/DOMInteractionDemo.java Fri Oct 4 23:45:40 2013
@@ -86,9 +86,9 @@ public class DOMInteractionDemo extends
}
/**
- * Set text of the message, then display it in a Popup.
- * <p>
- * Called by JavaScript from the Browser.
+ * Set text of the message, then display it in a Popup. <p> Called by
+ * JavaScript from the Browser.
+ *
* @param helloText the text of the message
*/
public void sayHello(String helloText) {
Modified: pivot/trunk/demos/src/org/apache/pivot/demos/itunes/SearchDemo.java
URL: http://svn.apache.org/viewvc/pivot/trunk/demos/src/org/apache/pivot/demos/itunes/SearchDemo.java?rev=1529349&r1=1529348&r2=1529349&view=diff
==============================================================================
--- pivot/trunk/demos/src/org/apache/pivot/demos/itunes/SearchDemo.java (original)
+++ pivot/trunk/demos/src/org/apache/pivot/demos/itunes/SearchDemo.java Fri Oct 4 23:45:40 2013
@@ -30,9 +30,9 @@ import org.apache.pivot.util.concurrent.
import org.apache.pivot.web.GetQuery;
import org.apache.pivot.wtk.ActivityIndicator;
import org.apache.pivot.wtk.Application;
+import org.apache.pivot.wtk.BoxPane;
import org.apache.pivot.wtk.DesktopApplicationContext;
import org.apache.pivot.wtk.Display;
-import org.apache.pivot.wtk.BoxPane;
import org.apache.pivot.wtk.ImageView;
import org.apache.pivot.wtk.Label;
import org.apache.pivot.wtk.PushButton;
@@ -45,14 +45,22 @@ import org.apache.pivot.wtk.media.Image;
public class SearchDemo implements Application {
private Window window = null;
- @BXML private TextInput termTextInput;
- @BXML private PushButton searchButton;
- @BXML private Label statusLabel;
- @BXML private TableView resultsTableView;
- @BXML private BoxPane activityIndicatorBoxPane;
- @BXML private ActivityIndicator activityIndicator;
- @BXML private ImageView artworkImageView;
- @BXML private PushButton previewButton;
+ @BXML
+ private TextInput termTextInput;
+ @BXML
+ private PushButton searchButton;
+ @BXML
+ private Label statusLabel;
+ @BXML
+ private TableView resultsTableView;
+ @BXML
+ private BoxPane activityIndicatorBoxPane;
+ @BXML
+ private ActivityIndicator activityIndicator;
+ @BXML
+ private ImageView artworkImageView;
+ @BXML
+ private PushButton previewButton;
private GetQuery getQuery = null;
@@ -75,7 +83,7 @@ public class SearchDemo implements Appli
BXMLSerializer bxmlSerializer = new BXMLSerializer();
bxmlSerializer.getNamespace().put(APPLICATION_KEY, this);
- window = (Window)bxmlSerializer.readObject(SearchDemo.class, "search_demo.bxml");
+ window = (Window) bxmlSerializer.readObject(SearchDemo.class, "search_demo.bxml");
bxmlSerializer.bind(this, SearchDemo.class);
searchButton.setButtonData(searchImage);
@@ -105,19 +113,14 @@ public class SearchDemo implements Appli
/**
* Executes a search.
- *
- * @param term
- * The search term.
- *
- * @throws IllegalArgumentException
- * If <tt>term</tt> is <tt>null</tt> or empty.
- *
- * @throws IllegalStateException
- * If a query is already executing.
+ *
+ * @param term The search term.
+ * @throws IllegalArgumentException If <tt>term</tt> is <tt>null</tt> or
+ * empty.
+ * @throws IllegalStateException If a query is already executing.
*/
public void executeQuery(String term) {
- if (term == null
- || term.length() == 0) {
+ if (term == null || term.length() == 0) {
throw new IllegalArgumentException();
}
@@ -144,13 +147,13 @@ public class SearchDemo implements Appli
public void taskExecuted(Task<Object> task) {
if (task == getQuery) {
@SuppressWarnings("unchecked")
- Map<String, Object> result = (Map<String, Object>)task.getResult();
+ Map<String, Object> result = (Map<String, Object>) task.getResult();
@SuppressWarnings("unchecked")
- List<Object> results = (List<Object>)result.get("results");
+ List<Object> results = (List<Object>) result.get("results");
// Preserve any existing sort
@SuppressWarnings("unchecked")
- List<Object> tableData = (List<Object>)resultsTableView.getTableData();
+ List<Object> tableData = (List<Object>) resultsTableView.getTableData();
Comparator<Object> comparator = tableData.getComparator();
results.setComparator(comparator);
@@ -186,9 +189,8 @@ public class SearchDemo implements Appli
/**
* Aborts an executing query.
- *
- * @throws IllegalStateException
- * If a query is not currently executing.
+ *
+ * @throws IllegalStateException If a query is not currently executing.
*/
public void abortQuery() {
if (getQuery == null) {
@@ -203,9 +205,8 @@ public class SearchDemo implements Appli
/**
* Tests whether a query is currently executing.
- *
- * @return
- * <tt>true</tt> if a query is currently executing; <tt>false</tt>,
+ *
+ * @return <tt>true</tt> if a query is currently executing; <tt>false</tt>,
* otherwise.
*/
public boolean isQueryExecuting() {
@@ -227,19 +228,19 @@ public class SearchDemo implements Appli
*/
public void updateArtwork() {
@SuppressWarnings("unchecked")
- Map<String, Object> result = (Map<String, Object>)resultsTableView.getSelectedRow();
+ Map<String, Object> result = (Map<String, Object>) resultsTableView.getSelectedRow();
URL artworkURL = null;
if (result != null) {
try {
- artworkURL = new URL((String)result.get("artworkUrl100"));
+ artworkURL = new URL((String) result.get("artworkUrl100"));
} catch (MalformedURLException exception) {
// ignore exception
}
}
if (artworkURL == null) {
- artworkImageView.setImage((Image)null);
+ artworkImageView.setImage((Image) null);
} else {
Image.load(artworkURL, new TaskAdapter<>(new TaskListener<Image>() {
@Override
@@ -249,7 +250,7 @@ public class SearchDemo implements Appli
@Override
public void executeFailed(Task<Image> task) {
- artworkImageView.setImage((Image)null);
+ artworkImageView.setImage((Image) null);
}
}));
}
Modified: pivot/trunk/demos/src/org/apache/pivot/demos/json/JSONViewer.java
URL: http://svn.apache.org/viewvc/pivot/trunk/demos/src/org/apache/pivot/demos/json/JSONViewer.java?rev=1529349&r1=1529348&r2=1529349&view=diff
==============================================================================
--- pivot/trunk/demos/src/org/apache/pivot/demos/json/JSONViewer.java (original)
+++ pivot/trunk/demos/src/org/apache/pivot/demos/json/JSONViewer.java Fri Oct 4 23:45:40 2013
@@ -46,13 +46,14 @@ import org.apache.pivot.wtk.content.Tree
import org.apache.pivot.wtk.effects.OverlayDecorator;
/**
- * Utility application that allows the user to browse a JSON structure
- * using a tree view component.
+ * Utility application that allows the user to browse a JSON structure using a
+ * tree view component.
*/
public class JSONViewer extends Application.Adapter {
private Window window = null;
- @BXML private TreeView treeView = null;
+ @BXML
+ private TreeView treeView = null;
private OverlayDecorator promptDecorator = new OverlayDecorator();
@@ -60,12 +61,11 @@ public class JSONViewer extends Applicat
public static final String WINDOW_TITLE = "JSON Viewer";
@Override
- public void startup(Display display, Map<String, String> properties)
- throws Exception {
+ public void startup(Display display, Map<String, String> properties) throws Exception {
BXMLSerializer bxmlSerializer = new BXMLSerializer();
bxmlSerializer.getNamespace().put(APPLICATION_KEY, this);
- window = (Window)bxmlSerializer.readObject(JSONViewer.class, "json_viewer.bxml");
+ window = (Window) bxmlSerializer.readObject(JSONViewer.class, "json_viewer.bxml");
bxmlSerializer.bind(this);
Label prompt = new Label("Drag or paste JSON here");
@@ -100,8 +100,7 @@ public class JSONViewer extends Applicat
public void paste() {
Manifest clipboardContent = Clipboard.getContent();
- if (clipboardContent != null
- && clipboardContent.containsText()) {
+ if (clipboardContent != null && clipboardContent.containsText()) {
String json = null;
JSONSerializer jsonSerializer = new JSONSerializer();
try {
@@ -145,7 +144,7 @@ public class JSONViewer extends Applicat
} else {
Prompt.prompt("Multiple files not supported.", window);
}
- } catch(IOException exception) {
+ } catch (IOException exception) {
Prompt.prompt(exception.getMessage(), window);
}
@@ -153,8 +152,7 @@ public class JSONViewer extends Applicat
}
private void setValue(Object value) {
- assert (value instanceof Map<?, ?>
- || value instanceof List<?>);
+ assert (value instanceof Map<?, ?> || value instanceof List<?>);
// Remove prompt decorator
if (promptDecorator != null) {
treeView.getDecorators().remove(promptDecorator);
@@ -180,7 +178,7 @@ public class JSONViewer extends Applicat
}
});
- Map<String, Object> map = (Map<String, Object>)value;
+ Map<String, Object> map = (Map<String, Object>) value;
for (String key : map) {
TreeNode valueNode = build(map.get(key));
@@ -198,7 +196,7 @@ public class JSONViewer extends Applicat
} else if (value instanceof List<?>) {
TreeBranch treeBranch = new TreeBranch("[]");
- List<Object> list = (List<Object>)value;
+ List<Object> list = (List<Object>) value;
for (int i = 0, n = list.getLength(); i < n; i++) {
TreeNode itemNode = build(list.get(i));
Modified: pivot/trunk/demos/src/org/apache/pivot/demos/memorygame/MemGame.java
URL: http://svn.apache.org/viewvc/pivot/trunk/demos/src/org/apache/pivot/demos/memorygame/MemGame.java?rev=1529349&r1=1529348&r2=1529349&view=diff
==============================================================================
--- pivot/trunk/demos/src/org/apache/pivot/demos/memorygame/MemGame.java (original)
+++ pivot/trunk/demos/src/org/apache/pivot/demos/memorygame/MemGame.java Fri Oct 4 23:45:40 2013
@@ -35,7 +35,7 @@ public class MemGame extends Application
private static Random random = new Random();
- private BXMLSerializer bxmlSerializer ;
+ private BXMLSerializer bxmlSerializer;
private String defaultImage = IMG_BASE_FOLDER + "default.gif";
private boolean firstClick = true;
private boolean right = true;
@@ -50,18 +50,16 @@ public class MemGame extends Application
private String[] images36;
private PushButton[] buttons;
-
-
@Override
public void startup(Display display, Map<String, String> properties) throws Exception {
bxmlSerializer = new BXMLSerializer();
window = (Window) bxmlSerializer.readObject(getClass().getResource("memgame.bxml"));
buttons = new PushButton[36];
- for(int aux = 0; aux < 36; aux++){
- buttons[aux] = (PushButton) bxmlSerializer.getNamespace().get(String.valueOf(aux+1));
- buttons[aux].getButtonPressListeners().add(this);
- }
+ for (int aux = 0; aux < 36; aux++) {
+ buttons[aux] = (PushButton) bxmlSerializer.getNamespace().get(String.valueOf(aux + 1));
+ buttons[aux].getButtonPressListeners().add(this);
+ }
prepareGame();
@@ -82,44 +80,44 @@ public class MemGame extends Application
DesktopApplicationContext.main(MemGame.class, args);
}
- private void prepareGame(){
- prepareImagesArray();
+ private void prepareGame() {
+ prepareImagesArray();
- for(int aux = 0; aux < 36; aux++){
- buttons[aux].setButtonData(new MemGameButtonData(defaultImage, images36[aux]));
- buttons[aux].setEnabled(true);
- }
+ for (int aux = 0; aux < 36; aux++) {
+ buttons[aux].setButtonData(new MemGameButtonData(defaultImage, images36[aux]));
+ buttons[aux].setEnabled(true);
+ }
}
- private void prepareImagesArray(){
+ private void prepareImagesArray() {
int positionNumArray, x, y;
this.images18 = new String[18];
- for (x = 0; x < 18; x++){
- this.images18[ x ] = IMG_BASE_FOLDER + ( x + 1 ) + ".gif";
+ for (x = 0; x < 18; x++) {
+ this.images18[x] = IMG_BASE_FOLDER + (x + 1) + ".gif";
}
this.images36 = new String[36];
- for (x = 0; x < 2; x++){
- for (y = 0; y < 18; y++){
+ for (x = 0; x < 2; x++) {
+ for (y = 0; y < 18; y++) {
do {
positionNumArray = random.nextInt(36);
- } while( this.images36[ positionNumArray ] != null );
- this.images36[ positionNumArray ] = images18[ y ];
+ } while (this.images36[positionNumArray] != null);
+ this.images36[positionNumArray] = images18[y];
}
}
}
@Override
public void buttonPressed(Button button) {
- if( firstClick ){
- if ( !right ){
+ if (firstClick) {
+ if (!right) {
buttonOne = (PushButton) clickedButtonOne;
buttonTwo = (PushButton) clickedButtonTwo;
- ((MemGameButtonData)buttonOne.getButtonData()).setDefaultURL();
- ((MemGameButtonData)buttonTwo.getButtonData()).setDefaultURL();
+ ((MemGameButtonData) buttonOne.getButtonData()).setDefaultURL();
+ ((MemGameButtonData) buttonTwo.getButtonData()).setDefaultURL();
window.repaint();
}
@@ -127,38 +125,36 @@ public class MemGame extends Application
clickedButtonOne = button;
buttonOne = (PushButton) clickedButtonOne;
- ((MemGameButtonData)buttonOne.getButtonData()).setButtonURL();
+ ((MemGameButtonData) buttonOne.getButtonData()).setButtonURL();
firstClick = !firstClick;
- }
- else{
+ } else {
clickedButtonTwo = button;
buttonTwo = (PushButton) clickedButtonTwo;
- if ( clickedButtonTwo == clickedButtonOne ){
+ if (clickedButtonTwo == clickedButtonOne) {
right = false;
Alert.alert(MessageType.WARNING, "Not permited action!", window);
- }
- else {
- ((MemGameButtonData)buttonTwo.getButtonData()).setButtonURL();
+ } else {
+ ((MemGameButtonData) buttonTwo.getButtonData()).setButtonURL();
- if ( ((MemGameButtonData)buttonOne.getButtonData()).getButtonURL().equals(
- ((MemGameButtonData)buttonTwo.getButtonData()).getButtonURL())) {
+ if (((MemGameButtonData) buttonOne.getButtonData()).getButtonURL().equals(
+ ((MemGameButtonData) buttonTwo.getButtonData()).getButtonURL())) {
right = true;
++count;
- buttonOne.setEnabled( false );
- buttonTwo.setEnabled( false );
- }
- else {
+ buttonOne.setEnabled(false);
+ buttonTwo.setEnabled(false);
+ } else {
right = false;
}
firstClick = !firstClick;
- if(count == 18){
+ if (count == 18) {
prepareGame();
- Alert.alert(MessageType.INFO, "Congratulations! You got a new challenge!", window);
- count=0;
+ Alert.alert(MessageType.INFO, "Congratulations! You got a new challenge!",
+ window);
+ count = 0;
}
}
}
Modified: pivot/trunk/demos/src/org/apache/pivot/demos/memorygame/MemGameButtonData.java
URL: http://svn.apache.org/viewvc/pivot/trunk/demos/src/org/apache/pivot/demos/memorygame/MemGameButtonData.java?rev=1529349&r1=1529348&r2=1529349&view=diff
==============================================================================
--- pivot/trunk/demos/src/org/apache/pivot/demos/memorygame/MemGameButtonData.java (original)
+++ pivot/trunk/demos/src/org/apache/pivot/demos/memorygame/MemGameButtonData.java Fri Oct 4 23:45:40 2013
@@ -30,15 +30,15 @@ public class MemGameButtonData extends B
setDefaultURL();
}
- public void setDefaultURL(){
+ public void setDefaultURL() {
this.setIcon(defaultURL);
}
- public void setButtonURL(){
+ public void setButtonURL() {
this.setIcon(buttonURL);
}
- public Image getButtonURL(){
+ public Image getButtonURL() {
return this.getIcon();
}
Modified: pivot/trunk/demos/src/org/apache/pivot/demos/million/LargeData.java
URL: http://svn.apache.org/viewvc/pivot/trunk/demos/src/org/apache/pivot/demos/million/LargeData.java?rev=1529349&r1=1529348&r2=1529349&view=diff
==============================================================================
--- pivot/trunk/demos/src/org/apache/pivot/demos/million/LargeData.java (original)
+++ pivot/trunk/demos/src/org/apache/pivot/demos/million/LargeData.java Fri Oct 4 23:45:40 2013
@@ -50,7 +50,8 @@ import org.apache.pivot.wtk.Window;
import org.apache.pivot.wtk.content.TableViewRowComparator;
public class LargeData extends Application.Adapter {
- private static String USER_HOME; // useful for local tests as Java Application
+ private static String USER_HOME; // useful for local tests as Java
+ // Application
URL origin = null;
@@ -71,26 +72,27 @@ public class LargeData extends Applicati
CSVSerializer csvSerializer = new CSVSerializer();
csvSerializer.setKeys("c0", "c1", "c2", "c3");
- csvSerializer.getCSVSerializerListeners().add(new CSVSerializerListener.Adapter() {
- private ArrayList<Object> page = new ArrayList<>(pageSize);
-
- @Override
- public void endList(CSVSerializer csvSerializerArgument) {
- if (page.getLength() > 0) {
- ApplicationContext.queueCallback(new AddRowsCallback(page));
+ csvSerializer.getCSVSerializerListeners().add(
+ new CSVSerializerListener.Adapter() {
+ private ArrayList<Object> page = new ArrayList<>(pageSize);
+
+ @Override
+ public void endList(CSVSerializer csvSerializerArgument) {
+ if (page.getLength() > 0) {
+ ApplicationContext.queueCallback(new AddRowsCallback(page));
+ }
}
- }
- @Override
- public void readItem(CSVSerializer csvSerializerArgument, Object item) {
- page.add(item);
-
- if (page.getLength() == pageSize) {
- ApplicationContext.queueCallback(new AddRowsCallback(page));
- page = new ArrayList<>(pageSize);
+ @Override
+ public void readItem(CSVSerializer csvSerializerArgument, Object item) {
+ page.add(item);
+
+ if (page.getLength() == pageSize) {
+ ApplicationContext.queueCallback(new AddRowsCallback(page));
+ page = new ArrayList<>(pageSize);
+ }
}
- }
- });
+ });
csvSerializer.readObject(inputStream);
} finally {
@@ -98,9 +100,9 @@ public class LargeData extends Applicati
inputStream.close();
}
}
- } catch(IOException exception) {
+ } catch (IOException exception) {
throw new TaskExecutionException(exception);
- } catch(SerializationException exception) {
+ } catch (SerializationException exception) {
throw new TaskExecutionException(exception);
}
@@ -118,7 +120,7 @@ public class LargeData extends Applicati
@Override
public void run() {
@SuppressWarnings("unchecked")
- List<Object> tableData = (List<Object>)tableView.getTableData();
+ List<Object> tableData = (List<Object>) tableView.getTableData();
for (Object item : page) {
tableData.add(item);
}
@@ -148,7 +150,8 @@ public class LargeData extends Applicati
origin = ApplicationContext.getOrigin();
if (origin == null) {
- System.out.println("Running as a Standalone Java Application, with user home: \"" + USER_HOME + "\"");
+ System.out.println("Running as a Standalone Java Application, with user home: \""
+ + USER_HOME + "\"");
if (USER_HOME != null) {
System.out.println("Set as origin the user home");
origin = (new File(USER_HOME).toURI()).toURL();
@@ -156,23 +159,25 @@ public class LargeData extends Applicati
}
BXMLSerializer bxmlSerializer = new BXMLSerializer();
- window = (Window)bxmlSerializer.readObject(LargeData.class, "large_data.bxml");
- fileListButton = (ListButton)bxmlSerializer.getNamespace().get("fileListButton");
- loadDataButton = (PushButton)bxmlSerializer.getNamespace().get("loadDataButton");
- cancelButton = (PushButton)bxmlSerializer.getNamespace().get("cancelButton");
- statusLabel = (Label)bxmlSerializer.getNamespace().get("statusLabel");
- tableView = (TableView)bxmlSerializer.getNamespace().get("tableView");
-
- fileListButton.getListButtonSelectionListeners().add(new ListButtonSelectionListener.Adapter() {
- @Override
- public void selectedItemChanged(ListButton listButtonArgument, Object previousSelectedItem) {
- Object selectedItem = listButtonArgument.getSelectedItem();
+ window = (Window) bxmlSerializer.readObject(LargeData.class, "large_data.bxml");
+ fileListButton = (ListButton) bxmlSerializer.getNamespace().get("fileListButton");
+ loadDataButton = (PushButton) bxmlSerializer.getNamespace().get("loadDataButton");
+ cancelButton = (PushButton) bxmlSerializer.getNamespace().get("cancelButton");
+ statusLabel = (Label) bxmlSerializer.getNamespace().get("statusLabel");
+ tableView = (TableView) bxmlSerializer.getNamespace().get("tableView");
- System.out.println("Selected: " + selectedItem.toString()
- + ", now clear table data ...");
- tableView.getTableData().clear(); // empty the table
- }
- });
+ fileListButton.getListButtonSelectionListeners().add(
+ new ListButtonSelectionListener.Adapter() {
+ @Override
+ public void selectedItemChanged(ListButton listButtonArgument,
+ Object previousSelectedItem) {
+ Object selectedItem = listButtonArgument.getSelectedItem();
+
+ System.out.println("Selected: " + selectedItem.toString()
+ + ", now clear table data ...");
+ tableView.getTableData().clear(); // empty the table
+ }
+ });
loadDataButton.getButtonPressListeners().add(new ButtonPressListener() {
@Override
@@ -200,7 +205,7 @@ public class LargeData extends Applicati
@Override
public void sortChanged(TableView tableViewArgument) {
@SuppressWarnings("unchecked")
- List<Object> tableData = (List<Object>)tableViewArgument.getTableData();
+ List<Object> tableData = (List<Object>) tableViewArgument.getTableData();
long startTime = System.currentTimeMillis();
tableData.setComparator(new TableViewRowComparator(tableViewArgument));
@@ -224,17 +229,17 @@ public class LargeData extends Applicati
private void loadData() {
int index = fileListButton.getSelectedIndex();
- int capacity = (int)Math.pow(10, index + 1);
+ int capacity = (int) Math.pow(10, index + 1);
tableView.setTableData(new ArrayList<>(capacity));
pageSize = Math.max(capacity / 1000, 100);
- String fileName = (String)fileListButton.getSelectedItem();
+ String fileName = (String) fileListButton.getSelectedItem();
URL fileURL = null;
try {
fileURL = new URL(origin, basePath + "/" + fileName);
- } catch(MalformedURLException exception) {
+ } catch (MalformedURLException exception) {
System.err.println(exception.getMessage());
}
@@ -276,10 +281,11 @@ public class LargeData extends Applicati
public static void main(String[] args) {
try {
- // moved here because in some cases (for example when running as unsigned code via Web Start) this would not be accessible
+ // moved here because in some cases (for example when running as
+ // unsigned code via Web Start) this would not be accessible
USER_HOME = System.getProperty("user.home");
} catch (Exception e) {
- // e.printStackTrace(); // ignore the exception, and set a fallback
+ // e.printStackTrace(); // ignore the exception, and set a fallback
USER_HOME = null;
}
Modified: pivot/trunk/demos/src/org/apache/pivot/demos/rest/RESTDemoTest.java
URL: http://svn.apache.org/viewvc/pivot/trunk/demos/src/org/apache/pivot/demos/rest/RESTDemoTest.java?rev=1529349&r1=1529348&r2=1529349&view=diff
==============================================================================
--- pivot/trunk/demos/src/org/apache/pivot/demos/rest/RESTDemoTest.java (original)
+++ pivot/trunk/demos/src/org/apache/pivot/demos/rest/RESTDemoTest.java Fri Oct 4 23:45:40 2013
@@ -16,6 +16,10 @@
*/
package org.apache.pivot.demos.rest;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+
import java.io.IOException;
import java.net.URL;
@@ -31,10 +35,6 @@ import org.apache.pivot.web.QueryExcepti
import org.junit.BeforeClass;
import org.junit.Test;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-
public class RESTDemoTest {
private static String hostname = null;
private static int port = -1;
@@ -44,7 +44,8 @@ public class RESTDemoTest {
public static void oneTimeSetUp() {
hostname = System.getProperty("org.apache.pivot.demos.rest.hostname", "localhost");
port = Integer.parseInt(System.getProperty("org.apache.pivot.demos.rest.port", "-1"));
- secure = Boolean.parseBoolean(System.getProperty("org.apache.pivot.demos.rest.secure", "false"));
+ secure = Boolean.parseBoolean(System.getProperty("org.apache.pivot.demos.rest.secure",
+ "false"));
}
@Test
@@ -84,7 +85,7 @@ public class RESTDemoTest {
assertEquals(deleteQuery.getStatus(), Query.Status.NO_CONTENT);
}
- @Test(expected=QueryException.class)
+ @Test(expected = QueryException.class)
public void testException() throws QueryException {
GetQuery getQuery = new GetQuery(hostname, port, "/pivot-demos/rest_demo/foo", secure);
getQuery.execute();
Modified: pivot/trunk/demos/src/org/apache/pivot/demos/roweditor/AmountBindMapping.java
URL: http://svn.apache.org/viewvc/pivot/trunk/demos/src/org/apache/pivot/demos/roweditor/AmountBindMapping.java?rev=1529349&r1=1529348&r2=1529349&view=diff
==============================================================================
--- pivot/trunk/demos/src/org/apache/pivot/demos/roweditor/AmountBindMapping.java (original)
+++ pivot/trunk/demos/src/org/apache/pivot/demos/roweditor/AmountBindMapping.java Fri Oct 4 23:45:40 2013
@@ -31,7 +31,8 @@ public class AmountBindMapping implement
@Override
public Object valueOf(String text) {
- // in case of an empty string to validate, return a default value, to avoid an NPE
+ // in case of an empty string to validate, return a default value, to
+ // avoid an NPE
if (text.length() < 1)
return "";
Modified: pivot/trunk/demos/src/org/apache/pivot/demos/roweditor/CurrencyValidator.java
URL: http://svn.apache.org/viewvc/pivot/trunk/demos/src/org/apache/pivot/demos/roweditor/CurrencyValidator.java?rev=1529349&r1=1529348&r2=1529349&view=diff
==============================================================================
--- pivot/trunk/demos/src/org/apache/pivot/demos/roweditor/CurrencyValidator.java (original)
+++ pivot/trunk/demos/src/org/apache/pivot/demos/roweditor/CurrencyValidator.java Fri Oct 4 23:45:40 2013
@@ -38,11 +38,8 @@ public class CurrencyValidator implement
if (text.length() > 0) {
ParsePosition parsePosition = new ParsePosition(0);
BigDecimal numericAmount = (BigDecimal) FORMAT.parse(text, parsePosition);
- valid = (numericAmount != null &&
- numericAmount.scale() <= 2 &&
- numericAmount.signum() >= 0 &&
- parsePosition.getErrorIndex() == -1 &&
- parsePosition.getIndex() == text.length());
+ valid = (numericAmount != null && numericAmount.scale() <= 2
+ && numericAmount.signum() >= 0 && parsePosition.getErrorIndex() == -1 && parsePosition.getIndex() == text.length());
}
return valid;
Modified: pivot/trunk/demos/src/org/apache/pivot/demos/roweditor/RowEditorDemo.java
URL: http://svn.apache.org/viewvc/pivot/trunk/demos/src/org/apache/pivot/demos/roweditor/RowEditorDemo.java?rev=1529349&r1=1529348&r2=1529349&view=diff
==============================================================================
--- pivot/trunk/demos/src/org/apache/pivot/demos/roweditor/RowEditorDemo.java (original)
+++ pivot/trunk/demos/src/org/apache/pivot/demos/roweditor/RowEditorDemo.java Fri Oct 4 23:45:40 2013
@@ -37,14 +37,16 @@ public class RowEditorDemo extends Appli
String language = properties.get(LANGUAGE_KEY);
Locale locale = (language == null) ? Locale.getDefault() : new Locale(language);
Resources resources = new Resources(RESOURCE_NAME, locale);
- System.out.println("Loaded Resources from: " + resources.getBaseName() + ", for locale " + locale);
+ System.out.println("Loaded Resources from: " + resources.getBaseName() + ", for locale "
+ + locale);
// Search for a font that can support the sample string
- String title = (String)resources.get("title");
+ String title = (String) resources.get("title");
System.out.println("Title from Resources file is: \"" + title + "\"");
BXMLSerializer bxmlSerializer = new BXMLSerializer();
- window = (Window)bxmlSerializer.readObject(RowEditorDemo.class.getResource("row_editor_demo.bxml"), resources);
+ window = (Window) bxmlSerializer.readObject(
+ RowEditorDemo.class.getResource("row_editor_demo.bxml"), resources);
window.open(display);
}
Modified: pivot/trunk/demos/src/org/apache/pivot/demos/rss/RSSFeedDemo.java
URL: http://svn.apache.org/viewvc/pivot/trunk/demos/src/org/apache/pivot/demos/rss/RSSFeedDemo.java?rev=1529349&r1=1529348&r2=1529349&view=diff
==============================================================================
--- pivot/trunk/demos/src/org/apache/pivot/demos/rss/RSSFeedDemo.java (original)
+++ pivot/trunk/demos/src/org/apache/pivot/demos/rss/RSSFeedDemo.java Fri Oct 4 23:45:40 2013
@@ -47,38 +47,39 @@ public class RSSFeedDemo extends Window
@Override
public void initialize(Map<String, Object> namespace, URL location, Resources resources) {
- feedListView = (ListView)namespace.get("feedListView");
- cardPane = (CardPane)namespace.get("cardPane");
- statusLabel = (Label)namespace.get("statusLabel");
-
- feedListView.getComponentMouseButtonListeners().add(new ComponentMouseButtonListener.Adapter() {
- private int index = -1;
-
- @Override
- public boolean mouseClick(Component component, Mouse.Button button, int x, int y, int count) {
- if (count == 1) {
- index = feedListView.getItemAt(y);
- } else if (count == 2
- && feedListView.getItemAt(y) == index) {
- Element itemElement = (Element)feedListView.getListData().get(index);
-
- String link = XML.getText(itemElement, "link");
- Desktop desktop = Desktop.getDesktop();
-
- try {
- desktop.browse(new URL(link).toURI());
- } catch(MalformedURLException exception) {
- throw new RuntimeException(exception);
- } catch(URISyntaxException exception) {
- throw new RuntimeException(exception);
- } catch(IOException exception) {
- System.out.println("Unable to open " + link + " in default browser.");
+ feedListView = (ListView) namespace.get("feedListView");
+ cardPane = (CardPane) namespace.get("cardPane");
+ statusLabel = (Label) namespace.get("statusLabel");
+
+ feedListView.getComponentMouseButtonListeners().add(
+ new ComponentMouseButtonListener.Adapter() {
+ private int index = -1;
+
+ @Override
+ public boolean mouseClick(Component component, Mouse.Button button, int x, int y,
+ int count) {
+ if (count == 1) {
+ index = feedListView.getItemAt(y);
+ } else if (count == 2 && feedListView.getItemAt(y) == index) {
+ Element itemElement = (Element) feedListView.getListData().get(index);
+
+ String link = XML.getText(itemElement, "link");
+ Desktop desktop = Desktop.getDesktop();
+
+ try {
+ desktop.browse(new URL(link).toURI());
+ } catch (MalformedURLException exception) {
+ throw new RuntimeException(exception);
+ } catch (URISyntaxException exception) {
+ throw new RuntimeException(exception);
+ } catch (IOException exception) {
+ System.out.println("Unable to open " + link + " in default browser.");
+ }
}
- }
- return false;
- }
- });
+ return false;
+ }
+ });
GetQuery getQuery = new GetQuery("feeds.dzone.com", "/javalobby/frontpage");
getQuery.setSerializer(new XMLSerializer());
@@ -87,7 +88,7 @@ public class RSSFeedDemo extends Window
getQuery.execute(new TaskAdapter<>(new TaskListener<Object>() {
@Override
public void taskExecuted(Task<Object> task) {
- Element root = (Element)task.getResult();
+ Element root = (Element) task.getResult();
feedListView.setListData(XML.getElements(root, "channel", "item"));
cardPane.setSelectedIndex(1);
}
Modified: pivot/trunk/demos/src/org/apache/pivot/demos/rss/RSSItemRenderer.java
URL: http://svn.apache.org/viewvc/pivot/trunk/demos/src/org/apache/pivot/demos/rss/RSSItemRenderer.java?rev=1529349&r1=1529348&r2=1529349&view=diff
==============================================================================
--- pivot/trunk/demos/src/org/apache/pivot/demos/rss/RSSItemRenderer.java (original)
+++ pivot/trunk/demos/src/org/apache/pivot/demos/rss/RSSItemRenderer.java Fri Oct 4 23:45:40 2013
@@ -63,7 +63,7 @@ public class RSSItemRenderer extends Box
public void render(Object item, int index, ListView listView, boolean selected,
boolean checked, boolean highlighted, boolean disabled) {
if (item != null) {
- Element itemElement = (Element)item;
+ Element itemElement = (Element) item;
String title = XML.getText(itemElement, "title");
titleLabel.setText(title);
@@ -72,7 +72,7 @@ public class RSSItemRenderer extends Box
List<Element> categoryElements = itemElement.getElements("category");
for (int i = 0, n = categoryElements.getLength(); i < n; i++) {
Element categoryElement = categoryElements.get(i);
- TextNode categoryTextNode = (TextNode)categoryElement.get(0);
+ TextNode categoryTextNode = (TextNode) categoryElement.get(0);
String category = categoryTextNode.getText();
if (i > 0) {
@@ -88,7 +88,7 @@ public class RSSItemRenderer extends Box
submitterLabel.setText("Submitter: " + submitter);
}
- Font font = (Font)listView.getStyles().get("font");
+ Font font = (Font) listView.getStyles().get("font");
Font largeFont = font.deriveFont(Font.BOLD, 14);
titleLabel.getStyles().put("font", largeFont);
categoriesLabel.getStyles().put("font", font);
@@ -98,15 +98,15 @@ public class RSSItemRenderer extends Box
if (listView.isEnabled() && !disabled) {
if (selected) {
if (listView.isFocused()) {
- color = (Color)listView.getStyles().get("selectionColor");
+ color = (Color) listView.getStyles().get("selectionColor");
} else {
- color = (Color)listView.getStyles().get("inactiveSelectionColor");
+ color = (Color) listView.getStyles().get("inactiveSelectionColor");
}
} else {
- color = (Color)listView.getStyles().get("color");
+ color = (Color) listView.getStyles().get("color");
}
} else {
- color = (Color)listView.getStyles().get("disabledColor");
+ color = (Color) listView.getStyles().get("disabledColor");
}
titleLabel.getStyles().put("color", color);
@@ -116,6 +116,6 @@ public class RSSItemRenderer extends Box
@Override
public String toString(Object item) {
- return XML.getText((Element)item, "title");
+ return XML.getText((Element) item, "title");
}
}
Modified: pivot/trunk/demos/src/org/apache/pivot/demos/styles/ColorSchemeBuilder.java
URL: http://svn.apache.org/viewvc/pivot/trunk/demos/src/org/apache/pivot/demos/styles/ColorSchemeBuilder.java?rev=1529349&r1=1529348&r2=1529349&view=diff
==============================================================================
--- pivot/trunk/demos/src/org/apache/pivot/demos/styles/ColorSchemeBuilder.java (original)
+++ pivot/trunk/demos/src/org/apache/pivot/demos/styles/ColorSchemeBuilder.java Fri Oct 4 23:45:40 2013
@@ -27,8 +27,8 @@ public class ColorSchemeBuilder extends
@Override
public void startup(Display display, Map<String, String> properties) throws Exception {
BXMLSerializer bxmlSerializer = new BXMLSerializer();
- window = (ColorSchemeBuilderWindow)bxmlSerializer.readObject(ColorSchemeBuilderWindow.class,
- "color_scheme_builder_window.bxml");
+ window = (ColorSchemeBuilderWindow) bxmlSerializer.readObject(
+ ColorSchemeBuilderWindow.class, "color_scheme_builder_window.bxml");
window.open(display);
}
Modified: pivot/trunk/demos/src/org/apache/pivot/demos/styles/ColorSchemeBuilderWindow.java
URL: http://svn.apache.org/viewvc/pivot/trunk/demos/src/org/apache/pivot/demos/styles/ColorSchemeBuilderWindow.java?rev=1529349&r1=1529348&r2=1529349&view=diff
==============================================================================
--- pivot/trunk/demos/src/org/apache/pivot/demos/styles/ColorSchemeBuilderWindow.java (original)
+++ pivot/trunk/demos/src/org/apache/pivot/demos/styles/ColorSchemeBuilderWindow.java Fri Oct 4 23:45:40 2013
@@ -52,16 +52,20 @@ import org.apache.pivot.wtk.content.Spin
import org.apache.pivot.wtk.skin.terra.TerraTheme;
public class ColorSchemeBuilderWindow extends Window implements Bindable {
- @BXML private TablePane colorChooserTablePane = null;
- @BXML private TablePane colorPaletteTablePane = null;
- @BXML private PushButton copyToClipboardButton = null;
- @BXML private PushButton resetPaletteButton = null;
- @BXML private Border sampleContentBorder = null;
+ @BXML
+ private TablePane colorChooserTablePane = null;
+ @BXML
+ private TablePane colorPaletteTablePane = null;
+ @BXML
+ private PushButton copyToClipboardButton = null;
+ @BXML
+ private PushButton resetPaletteButton = null;
+ @BXML
+ private Border sampleContentBorder = null;
private ArrayList<ColorChooserButton> colorChooserButtons = new ArrayList<>();
private ArrayList<Color> themeOriginalColors = new ArrayList<>(8);
-
@Override
public void initialize(Map<String, Object> namespace, URL location, Resources resources) {
createColorPalette();
@@ -73,7 +77,8 @@ public class ColorSchemeBuilderWindow ex
NumericSpinnerData colorSpinnerData = new NumericSpinnerData(0, 255);
SpinnerItemRenderer colorSpinnerItemRenderer = new SpinnerItemRenderer();
- colorSpinnerItemRenderer.getStyles().put("horizontalAlignment", HorizontalAlignment.RIGHT);
+ colorSpinnerItemRenderer.getStyles().put("horizontalAlignment",
+ HorizontalAlignment.RIGHT);
final Spinner redSpinner = new Spinner();
redSpinner.setSpinnerData(colorSpinnerData);
@@ -107,8 +112,7 @@ public class ColorSchemeBuilderWindow ex
colorChooserTablePane.getRows().add(row);
// Add listeners
- ColorChooserButtonSelectionListener colorChooserButtonSelectionListener =
- new ColorChooserButtonSelectionListener() {
+ ColorChooserButtonSelectionListener colorChooserButtonSelectionListener = new ColorChooserButtonSelectionListener() {
@Override
public void selectedColorChanged(ColorChooserButton colorChooserButtonArgument,
Color previousSelectedColor) {
@@ -118,14 +122,16 @@ public class ColorSchemeBuilderWindow ex
blueSpinner.setSelectedItem(selectedColor.getBlue());
// Update the theme
- TerraTheme terraTheme = (TerraTheme)Theme.getTheme();
+ TerraTheme terraTheme = (TerraTheme) Theme.getTheme();
int iLocal = colorChooserButtons.indexOf(colorChooserButtonArgument);
- terraTheme.setBaseColor(iLocal, colorChooserButtons.get(iLocal).getSelectedColor());
+ terraTheme.setBaseColor(iLocal,
+ colorChooserButtons.get(iLocal).getSelectedColor());
// Update the palette
int offset = iLocal * 3;
for (int j = 0; j < 3; j++) {
- Component colorPaletteCell = colorPaletteTablePane.getRows().get(iLocal).get(j);
+ Component colorPaletteCell = colorPaletteTablePane.getRows().get(iLocal).get(
+ j);
colorPaletteCell.getStyles().put("backgroundColor", offset + j);
}
@@ -133,14 +139,15 @@ public class ColorSchemeBuilderWindow ex
}
};
- colorChooserButton.getColorChooserButtonSelectionListeners().add(colorChooserButtonSelectionListener);
+ colorChooserButton.getColorChooserButtonSelectionListeners().add(
+ colorChooserButtonSelectionListener);
SpinnerSelectionListener spinnerSelectionListener = new SpinnerSelectionListener.Adapter() {
@Override
public void selectedItemChanged(Spinner spinner, Object previousSelectedItem) {
- int red = (Integer)redSpinner.getSelectedItem();
- int green = (Integer)greenSpinner.getSelectedItem();
- int blue = (Integer)blueSpinner.getSelectedItem();
+ int red = (Integer) redSpinner.getSelectedItem();
+ int green = (Integer) greenSpinner.getSelectedItem();
+ int blue = (Integer) blueSpinner.getSelectedItem();
colorChooserButton.setSelectedColor(new Color(red, green, blue));
}
@@ -151,7 +158,7 @@ public class ColorSchemeBuilderWindow ex
blueSpinner.getSpinnerSelectionListeners().add(spinnerSelectionListener);
// Initialize the button color with the theme default
- TerraTheme terraTheme = (TerraTheme)Theme.getTheme();
+ TerraTheme terraTheme = (TerraTheme) Theme.getTheme();
themeOriginalColors.add(terraTheme.getBaseColor(i));
colorChooserButton.setSelectedColor(terraTheme.getBaseColor(i));
}
@@ -198,7 +205,7 @@ public class ColorSchemeBuilderWindow ex
Border border = new Border();
border.getStyles().put("backgroundColor", index);
- TerraTheme terraTheme = (TerraTheme)Theme.getTheme();
+ TerraTheme terraTheme = (TerraTheme) Theme.getTheme();
Label label = new Label();
label.setText(Integer.toString(index));
@@ -221,8 +228,8 @@ public class ColorSchemeBuilderWindow ex
BXMLSerializer bxmlSerializer = new BXMLSerializer();
try {
- Component sampleContent = (Component)bxmlSerializer.readObject(ColorSchemeBuilderWindow.class,
- "sample_content.bxml");
+ Component sampleContent = (Component) bxmlSerializer.readObject(
+ ColorSchemeBuilderWindow.class, "sample_content.bxml");
sampleContentBorder.setContent(sampleContent);
} catch (IOException exception) {
throw new RuntimeException(exception);
@@ -236,9 +243,7 @@ public class ColorSchemeBuilderWindow ex
for (int i = 0; i < 8; i++) {
ColorChooserButton colorChooserButton = colorChooserButtons.get(i);
Color color = colorChooserButton.getSelectedColor();
- colors.add(String.format("#%02X%02X%02X",
- color.getRed(),
- color.getGreen(),
+ colors.add(String.format("#%02X%02X%02X", color.getRed(), color.getGreen(),
color.getBlue()));
}
@@ -261,9 +266,7 @@ public class ColorSchemeBuilderWindow ex
colorChooserButton.setSelectedColor(themeOriginalColors.get(i));
Color color = colorChooserButton.getSelectedColor();
- colors.add(String.format("#%02X%02X%02X",
- color.getRed(),
- color.getGreen(),
+ colors.add(String.format("#%02X%02X%02X", color.getRed(), color.getGreen(),
color.getBlue()));
}
Modified: pivot/trunk/demos/src/org/apache/pivot/demos/suggest/SuggestionDemo.java
URL: http://svn.apache.org/viewvc/pivot/trunk/demos/src/org/apache/pivot/demos/suggest/SuggestionDemo.java?rev=1529349&r1=1529348&r2=1529349&view=diff
==============================================================================
--- pivot/trunk/demos/src/org/apache/pivot/demos/suggest/SuggestionDemo.java (original)
+++ pivot/trunk/demos/src/org/apache/pivot/demos/suggest/SuggestionDemo.java Fri Oct 4 23:45:40 2013
@@ -50,8 +50,8 @@ public class SuggestionDemo extends Wind
@Override
public void initialize(Map<String, Object> namespace, URL location, Resources resources) {
- textInput = (TextInput)namespace.get("textInput");
- activityIndicator = (ActivityIndicator)namespace.get("activityIndicator");
+ textInput = (TextInput) namespace.get("textInput");
+ activityIndicator = (ActivityIndicator) namespace.get("activityIndicator");
textInput.getTextInputContentListeners().add(new TextInputContentListener.Adapter() {
@Override
@@ -77,8 +77,7 @@ public class SuggestionDemo extends Wind
}
private void getSuggestions() {
- if (suggestionQuery != null
- && suggestionQuery.isPending()) {
+ if (suggestionQuery != null && suggestionQuery.isPending()) {
suggestionQuery.abort();
}
@@ -91,7 +90,8 @@ public class SuggestionDemo extends Wind
}
// Create query
- suggestionQuery = new GetQuery("search.yahooapis.com", "/WebSearchService/V1/relatedSuggestion");
+ suggestionQuery = new GetQuery("search.yahooapis.com",
+ "/WebSearchService/V1/relatedSuggestion");
suggestionQuery.getParameters().put("appid", getClass().getName());
suggestionQuery.getParameters().put("query", text);
suggestionQuery.getParameters().put("output", "json");
@@ -104,17 +104,17 @@ public class SuggestionDemo extends Wind
Object result = JSON.get(task.getResult(), "ResultSet.Result");
if (result instanceof List<?>) {
- suggestions = (List<?>)result;
+ suggestions = (List<?>) result;
}
- if (suggestions == null
- || suggestions.getLength() == 0) {
+ if (suggestions == null || suggestions.getLength() == 0) {
suggestionPopup.close();
} else {
suggestionPopup.setSuggestionData(suggestions);
suggestionPopup.open(textInput, new SuggestionPopupCloseListener() {
@Override
- public void suggestionPopupClosed(SuggestionPopup suggestionPopupArgument) {
+ public void suggestionPopupClosed(
+ SuggestionPopup suggestionPopupArgument) {
if (suggestionPopupArgument.getResult()) {
String textLocal;
try {
@@ -123,7 +123,8 @@ public class SuggestionDemo extends Wind
throw new RuntimeException(exception);
}
- String location = "http://search.yahoo.com/search?p=" + textLocal;
+ String location = "http://search.yahoo.com/search?p="
+ + textLocal;
try {
Desktop.getDesktop().browse(new URI(location));
Modified: pivot/trunk/demos/src/org/apache/pivot/demos/swing/SwingDemo.java
URL: http://svn.apache.org/viewvc/pivot/trunk/demos/src/org/apache/pivot/demos/swing/SwingDemo.java?rev=1529349&r1=1529348&r2=1529349&view=diff
==============================================================================
--- pivot/trunk/demos/src/org/apache/pivot/demos/swing/SwingDemo.java (original)
+++ pivot/trunk/demos/src/org/apache/pivot/demos/swing/SwingDemo.java Fri Oct 4 23:45:40 2013
@@ -24,9 +24,9 @@ import javax.swing.ButtonGroup;
import javax.swing.JApplet;
import javax.swing.JButton;
import javax.swing.JCheckBox;
-import javax.swing.JInternalFrame;
import javax.swing.JDesktopPane;
import javax.swing.JFrame;
+import javax.swing.JInternalFrame;
import javax.swing.JLabel;
import javax.swing.JProgressBar;
import javax.swing.JRadioButton;
@@ -153,7 +153,7 @@ public class SwingDemo extends Applicati
BXMLSerializer bxmlSerializer = new BXMLSerializer();
Window window;
try {
- window = (Window)bxmlSerializer.readObject(SwingDemo.class.getResource("pivot_window.bxml"));
+ window = (Window) bxmlSerializer.readObject(SwingDemo.class.getResource("pivot_window.bxml"));
} catch (IOException exception) {
throw new RuntimeException(exception);
} catch (SerializationException exception) {
Modified: pivot/trunk/demos/src/org/apache/pivot/demos/tables/FixedColumnTableDemo.java
URL: http://svn.apache.org/viewvc/pivot/trunk/demos/src/org/apache/pivot/demos/tables/FixedColumnTableDemo.java?rev=1529349&r1=1529348&r2=1529349&view=diff
==============================================================================
--- pivot/trunk/demos/src/org/apache/pivot/demos/tables/FixedColumnTableDemo.java (original)
+++ pivot/trunk/demos/src/org/apache/pivot/demos/tables/FixedColumnTableDemo.java Fri Oct 4 23:45:40 2013
@@ -38,8 +38,8 @@ public class FixedColumnTableDemo extend
@Override
public void initialize(Map<String, Object> namespace, URL location, Resources resources) {
- primaryTableView = (TableView)namespace.get("primaryTableView");
- fixedTableView = (TableView)namespace.get("fixedTableView");
+ primaryTableView = (TableView) namespace.get("primaryTableView");
+ fixedTableView = (TableView) namespace.get("fixedTableView");
// Keep selection state in sync
primaryTableView.getTableViewSelectionListeners().add(new TableViewSelectionListener() {
@@ -62,9 +62,9 @@ public class FixedColumnTableDemo extend
}
@Override
- public void selectedRangesChanged(TableView tableView, Sequence<Span> previousSelectedRanges) {
- if (previousSelectedRanges != null
- && !synchronizingSelection) {
+ public void selectedRangesChanged(TableView tableView,
+ Sequence<Span> previousSelectedRanges) {
+ if (previousSelectedRanges != null && !synchronizingSelection) {
synchronizingSelection = true;
fixedTableView.setSelectedRanges(tableView.getSelectedRanges());
synchronizingSelection = false;
@@ -97,9 +97,9 @@ public class FixedColumnTableDemo extend
}
@Override
- public void selectedRangesChanged(TableView tableView, Sequence<Span> previousSelectedRanges) {
- if (previousSelectedRanges != null
- && !synchronizingSelection) {
+ public void selectedRangesChanged(TableView tableView,
+ Sequence<Span> previousSelectedRanges) {
+ if (previousSelectedRanges != null && !synchronizingSelection) {
synchronizingSelection = true;
primaryTableView.setSelectedRanges(tableView.getSelectedRanges());
synchronizingSelection = false;
@@ -121,7 +121,7 @@ public class FixedColumnTableDemo extend
}
@SuppressWarnings("unchecked")
- List<Object> tableData = (List<Object>)tableView.getTableData();
+ List<Object> tableData = (List<Object>) tableView.getTableData();
tableData.setComparator(new TableViewRowComparator(tableView));
}
});
@@ -134,7 +134,7 @@ public class FixedColumnTableDemo extend
}
@SuppressWarnings("unchecked")
- List<Object> tableData = (List<Object>)tableView.getTableData();
+ List<Object> tableData = (List<Object>) tableView.getTableData();
tableData.setComparator(new TableViewRowComparator(tableView));
}
});
Modified: pivot/trunk/demos/src/org/apache/pivot/demos/text/TextPaneDemo.java
URL: http://svn.apache.org/viewvc/pivot/trunk/demos/src/org/apache/pivot/demos/text/TextPaneDemo.java?rev=1529349&r1=1529348&r2=1529349&view=diff
==============================================================================
--- pivot/trunk/demos/src/org/apache/pivot/demos/text/TextPaneDemo.java (original)
+++ pivot/trunk/demos/src/org/apache/pivot/demos/text/TextPaneDemo.java Fri Oct 4 23:45:40 2013
@@ -91,11 +91,11 @@ public class TextPaneDemo extends Applic
@BXML
private Checkbox wrapTextCheckbox = null;
@BXML
- private PushButton alignLeftButton= null;
+ private PushButton alignLeftButton = null;
@BXML
- private PushButton alignCentreButton= null;
+ private PushButton alignCentreButton = null;
@BXML
- private PushButton alignRightButton= null;
+ private PushButton alignRightButton = null;
private File loadedFile = null;
@@ -105,17 +105,17 @@ public class TextPaneDemo extends Applic
@Override
public void startup(Display display, Map<String, String> properties) throws Exception {
BXMLSerializer bxmlSerializer = new BXMLSerializer();
- window = (Window)bxmlSerializer.readObject(TextPaneDemo.class, "text_pane_demo.bxml");
+ window = (Window) bxmlSerializer.readObject(TextPaneDemo.class, "text_pane_demo.bxml");
bxmlSerializer.bind(this, TextPaneDemo.class);
window.setTitle("Apache Pivot Rich Text Editor Demo");
// make the text on the "bold" button bold
- Font boldButtonFont = (Font)boldButton.getStyles().get("font");
+ Font boldButtonFont = (Font) boldButton.getStyles().get("font");
boldButton.getStyles().put("font", boldButtonFont.deriveFont(Font.BOLD));
// make the text on the "italic" button italic
- Font italicButtonFont = (Font)italicButton.getStyles().get("font");
+ Font italicButtonFont = (Font) italicButton.getStyles().get("font");
italicButton.getStyles().put("font", italicButtonFont.deriveFont(Font.ITALIC));
fontFamilyListButton.setListData(new ArrayList<>(
@@ -127,7 +127,7 @@ public class TextPaneDemo extends Applic
boolean checked, boolean highlighted, boolean disabled) {
super.render(item, index, listView, selected, checked, highlighted, disabled);
if (item != null) {
- String fontFamilyName = (String)item;
+ String fontFamilyName = (String) item;
label.getStyles().put("font", Font.decode(fontFamilyName + "-12"));
}
}
@@ -137,7 +137,7 @@ public class TextPaneDemo extends Applic
public void render(Object data, Button button, boolean highlight) {
super.render(data, button, highlight);
if (data != null) {
- String fontFamilyName = (String)data;
+ String fontFamilyName = (String) data;
label.getStyles().put("font", Font.decode(fontFamilyName + "-12"));
}
}
@@ -159,7 +159,8 @@ public class TextPaneDemo extends Applic
loadedFile = fileBrowserSheet.getSelectedFile();
try {
- BufferedReader reader = new BufferedReader(new FileReader(loadedFile));
+ BufferedReader reader = new BufferedReader(new FileReader(
+ loadedFile));
PlainTextSerializer serializer = new PlainTextSerializer();
textPane.setDocument(serializer.readObject(reader));
reader.close();
@@ -312,8 +313,8 @@ public class TextPaneDemo extends Applic
ListButtonSelectionListener fontButtonPressListener = new ListButtonSelectionListener.Adapter() {
@Override
public void selectedItemChanged(ListButton listButton, Object previousSelectedItem) {
- int selectedFontSize = (Integer)fontSizeListButton.getSelectedItem();
- String selectedFontFamily = (String)fontFamilyListButton.getSelectedItem();
+ int selectedFontSize = (Integer) fontSizeListButton.getSelectedItem();
+ String selectedFontFamily = (String) fontFamilyListButton.getSelectedItem();
final Font derivedFont = Font.decode(selectedFontFamily + " " + selectedFontSize);
applyStyleToSelection(new StyleApplicator() {
@@ -387,7 +388,7 @@ public class TextPaneDemo extends Applic
}
printStream.append("<" + node.getClass().getSimpleName() + ">");
if (node instanceof TextNode) {
- TextNode textNode = (TextNode)node;
+ TextNode textNode = (TextNode) node;
String text = textNode.getText();
printStream.append(text);
printStream.append("</" + node.getClass().getSimpleName() + ">");
@@ -395,7 +396,7 @@ public class TextPaneDemo extends Applic
} else {
printStream.println();
if (node instanceof Element) {
- Element element = (Element)node;
+ Element element = (Element) node;
for (Node childNode : element) {
dumpDocumentNode(childNode, printStream, indent + 1);
@@ -433,7 +434,7 @@ public class TextPaneDemo extends Applic
for (Node node : nodeList) {
if (node instanceof TextSpan) {
- TextSpan span = (TextSpan)node;
+ TextSpan span = (TextSpan) node;
int documentOffset = node.getDocumentOffset();
int characterCount = node.getCharacterCount();
org.apache.pivot.wtk.Span textSpan = new org.apache.pivot.wtk.Span(documentOffset,
@@ -444,7 +445,7 @@ public class TextPaneDemo extends Applic
}
}
if (node instanceof org.apache.pivot.wtk.text.TextNode) {
- org.apache.pivot.wtk.text.TextNode textNode = (org.apache.pivot.wtk.text.TextNode)node;
+ org.apache.pivot.wtk.text.TextNode textNode = (org.apache.pivot.wtk.text.TextNode) node;
int documentOffset = node.getDocumentOffset();
int characterCount = node.getCharacterCount();
org.apache.pivot.wtk.Span textSpan = new org.apache.pivot.wtk.Span(documentOffset,
@@ -526,8 +527,8 @@ public class TextPaneDemo extends Applic
}
private static void applyStyleToSpanNode(org.apache.pivot.wtk.Span selectionSpan,
- StyleApplicator styleApplicator, TextSpan spanNode,
- int characterCount, org.apache.pivot.wtk.Span textSpan) {
+ StyleApplicator styleApplicator, TextSpan spanNode, int characterCount,
+ org.apache.pivot.wtk.Span textSpan) {
if (selectionSpan.contains(textSpan)) {
// if the span-node is contained wholly inside the
// selection, apply the style
@@ -548,8 +549,8 @@ public class TextPaneDemo extends Applic
// the last part of the span-node, and apply the style to it
int intersectionStart = selectionSpan.start - textSpan.start;
TextSpan part1 = spanNode.getRange(0, intersectionStart);
- TextSpan part2 = spanNode.getRange(intersectionStart,
- characterCount - intersectionStart);
+ TextSpan part2 = spanNode.getRange(intersectionStart, characterCount
+ - intersectionStart);
styleApplicator.apply(part2);
@@ -564,10 +565,8 @@ public class TextPaneDemo extends Applic
int part2Start = selectionSpan.start - textSpan.start;
int part2End = selectionSpan.end - textSpan.start;
TextSpan part1 = spanNode.getRange(0, part2Start);
- TextSpan part2 = spanNode.getRange(part2Start, part2End
- - part2Start);
- TextSpan part3 = spanNode.getRange(part2End, characterCount
- - part2End);
+ TextSpan part2 = spanNode.getRange(part2Start, part2End - part2Start);
+ TextSpan part3 = spanNode.getRange(part2End, characterCount - part2End);
styleApplicator.apply(part2);
@@ -585,7 +584,7 @@ public class TextPaneDemo extends Applic
return;
}
if (node instanceof org.apache.pivot.wtk.text.Element) {
- Element element = (Element)node;
+ Element element = (Element) node;
for (Node child : element) {
nodeList.add(child);
collectNodes(child, nodeList);
Modified: pivot/trunk/demos/src/org/apache/pivot/demos/xml/NodeRenderer.java
URL: http://svn.apache.org/viewvc/pivot/trunk/demos/src/org/apache/pivot/demos/xml/NodeRenderer.java?rev=1529349&r1=1529348&r2=1529349&view=diff
==============================================================================
--- pivot/trunk/demos/src/org/apache/pivot/demos/xml/NodeRenderer.java (original)
+++ pivot/trunk/demos/src/org/apache/pivot/demos/xml/NodeRenderer.java Fri Oct 4 23:45:40 2013
@@ -47,10 +47,10 @@ public class NodeRenderer extends Label
if (node != null) {
String text;
if (node instanceof Element) {
- Element element = (Element)node;
+ Element element = (Element) node;
text = "<" + element.getName() + ">";
} else if (node instanceof TextNode) {
- TextNode textNode = (TextNode)node;
+ TextNode textNode = (TextNode) node;
text = textNode.getText();
if (text.length() > MAXIMUM_TEXT_LENGTH) {
@@ -64,22 +64,22 @@ public class NodeRenderer extends Label
setText(text);
- Font font = (Font)treeView.getStyles().get("font");
+ Font font = (Font) treeView.getStyles().get("font");
getStyles().put("font", font);
Color color;
if (treeView.isEnabled() && !disabled) {
if (selected) {
if (treeView.isFocused()) {
- color = (Color)treeView.getStyles().get("selectionColor");
+ color = (Color) treeView.getStyles().get("selectionColor");
} else {
- color = (Color)treeView.getStyles().get("inactiveSelectionColor");
+ color = (Color) treeView.getStyles().get("inactiveSelectionColor");
}
} else {
- color = (Color)treeView.getStyles().get("color");
+ color = (Color) treeView.getStyles().get("color");
}
} else {
- color = (Color)treeView.getStyles().get("disabledColor");
+ color = (Color) treeView.getStyles().get("disabledColor");
}
getStyles().put("color", color);
@@ -90,10 +90,10 @@ public class NodeRenderer extends Label
public String toString(Object node) {
String string;
if (node instanceof Element) {
- Element element = (Element)node;
+ Element element = (Element) node;
string = element.getName();
} else if (node instanceof TextNode) {
- TextNode textNode = (TextNode)node;
+ TextNode textNode = (TextNode) node;
string = textNode.getText();
} else {
throw new IllegalArgumentException();
Modified: pivot/trunk/demos/src/org/apache/pivot/demos/xml/XMLViewer.java
URL: http://svn.apache.org/viewvc/pivot/trunk/demos/src/org/apache/pivot/demos/xml/XMLViewer.java?rev=1529349&r1=1529348&r2=1529349&view=diff
==============================================================================
--- pivot/trunk/demos/src/org/apache/pivot/demos/xml/XMLViewer.java (original)
+++ pivot/trunk/demos/src/org/apache/pivot/demos/xml/XMLViewer.java Fri Oct 4 23:45:40 2013
@@ -50,17 +50,22 @@ import org.apache.pivot.xml.TextNode;
import org.apache.pivot.xml.XMLSerializer;
/**
- * Utility application that allows the user to browse an XML DOM using
- * a tree view component.
+ * Utility application that allows the user to browse an XML DOM using a tree
+ * view component.
*/
public class XMLViewer extends Application.Adapter {
private Window window = null;
- @BXML private TreeView treeView = null;
- @BXML private CardPane propertiesCardPane = null;
- @BXML private TableView namespacesTableView = null;
- @BXML private TableView attributesTableView = null;
- @BXML private TextArea textArea = null;
+ @BXML
+ private TreeView treeView = null;
+ @BXML
+ private CardPane propertiesCardPane = null;
+ @BXML
+ private TableView namespacesTableView = null;
+ @BXML
+ private TableView attributesTableView = null;
+ @BXML
+ private TextArea textArea = null;
private OverlayDecorator promptDecorator = new OverlayDecorator();
@@ -68,12 +73,11 @@ public class XMLViewer extends Applicati
public static final String WINDOW_TITLE = "XML Viewer";
@Override
- public void startup(Display display, Map<String, String> properties)
- throws Exception {
+ public void startup(Display display, Map<String, String> properties) throws Exception {
BXMLSerializer bxmlSerializer = new BXMLSerializer();
bxmlSerializer.getNamespace().put(APPLICATION_KEY, this);
- window = (Window)bxmlSerializer.readObject(XMLViewer.class, "xml_viewer.bxml");
+ window = (Window) bxmlSerializer.readObject(XMLViewer.class, "xml_viewer.bxml");
bxmlSerializer.bind(this);
Label prompt = new Label("Drag or paste XML here");
@@ -108,8 +112,7 @@ public class XMLViewer extends Applicati
public void paste() {
Manifest clipboardContent = Clipboard.getContent();
- if (clipboardContent != null
- && clipboardContent.containsText()) {
+ if (clipboardContent != null && clipboardContent.containsText()) {
String xml = null;
XMLSerializer xmlSerializer = new XMLSerializer();
try {
@@ -153,7 +156,7 @@ public class XMLViewer extends Applicati
} else {
Prompt.prompt("Multiple files not supported.", window);
}
- } catch(IOException exception) {
+ } catch (IOException exception) {
Prompt.prompt(exception.getMessage(), window);
}
@@ -161,20 +164,19 @@ public class XMLViewer extends Applicati
}
public void updateProperties() {
- Node node = (Node)treeView.getSelectedNode();
+ Node node = (Node) treeView.getSelectedNode();
if (node == null) {
// no selection, but it's ok
} else if (node instanceof TextNode) {
- TextNode textNode = (TextNode)node;
+ TextNode textNode = (TextNode) node;
textArea.setText(textNode.getText());
propertiesCardPane.setSelectedIndex(1);
} else if (node instanceof Element) {
- Element element = (Element)node;
+ Element element = (Element) node;
// Populate the namespaces table
- ArrayList<HashMap<String, String>> namespacesTableData =
- new ArrayList<>();
+ ArrayList<HashMap<String, String>> namespacesTableData = new ArrayList<>();
String defaultNamespaceURI = element.getDefaultNamespaceURI();
if (defaultNamespaceURI != null) {
@@ -195,8 +197,7 @@ public class XMLViewer extends Applicati
namespacesTableView.setTableData(namespacesTableData);
// Populate the attributes table
- ArrayList<HashMap<String, String>> attributesTableData =
- new ArrayList<>();
+ ArrayList<HashMap<String, String>> attributesTableData = new ArrayList<>();
for (Element.Attribute attribute : element.getAttributes()) {
HashMap<String, String> row = new HashMap<>();
Modified: pivot/trunk/eclipse/src/org/apache/pivot/eclipse/PivotApplicationLaunchShortcut.java
URL: http://svn.apache.org/viewvc/pivot/trunk/eclipse/src/org/apache/pivot/eclipse/PivotApplicationLaunchShortcut.java?rev=1529349&r1=1529348&r2=1529349&view=diff
==============================================================================
--- pivot/trunk/eclipse/src/org/apache/pivot/eclipse/PivotApplicationLaunchShortcut.java (original)
+++ pivot/trunk/eclipse/src/org/apache/pivot/eclipse/PivotApplicationLaunchShortcut.java Fri Oct 4 23:45:40 2013
@@ -43,7 +43,7 @@ public class PivotApplicationLaunchShort
@Override
public void launch(ISelection selection, String mode) {
if (selection instanceof IStructuredSelection) {
- IStructuredSelection structuredSelection = (IStructuredSelection)selection;
+ IStructuredSelection structuredSelection = (IStructuredSelection) selection;
Object[] elements = structuredSelection.toArray();
if (elements.length == 1) {
@@ -55,7 +55,7 @@ public class PivotApplicationLaunchShort
@Override
public void launch(IEditorPart editor, String mode) {
IEditorInput editorInput = editor.getEditorInput();
- IJavaElement javaElement = (IJavaElement)editorInput.getAdapter(IJavaElement.class);
+ IJavaElement javaElement = (IJavaElement) editorInput.getAdapter(IJavaElement.class);
if (javaElement != null) {
launch(javaElement, mode);
@@ -64,8 +64,7 @@ public class PivotApplicationLaunchShort
private void launch(Object element, String mode) {
if (element instanceof IAdaptable) {
- ICompilationUnit compilationUnit =
- (ICompilationUnit)((IAdaptable)element).getAdapter(ICompilationUnit.class);
+ ICompilationUnit compilationUnit = (ICompilationUnit) ((IAdaptable) element).getAdapter(ICompilationUnit.class);
if (compilationUnit != null) {
IType type = compilationUnit.findPrimaryType();
@@ -84,23 +83,25 @@ public class PivotApplicationLaunchShort
private ILaunchConfiguration getExistingLaunchConfiguration(IType type) {
ILaunchManager launchManager = DebugPlugin.getDefault().getLaunchManager();
- ILaunchConfigurationType launchConfigurationType =
- launchManager.getLaunchConfigurationType(IJavaLaunchConfigurationConstants.ID_JAVA_APPLICATION);
+ ILaunchConfigurationType launchConfigurationType = launchManager.getLaunchConfigurationType(IJavaLaunchConfigurationConstants.ID_JAVA_APPLICATION);
ILaunchConfiguration existingLaunchConfiguration = null;
try {
String applicationProjectName = type.getJavaProject().getElementName();
String applicationTypeName = type.getFullyQualifiedName();
- ILaunchConfiguration[] launchConfigurations =
- DebugPlugin.getDefault().getLaunchManager().getLaunchConfigurations(launchConfigurationType);
+ ILaunchConfiguration[] launchConfigurations = DebugPlugin.getDefault().getLaunchManager().getLaunchConfigurations(
+ launchConfigurationType);
for (int i = 0; i < launchConfigurations.length; i++) {
ILaunchConfiguration launchConfiguration = launchConfigurations[i];
- String mainTypeName = launchConfiguration.getAttribute(IJavaLaunchConfigurationConstants.ATTR_MAIN_TYPE_NAME, "");
- String projectName = launchConfiguration.getAttribute(IJavaLaunchConfigurationConstants.ATTR_PROJECT_NAME, "");
- String programArguments = launchConfiguration.getAttribute(IJavaLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS, "");
+ String mainTypeName = launchConfiguration.getAttribute(
+ IJavaLaunchConfigurationConstants.ATTR_MAIN_TYPE_NAME, "");
+ String projectName = launchConfiguration.getAttribute(
+ IJavaLaunchConfigurationConstants.ATTR_PROJECT_NAME, "");
+ String programArguments = launchConfiguration.getAttribute(
+ IJavaLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS, "");
if (mainTypeName.equals(PivotPlugin.MAIN_TYPE_NAME)
&& projectName.equals(applicationProjectName)
@@ -110,8 +111,7 @@ public class PivotApplicationLaunchShort
}
}
} catch (CoreException exception) {
- MessageDialog.openError(PivotPlugin.getActiveWorkbenchShell(),
- exception.getMessage(),
+ MessageDialog.openError(PivotPlugin.getActiveWorkbenchShell(), exception.getMessage(),
exception.getStatus().getMessage());
}
@@ -126,23 +126,22 @@ public class PivotApplicationLaunchShort
String applicationTypeName = type.getFullyQualifiedName();
ILaunchManager launchManager = DebugPlugin.getDefault().getLaunchManager();
- ILaunchConfigurationType configurationType =
- launchManager.getLaunchConfigurationType(IJavaLaunchConfigurationConstants.ID_JAVA_APPLICATION);
+ ILaunchConfigurationType configurationType = launchManager.getLaunchConfigurationType(IJavaLaunchConfigurationConstants.ID_JAVA_APPLICATION);
String name = launchManager.generateUniqueLaunchConfigurationNameFrom(type.getElementName());
- ILaunchConfigurationWorkingCopy workingLaunchConfiguration = configurationType.newInstance(null, name);
- workingLaunchConfiguration.setAttribute(IJavaLaunchConfigurationConstants.ATTR_MAIN_TYPE_NAME,
- PivotPlugin.MAIN_TYPE_NAME);
- workingLaunchConfiguration.setAttribute(IJavaLaunchConfigurationConstants.ATTR_PROJECT_NAME,
- applicationProjectName);
- workingLaunchConfiguration.setAttribute(IJavaLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS,
- applicationTypeName);
- workingLaunchConfiguration.setMappedResources(new IResource[] {type.getUnderlyingResource()});
+ ILaunchConfigurationWorkingCopy workingLaunchConfiguration = configurationType.newInstance(
+ null, name);
+ workingLaunchConfiguration.setAttribute(
+ IJavaLaunchConfigurationConstants.ATTR_MAIN_TYPE_NAME, PivotPlugin.MAIN_TYPE_NAME);
+ workingLaunchConfiguration.setAttribute(
+ IJavaLaunchConfigurationConstants.ATTR_PROJECT_NAME, applicationProjectName);
+ workingLaunchConfiguration.setAttribute(
+ IJavaLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS, applicationTypeName);
+ workingLaunchConfiguration.setMappedResources(new IResource[] { type.getUnderlyingResource() });
launchConfiguration = workingLaunchConfiguration.doSave();
} catch (CoreException exception) {
- MessageDialog.openError(PivotPlugin.getActiveWorkbenchShell(),
- exception.getMessage(),
+ MessageDialog.openError(PivotPlugin.getActiveWorkbenchShell(), exception.getMessage(),
exception.getStatus().getMessage());
}