-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add option to set initial mode
- Loading branch information
Showing
19 changed files
with
404 additions
and
351 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
package com.actelion.research.gwt.gui.generic; | ||
|
||
import com.actelion.research.gui.generic.*; | ||
import com.actelion.research.gui.generic.GenericCheckBox; | ||
import com.google.gwt.core.client.JavaScriptObject; | ||
|
||
public class JSCheckBox extends JSComponent implements GenericCheckBox { | ||
|
@@ -9,14 +9,14 @@ public JSCheckBox(JavaScriptObject jsCheckBox) { | |
} | ||
|
||
@Override | ||
public native boolean isSelected() | ||
public native boolean isSelected() | ||
/*-{ | ||
var component = [email protected]::getJsComponent()(); | ||
return component.isSelected(); | ||
}-*/; | ||
|
||
@Override | ||
public native void setSelected(boolean b) | ||
public native void setSelected(boolean b) | ||
/*-{ | ||
var component = [email protected]::getJsComponent()(); | ||
return component.setSelected(b); | ||
|
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,6 +1,6 @@ | ||
package com.actelion.research.gwt.gui.generic; | ||
|
||
import com.actelion.research.gui.generic.*; | ||
import com.actelion.research.gui.generic.GenericComboBox; | ||
import com.google.gwt.core.client.JavaScriptObject; | ||
|
||
public class JSComboBox extends JSComponent implements GenericComboBox { | ||
|
@@ -9,49 +9,49 @@ public JSComboBox(JavaScriptObject jsComboBox) { | |
} | ||
|
||
@Override | ||
public native void addItem(String item) | ||
public native void addItem(String item) | ||
/*-{ | ||
var component = [email protected]::getJsComponent()(); | ||
return component.addItem(item); | ||
}-*/; | ||
|
||
@Override | ||
public native void removeAllItems() | ||
public native void removeAllItems() | ||
/*-{ | ||
var component = [email protected]::getJsComponent()(); | ||
return component.removeAllItems(); | ||
}-*/; | ||
|
||
@Override | ||
public native int getSelectedIndex() | ||
public native int getSelectedIndex() | ||
/*-{ | ||
var component = [email protected]::getJsComponent()(); | ||
return component.getSelectedIndex(); | ||
}-*/; | ||
|
||
@Override | ||
public native String getSelectedItem() | ||
public native String getSelectedItem() | ||
/*-{ | ||
var component = [email protected]::getJsComponent()(); | ||
return component.getSelectedItem(); | ||
}-*/; | ||
|
||
@Override | ||
public native void setSelectedIndex(int index) | ||
public native void setSelectedIndex(int index) | ||
/*-{ | ||
var component = [email protected]::getJsComponent()(); | ||
return component.setSelectedIndex(index); | ||
}-*/; | ||
|
||
@Override | ||
public native void setSelectedItem(String item) | ||
public native void setSelectedItem(String item) | ||
/*-{ | ||
var component = [email protected]::getJsComponent()(); | ||
return component.setSelectedItem(item); | ||
}-*/; | ||
|
||
@Override | ||
public native void setEditable(boolean b) | ||
public native void setEditable(boolean b) | ||
/*-{ | ||
var component = [email protected]::getJsComponent()(); | ||
return component.setEditable(b); | ||
|
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,17 +1,19 @@ | ||
package com.actelion.research.gwt.gui.generic; | ||
|
||
import com.actelion.research.gui.generic.*; | ||
import com.actelion.research.gui.generic.GenericActionEvent; | ||
import com.actelion.research.gui.generic.GenericComponent; | ||
import com.actelion.research.gui.generic.GenericEventListener; | ||
import com.google.gwt.core.client.JavaScriptObject; | ||
|
||
import java.util.ArrayList; | ||
|
||
public class JSComponent implements GenericComponent { | ||
private JavaScriptObject mJsComponent; | ||
private ArrayList<GenericEventListener<GenericActionEvent>> mConsumerList; | ||
private ArrayList<GenericEventListener<GenericActionEvent>> mConsumerList; | ||
|
||
public JSComponent(JavaScriptObject jsComponent) { | ||
mJsComponent = jsComponent; | ||
mConsumerList = new ArrayList<>(); | ||
mConsumerList = new ArrayList<>(); | ||
setEventHandler(jsComponent); | ||
} | ||
|
||
|
@@ -32,26 +34,26 @@ public JavaScriptObject getJsComponent() { | |
} | ||
|
||
@Override | ||
public native void setEnabled(boolean b) | ||
public native void setEnabled(boolean b) | ||
/*-{ | ||
var component = [email protected]::getJsComponent()(); | ||
return component.setEnabled(b); | ||
}-*/; | ||
|
||
@Override | ||
public void addEventConsumer(GenericEventListener<GenericActionEvent> consumer) { | ||
mConsumerList.add(consumer); | ||
public void addEventConsumer(GenericEventListener<GenericActionEvent> consumer) { | ||
mConsumerList.add(consumer); | ||
} | ||
|
||
@Override | ||
public void removeEventConsumer(GenericEventListener<GenericActionEvent> consumer) { | ||
mConsumerList.remove(consumer); | ||
public void removeEventConsumer(GenericEventListener<GenericActionEvent> consumer) { | ||
mConsumerList.remove(consumer); | ||
} | ||
|
||
@Override | ||
public void fireEvent(GenericActionEvent event) { | ||
for (GenericEventListener<GenericActionEvent> consumer:mConsumerList) { | ||
consumer.eventHappened(event); | ||
public void fireEvent(GenericActionEvent event) { | ||
for (GenericEventListener<GenericActionEvent> consumer:mConsumerList) { | ||
consumer.eventHappened(event); | ||
} | ||
} | ||
} |
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 |
---|---|---|
|
@@ -20,52 +20,52 @@ private JavaScriptObject getJsDialog() { | |
@Override | ||
public native void setLayout(int[] hLayout, int[] vLayout) | ||
/*-{ | ||
var dialog = [email protected]::getJsDialog()(); | ||
return dialog.setLayout(hLayout, vLayout); | ||
var jsDialog = [email protected]::getJsDialog()(); | ||
return jsDialog.setLayout(hLayout, vLayout); | ||
}-*/; | ||
|
||
@Override | ||
public native void add(GenericComponent c, int x, int y) | ||
/*-{ | ||
var dialog = [email protected]::getJsDialog()(); | ||
return dialog.add(c, x, y); | ||
var jsDialog = [email protected]::getJsDialog()(); | ||
return jsDialog.add(c, x, y); | ||
}-*/; | ||
|
||
@Override | ||
public native void add(GenericComponent c, int x1, int y1, int x2, int y2) | ||
/*-{ | ||
var dialog = [email protected]::getJsDialog()(); | ||
return dialog.add(c, x1, y1, x2, y2); | ||
var jsDialog = [email protected]::getJsDialog()(); | ||
return jsDialog.add(c, x1, y1, x2, y2); | ||
}-*/; | ||
|
||
@Override | ||
public native GenericCheckBox createCheckBox(String text) | ||
/*-{ | ||
var dialog = [email protected]::getJsDialog()(); | ||
var jsDialog = [email protected]::getJsDialog()(); | ||
var checkBox = dialog.createCheckBox(text); | ||
return @com.actelion.research.gwt.gui.generic.JSCheckBox::new(Lcom/google/gwt/core/client/JavaScriptObject;)(checkBox); | ||
}-*/; | ||
|
||
@Override | ||
public native GenericComboBox createComboBox() | ||
/*-{ | ||
var dialog = [email protected]::getJsDialog()(); | ||
var jsDialog = [email protected]::getJsDialog()(); | ||
var comboBox = dialog.createComboBox(); | ||
return @com.actelion.research.gwt.gui.generic.JSComboBox::new(Lcom/google/gwt/core/client/JavaScriptObject;)(comboBox); | ||
}-*/; | ||
|
||
@Override | ||
public native GenericLabel createLabel(String text) | ||
public native GenericLabel createLabel(String text) | ||
/*-{ | ||
var dialog = [email protected]::getJsDialog()(); | ||
var jsDialog = [email protected]::getJsDialog()(); | ||
var label = dialog.createLabel(text); | ||
return @com.actelion.research.gwt.gui.generic.JSLabel::new(Lcom/google/gwt/core/client/JavaScriptObject;)(label); | ||
}-*/; | ||
|
||
@Override | ||
public native GenericTextField createTextField(int width, int height) | ||
public native GenericTextField createTextField(int width, int height) | ||
/*-{ | ||
var dialog = [email protected]::getJsDialog()(); | ||
var jsDialog = [email protected]::getJsDialog()(); | ||
var textField = dialog.createTextField(width, height); | ||
return @com.actelion.research.gwt.gui.generic.JSTextField::new(Lcom/google/gwt/core/client/JavaScriptObject;)(textField); | ||
}-*/; | ||
|
@@ -74,7 +74,7 @@ public native GenericTextField createTextField(int width, int height) | |
public native void setEventConsumer(GenericEventListener<GenericActionEvent> consumer) | ||
/*-{ | ||
[email protected]::mConsumer = consumer; | ||
var dialog = [email protected]::getJsDialog()(); | ||
var jsDialog = [email protected]::getJsDialog()(); | ||
var that = this; | ||
var jsConsumer = { | ||
fireOk: function ok() { | ||
|
@@ -90,21 +90,21 @@ public native void setEventConsumer(GenericEventListener<GenericActionEvent> con | |
@Override | ||
public native void showDialog() | ||
/*-{ | ||
var dialog = [email protected]::getJsDialog()(); | ||
var jsDialog = [email protected]::getJsDialog()(); | ||
dialog.showDialog(); | ||
}-*/; | ||
|
||
@Override | ||
public native void disposeDialog() | ||
/*-{ | ||
var dialog = [email protected]::getJsDialog()(); | ||
var jsDialog = [email protected]::getJsDialog()(); | ||
dialog.disposeDialog(); | ||
}-*/; | ||
|
||
@Override | ||
public native void showMessage(String message) | ||
/*-{ | ||
var dialog = [email protected]::getJsDialog()(); | ||
var jsDialog = [email protected]::getJsDialog()(); | ||
dialog.showMessage(message); | ||
}-*/; | ||
|
||
|
Oops, something went wrong.