Merge branch 'alexkogon-fixHotKeyConfigs'
This commit is contained in:
@@ -21,6 +21,9 @@
|
|||||||
<mkdir dir="${lib}"/>
|
<mkdir dir="${lib}"/>
|
||||||
<echo>basedir: ${basedir}</echo>
|
<echo>basedir: ${basedir}</echo>
|
||||||
<echo>VM: ${java.vm.name}</echo>
|
<echo>VM: ${java.vm.name}</echo>
|
||||||
|
<echo>VM Version: ${java.vm.specification.version}</echo>
|
||||||
|
<echo>VM Vendor: ${java.vm.vendor}</echo>
|
||||||
|
<echo>VM Build: ${java.vm.version}</echo>
|
||||||
<echo>Username: ${user.name}</echo>
|
<echo>Username: ${user.name}</echo>
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
|
|||||||
@@ -20,6 +20,9 @@ public class Config extends PropertiesSerializer {
|
|||||||
public String xpathList = "";
|
public String xpathList = "";
|
||||||
public String xpathHightlight = ".*process=\"([^\"]*)\".*";
|
public String xpathHightlight = ".*process=\"([^\"]*)\".*";
|
||||||
|
|
||||||
|
public boolean useStrongTextMatching = false;
|
||||||
|
|
||||||
|
|
||||||
public Config() //needed for cloning
|
public Config() //needed for cloning
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@@ -37,6 +40,12 @@ public class Config extends PropertiesSerializer {
|
|||||||
return disableUiaBridge.equals("true") || disableUiaBridge.equals("True");
|
return disableUiaBridge.equals("true") || disableUiaBridge.equals("True");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void setDisableUiaBridge(boolean aNewValue) {
|
||||||
|
disableUiaBridge=aNewValue?"true":"false";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public boolean isFilterUiaDisabled()
|
public boolean isFilterUiaDisabled()
|
||||||
{
|
{
|
||||||
if (disableFiltersUia == null)
|
if (disableFiltersUia == null)
|
||||||
@@ -44,6 +53,11 @@ public class Config extends PropertiesSerializer {
|
|||||||
return disableFiltersUia.equals("true") || disableFiltersUia.equals("True");
|
return disableFiltersUia.equals("true") || disableFiltersUia.equals("True");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setDisableFiltersUia(boolean aNewValue) {
|
||||||
|
disableFiltersUia=aNewValue?"true":"false";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public boolean isAlwaysOnTop()
|
public boolean isAlwaysOnTop()
|
||||||
{
|
{
|
||||||
if (alwaysOnTop == null)
|
if (alwaysOnTop == null)
|
||||||
@@ -51,7 +65,12 @@ public class Config extends PropertiesSerializer {
|
|||||||
return alwaysOnTop.equals("true") || alwaysOnTop.equals("True");
|
return alwaysOnTop.equals("true") || alwaysOnTop.equals("True");
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getRefreshKeyCode()
|
public void setAlwaysOnTop(boolean aNewValue)
|
||||||
|
{
|
||||||
|
alwaysOnTop=aNewValue?"true":"false";
|
||||||
|
}
|
||||||
|
|
||||||
|
public char getRefreshKey()
|
||||||
{
|
{
|
||||||
String keyStr = "";
|
String keyStr = "";
|
||||||
if (this.refreshKey == null)
|
if (this.refreshKey == null)
|
||||||
@@ -60,10 +79,19 @@ public class Config extends PropertiesSerializer {
|
|||||||
keyStr = new Config().refreshKey; //use default value
|
keyStr = new Config().refreshKey; //use default value
|
||||||
else
|
else
|
||||||
keyStr = this.refreshKey;
|
keyStr = this.refreshKey;
|
||||||
return RobotMacro.getKeyCode(keyStr.charAt(0))[0];
|
return keyStr.charAt(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getTargetKeyCode()
|
public int getRefreshKeyCode()
|
||||||
|
{
|
||||||
|
return RobotMacro.getKeyCode(this.getRefreshKey())[0];
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRefreshKey(String aText) {
|
||||||
|
this.refreshKey=aText;
|
||||||
|
}
|
||||||
|
|
||||||
|
public char getTargetKey()
|
||||||
{
|
{
|
||||||
String keyStr = "";
|
String keyStr = "";
|
||||||
if (this.targetKey == null)
|
if (this.targetKey == null)
|
||||||
@@ -72,6 +100,39 @@ public class Config extends PropertiesSerializer {
|
|||||||
keyStr = new Config().targetKey; //use default value
|
keyStr = new Config().targetKey; //use default value
|
||||||
else
|
else
|
||||||
keyStr = this.targetKey;
|
keyStr = this.targetKey;
|
||||||
return RobotMacro.getKeyCode(keyStr.charAt(0))[0];
|
return keyStr.charAt(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getTargetKeyCode()
|
||||||
|
{
|
||||||
|
return RobotMacro.getKeyCode(this.getTargetKey())[0];
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTargetKey(String aText) {
|
||||||
|
this.targetKey=aText;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isUseStrongTextMatching() {
|
||||||
|
return useStrongTextMatching;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUseStrongTextMatching(boolean useStrongTextMatching) {
|
||||||
|
this.useStrongTextMatching = useStrongTextMatching;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getXpathList() {
|
||||||
|
return xpathList;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setXPathList(String aText) {
|
||||||
|
xpathList=aText;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getXpathHighlight() {
|
||||||
|
return xpathHightlight;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setXPathHighlight(String aText) {
|
||||||
|
xpathHightlight=aText;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -59,13 +59,13 @@ public class PropertiesSerializer {
|
|||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
e.printStackTrace();
|
System.out.println("Unable to load properties from file: "+propertyFilename+". Default values will be used.");
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Field[] fields = this.getClass().getFields();
|
Field[] fields = this.getClass().getFields();
|
||||||
for (int i = 0 ; i < fields.length; i++)
|
for (int i = 0 ; i < fields.length; i++)
|
||||||
{
|
{
|
||||||
//fields[i].get(this);
|
|
||||||
String pName = fields[i].getName();
|
String pName = fields[i].getName();
|
||||||
String pType = "String";
|
String pType = "String";
|
||||||
try
|
try
|
||||||
@@ -74,20 +74,26 @@ public class PropertiesSerializer {
|
|||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
//e.printStackTrace();
|
// e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
final Object myProperty = prop.get(pName);
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
if(myProperty==null) {
|
||||||
|
// System.out.println("Property "+pName+"["+pType+"] not set; input was null");
|
||||||
|
} else {
|
||||||
if (pType.equalsIgnoreCase("integer"))
|
if (pType.equalsIgnoreCase("integer"))
|
||||||
fields[i].set(this, Integer.parseInt(prop.get(pName) + ""));
|
fields[i].set(this, Integer.parseInt(myProperty + ""));
|
||||||
if (pType.equalsIgnoreCase("boolean"))
|
if (pType.equalsIgnoreCase("boolean"))
|
||||||
fields[i].set(this, Boolean.parseBoolean(prop.get(pName) + ""));
|
fields[i].set(this, Boolean.parseBoolean(myProperty + ""));
|
||||||
else
|
else
|
||||||
fields[i].set(this, prop.get(pName));
|
fields[i].set(this, myProperty);
|
||||||
|
System.out.println("Property "+pName+"["+pType+"] set to: "+myProperty);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
//e.printStackTrace();
|
// e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
45
src/org/synthuse/SynthuseConfigDialog.java
Executable file
45
src/org/synthuse/SynthuseConfigDialog.java
Executable file
@@ -0,0 +1,45 @@
|
|||||||
|
package org.synthuse;
|
||||||
|
|
||||||
|
import javax.swing.JDialog;
|
||||||
|
import javax.swing.JFrame;
|
||||||
|
import javax.swing.SwingUtilities;
|
||||||
|
|
||||||
|
import org.synthuse.controllers.SynthuseConfigDialogControllers;
|
||||||
|
import org.synthuse.views.SynthuseConfigPanel;
|
||||||
|
|
||||||
|
public class SynthuseConfigDialog extends JDialog {
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
private static final long serialVersionUID = -4877764256323621418L;
|
||||||
|
|
||||||
|
private Config theConfig; //Model
|
||||||
|
private final SynthuseConfigPanel theSynthuseConfigPanel; //View
|
||||||
|
|
||||||
|
public SynthuseConfigDialog(JFrame aParentFrame, Config aConfig) {
|
||||||
|
super(aParentFrame);
|
||||||
|
|
||||||
|
this.setConfig(aConfig);
|
||||||
|
|
||||||
|
this.setTitle("Synthuse Properties");
|
||||||
|
|
||||||
|
theSynthuseConfigPanel = new SynthuseConfigPanel();
|
||||||
|
|
||||||
|
SynthuseConfigDialogControllers.bindActionControllers(theSynthuseConfigPanel,theConfig);
|
||||||
|
|
||||||
|
this.getContentPane().add(theSynthuseConfigPanel);
|
||||||
|
this.setSize(492, 260);
|
||||||
|
|
||||||
|
SwingUtilities.invokeLater(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
SynthuseConfigDialogControllers.initializeUI(theSynthuseConfigPanel,theConfig);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
synchronized private void setConfig(Config aConfig) {
|
||||||
|
theConfig = aConfig;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -43,6 +43,7 @@ import java.util.List;
|
|||||||
|
|
||||||
import org.synthuse.Api.User32Ex;
|
import org.synthuse.Api.User32Ex;
|
||||||
import org.synthuse.DragTarget.dragEvents;
|
import org.synthuse.DragTarget.dragEvents;
|
||||||
|
import org.synthuse.views.SynthuseConfigPanel;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -85,6 +86,7 @@ public class SynthuseDlg extends JFrame {
|
|||||||
private JButton btnAdvanced;
|
private JButton btnAdvanced;
|
||||||
|
|
||||||
private TestIdeFrame testIde = null;
|
private TestIdeFrame testIde = null;
|
||||||
|
protected SynthuseConfigDialog configDialog=null;
|
||||||
//private MessageHookFrame msgHook = null;
|
//private MessageHookFrame msgHook = null;
|
||||||
private int targetX;
|
private int targetX;
|
||||||
private int targetY;
|
private int targetY;
|
||||||
@@ -283,7 +285,7 @@ public class SynthuseDlg extends JFrame {
|
|||||||
GridBagConstraints c = new GridBagConstraints();
|
GridBagConstraints c = new GridBagConstraints();
|
||||||
c.fill = GridBagConstraints.HORIZONTAL;
|
c.fill = GridBagConstraints.HORIZONTAL;
|
||||||
c.weightx = 0.5;
|
c.weightx = 0.5;
|
||||||
c.gridwidth = 1;
|
c.gridwidth = 2;
|
||||||
c.gridx = 0;
|
c.gridx = 0;
|
||||||
c.gridy = 0;
|
c.gridy = 0;
|
||||||
c.insets = new Insets(3,3,3,3); // add padding around objects
|
c.insets = new Insets(3,3,3,3); // add padding around objects
|
||||||
@@ -291,9 +293,27 @@ public class SynthuseDlg extends JFrame {
|
|||||||
final DragTarget lblTarget = new DragTarget();
|
final DragTarget lblTarget = new DragTarget();
|
||||||
|
|
||||||
lblTarget.setHorizontalAlignment(SwingConstants.CENTER);
|
lblTarget.setHorizontalAlignment(SwingConstants.CENTER);
|
||||||
lblTarget.setIcon(new ImageIcon(SynthuseDlg.class.getResource(RES_STR_TARGET_IMG)));
|
final ImageIcon imageIcon = new ImageIcon(SynthuseDlg.class.getResource(RES_STR_TARGET_IMG));
|
||||||
|
lblTarget.setMinimumSize(new Dimension(imageIcon.getIconWidth(), imageIcon.getIconHeight()));
|
||||||
|
lblTarget.setIcon(imageIcon);
|
||||||
panel.add(lblTarget, c);
|
panel.add(lblTarget, c);
|
||||||
|
|
||||||
|
final JButton btnConfig = new JButton("Cfg");
|
||||||
|
|
||||||
|
btnConfig.addActionListener(new ActionListener() {
|
||||||
|
@Override
|
||||||
|
public void actionPerformed(ActionEvent e) {
|
||||||
|
if(configDialog==null) {
|
||||||
|
createConfigDialog();
|
||||||
|
}
|
||||||
|
configDialog.setVisible(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
c.gridx = 2;
|
||||||
|
c.gridwidth = 1;
|
||||||
|
panel.add(btnConfig, c);
|
||||||
|
|
||||||
btnFind = new JButton("Find");
|
btnFind = new JButton("Find");
|
||||||
btnFind.addActionListener(new ActionListener() {
|
btnFind.addActionListener(new ActionListener() {
|
||||||
public void actionPerformed(ActionEvent arg0) {
|
public void actionPerformed(ActionEvent arg0) {
|
||||||
@@ -323,8 +343,8 @@ public class SynthuseDlg extends JFrame {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
c.gridwidth = 3;
|
c.gridwidth = 1;
|
||||||
c.gridx = 1;
|
c.gridx = 3;
|
||||||
panel.add(cmbXpath, c);
|
panel.add(cmbXpath, c);
|
||||||
btnFind.setIcon(new ImageIcon(SynthuseDlg.class.getResource(RES_STR_FIND_IMG)));
|
btnFind.setIcon(new ImageIcon(SynthuseDlg.class.getResource(RES_STR_FIND_IMG)));
|
||||||
c.gridwidth = 1;
|
c.gridwidth = 1;
|
||||||
@@ -562,4 +582,9 @@ public class SynthuseDlg extends JFrame {
|
|||||||
WindowEvent closingEvent = new WindowEvent(this, WindowEvent.WINDOW_CLOSING);
|
WindowEvent closingEvent = new WindowEvent(this, WindowEvent.WINDOW_CLOSING);
|
||||||
Toolkit.getDefaultToolkit().getSystemEventQueue().postEvent(closingEvent);
|
Toolkit.getDefaultToolkit().getSystemEventQueue().postEvent(closingEvent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void createConfigDialog() {
|
||||||
|
configDialog=new SynthuseConfigDialog(this, config);
|
||||||
|
configDialog.setLocationRelativeTo(null);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ public class XpathManager implements Runnable{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
String results = buildXpathStatement();
|
String results = SynthuseDlg.config.isUseStrongTextMatching()?buildXpathStatement(true,50,50):buildXpathStatement();
|
||||||
events.executionCompleted(hwnd, results);
|
events.executionCompleted(hwnd, results);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -143,7 +143,23 @@ public class XpathManager implements Runnable{
|
|||||||
parentTxtStr = " and @text='" + parentTxtStr + "'";
|
parentTxtStr = " and @text='" + parentTxtStr + "'";
|
||||||
}
|
}
|
||||||
if (!parentClassStr.isEmpty())
|
if (!parentClassStr.isEmpty())
|
||||||
|
{
|
||||||
|
if (!txtStr.isEmpty()&&useFullTextMatching) {
|
||||||
|
String copyOfTxtStr = txtStr;
|
||||||
|
if (copyOfTxtStr.length() > maxTextLength) {// if the text is too long only test the first maxTextLength characters
|
||||||
|
copyOfTxtStr = WindowsEnumeratedXml.escapeXmlAttributeValue(copyOfTxtStr.substring(0, maxTextLength));
|
||||||
|
copyOfTxtStr = " and starts-with(@text,'" + copyOfTxtStr + "')";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
copyOfTxtStr = " and @text='" + copyOfTxtStr + "'";
|
||||||
|
builtXpath = "//win[@class='" + parentClassStr + "'" + parentTxtStr + "]/win[@class='" + classStr + "'" + copyOfTxtStr + "]";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
builtXpath = "//win[@class='" + parentClassStr + "'" + parentTxtStr + "]/win[@class='" + classStr + "']";
|
builtXpath = "//win[@class='" + parentClassStr + "'" + parentTxtStr + "]/win[@class='" + classStr + "']";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
System.out.println(builtXpath);
|
||||||
resultList = WindowsEnumeratedXml.evaluateXpathGetValues(xml, builtXpath);
|
resultList = WindowsEnumeratedXml.evaluateXpathGetValues(xml, builtXpath);
|
||||||
if (resultList.size() > 1) { // if there are still multiple results add position to the xpath
|
if (resultList.size() > 1) { // if there are still multiple results add position to the xpath
|
||||||
int position = 1;
|
int position = 1;
|
||||||
|
|||||||
121
src/org/synthuse/controllers/SynthuseConfigDialogControllers.java
Executable file
121
src/org/synthuse/controllers/SynthuseConfigDialogControllers.java
Executable file
@@ -0,0 +1,121 @@
|
|||||||
|
package org.synthuse.controllers;
|
||||||
|
|
||||||
|
import java.awt.event.ActionEvent;
|
||||||
|
import java.awt.event.ActionListener;
|
||||||
|
|
||||||
|
import javax.swing.JOptionPane;
|
||||||
|
|
||||||
|
import org.synthuse.Config;
|
||||||
|
import org.synthuse.views.SynthuseConfigPanel;
|
||||||
|
|
||||||
|
public class SynthuseConfigDialogControllers {
|
||||||
|
|
||||||
|
public static void initializeUI(SynthuseConfigPanel aSynthuseConfigPanel, Config aConfig) {
|
||||||
|
aSynthuseConfigPanel.getAlwaysOnTopCheckBox().setSelected(aConfig.isAlwaysOnTop());
|
||||||
|
aSynthuseConfigPanel.getDisableFiltersUiaCheckBox().setSelected(aConfig.isFilterUiaDisabled());
|
||||||
|
aSynthuseConfigPanel.getDisableUiaBridgeCheckBox().setSelected(aConfig.isUiaBridgeDisabled());
|
||||||
|
aSynthuseConfigPanel.getRefreshKeyTextField().setText(Character.toString(aConfig.getRefreshKey()));
|
||||||
|
aSynthuseConfigPanel.getStrongTextMatchingCheckBox().setSelected(aConfig.isUseStrongTextMatching());
|
||||||
|
aSynthuseConfigPanel.getTargetKeyTextField().setText(Character.toString(aConfig.getTargetKey()));
|
||||||
|
aSynthuseConfigPanel.getXPathHighlightTextField().setText(aConfig.getXpathHighlight());
|
||||||
|
aSynthuseConfigPanel.getXPathListTextField().setText(aConfig.getXpathList());
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void bindActionControllers(final SynthuseConfigPanel aSynthuseConfigPanel, final Config aConfig) {
|
||||||
|
aSynthuseConfigPanel.getAlwaysOnTopCheckBox().addActionListener(alwaysOnTopCheckboxActionHandler(aSynthuseConfigPanel, aConfig));
|
||||||
|
aSynthuseConfigPanel.getDisableFiltersUiaCheckBox().addActionListener(disableFiltersUiaCheckboxActionHandler(aSynthuseConfigPanel, aConfig));
|
||||||
|
aSynthuseConfigPanel.getDisableUiaBridgeCheckBox().addActionListener(disableUiaBridgeCheckboxActionHandler(aSynthuseConfigPanel, aConfig));
|
||||||
|
aSynthuseConfigPanel.getRefreshKeyTextField().addActionListener(refreshKeyCodeTextFieldActionHandler(aSynthuseConfigPanel, aConfig));
|
||||||
|
aSynthuseConfigPanel.getStrongTextMatchingCheckBox().addActionListener(strongTextMatchingCheckboxActionHandler(aSynthuseConfigPanel, aConfig));
|
||||||
|
aSynthuseConfigPanel.getTargetKeyTextField().addActionListener(targetKeyCodeTextFieldActionHandler(aSynthuseConfigPanel, aConfig));
|
||||||
|
aSynthuseConfigPanel.getXPathHighlightTextField().addActionListener(xpathHighlightTextFieldActionHandler(aSynthuseConfigPanel, aConfig));
|
||||||
|
aSynthuseConfigPanel.getXPathListTextField().addActionListener(xpathListTextFieldActionHandler(aSynthuseConfigPanel, aConfig));
|
||||||
|
}
|
||||||
|
|
||||||
|
private static ActionListener xpathListTextFieldActionHandler(final SynthuseConfigPanel aSynthuseConfigPanel,
|
||||||
|
final Config aConfig) {
|
||||||
|
return new ActionListener() {
|
||||||
|
@Override
|
||||||
|
public void actionPerformed(ActionEvent aE) {
|
||||||
|
aConfig.setXPathList(aSynthuseConfigPanel.getXPathListTextField().getText());
|
||||||
|
JOptionPane.showMessageDialog(aSynthuseConfigPanel, "May require restart to be effective");
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
private static ActionListener xpathHighlightTextFieldActionHandler(final SynthuseConfigPanel aSynthuseConfigPanel,
|
||||||
|
final Config aConfig) {
|
||||||
|
return new ActionListener() {
|
||||||
|
@Override
|
||||||
|
public void actionPerformed(ActionEvent aE) {
|
||||||
|
aConfig.setXPathHighlight(aSynthuseConfigPanel.getXPathHighlightTextField().getText());
|
||||||
|
JOptionPane.showMessageDialog(aSynthuseConfigPanel, "May require restart to be effective");
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
private static ActionListener targetKeyCodeTextFieldActionHandler(final SynthuseConfigPanel aSynthuseConfigPanel,
|
||||||
|
final Config aConfig) {
|
||||||
|
return new ActionListener() {
|
||||||
|
@Override
|
||||||
|
public void actionPerformed(ActionEvent aE) {
|
||||||
|
aConfig.setTargetKey(aSynthuseConfigPanel.getTargetKeyTextField().getText());
|
||||||
|
JOptionPane.showMessageDialog(aSynthuseConfigPanel, "May require restart to be effective");
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
private static ActionListener strongTextMatchingCheckboxActionHandler(
|
||||||
|
final SynthuseConfigPanel aSynthuseConfigPanel, final Config aConfig) {
|
||||||
|
return new ActionListener() {
|
||||||
|
@Override
|
||||||
|
public void actionPerformed(ActionEvent aE) {
|
||||||
|
aConfig.setUseStrongTextMatching(aSynthuseConfigPanel.getStrongTextMatchingCheckBox().isSelected());
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
private static ActionListener refreshKeyCodeTextFieldActionHandler(final SynthuseConfigPanel aSynthuseConfigPanel,
|
||||||
|
final Config aConfig) {
|
||||||
|
return new ActionListener() {
|
||||||
|
@Override
|
||||||
|
public void actionPerformed(ActionEvent aE) {
|
||||||
|
aConfig.setRefreshKey(aSynthuseConfigPanel.getRefreshKeyTextField().getText());
|
||||||
|
JOptionPane.showMessageDialog(aSynthuseConfigPanel, "May require restart to be effective");
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
private static ActionListener disableUiaBridgeCheckboxActionHandler(final SynthuseConfigPanel aSynthuseConfigPanel,
|
||||||
|
final Config aConfig) {
|
||||||
|
return new ActionListener() {
|
||||||
|
@Override
|
||||||
|
public void actionPerformed(ActionEvent aE) {
|
||||||
|
aConfig.setDisableUiaBridge(aSynthuseConfigPanel.getDisableUiaBridgeCheckBox().isSelected());
|
||||||
|
JOptionPane.showMessageDialog(aSynthuseConfigPanel, "May require restart to be effective");
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
private static ActionListener disableFiltersUiaCheckboxActionHandler(final SynthuseConfigPanel aSynthuseConfigPanel,
|
||||||
|
final Config aConfig) {
|
||||||
|
return new ActionListener() {
|
||||||
|
@Override
|
||||||
|
public void actionPerformed(ActionEvent aE) {
|
||||||
|
aConfig.setDisableFiltersUia(aSynthuseConfigPanel.getDisableFiltersUiaCheckBox().isSelected());
|
||||||
|
JOptionPane.showMessageDialog(aSynthuseConfigPanel, "May require restart to be effective");
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
private static ActionListener alwaysOnTopCheckboxActionHandler(final SynthuseConfigPanel aSynthuseConfigPanel,
|
||||||
|
final Config aConfig) {
|
||||||
|
return new ActionListener() {
|
||||||
|
@Override
|
||||||
|
public void actionPerformed(ActionEvent aE) {
|
||||||
|
aConfig.setAlwaysOnTop(aSynthuseConfigPanel.getAlwaysOnTopCheckBox().isSelected());
|
||||||
|
JOptionPane.showMessageDialog(aSynthuseConfigPanel, "May require restart to be effective");
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
225
src/org/synthuse/views/SynthuseConfigPanel.java
Executable file
225
src/org/synthuse/views/SynthuseConfigPanel.java
Executable file
@@ -0,0 +1,225 @@
|
|||||||
|
/*
|
||||||
|
* To change this license header, choose License Headers in Project Properties.
|
||||||
|
* To change this template file, choose Tools | Templates
|
||||||
|
* and open the template in the editor.
|
||||||
|
*/
|
||||||
|
package org.synthuse.views;
|
||||||
|
|
||||||
|
import javax.swing.JCheckBox;
|
||||||
|
import javax.swing.JTextField;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author ux29sy
|
||||||
|
*/
|
||||||
|
public class SynthuseConfigPanel extends javax.swing.JPanel {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates new form SynthuseConfigPanel
|
||||||
|
*/
|
||||||
|
public SynthuseConfigPanel() {
|
||||||
|
initComponents();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This method is called from within the constructor to initialize the form.
|
||||||
|
* WARNING: Do NOT modify this code. The content of this method is always
|
||||||
|
* regenerated by the Form Editor.
|
||||||
|
*/
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
|
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
|
||||||
|
private void initComponents() {
|
||||||
|
java.awt.GridBagConstraints gridBagConstraints;
|
||||||
|
|
||||||
|
theStrongTextMatchingCheckBox = new javax.swing.JCheckBox();
|
||||||
|
theAlwaysOnTopCheckBox = new javax.swing.JCheckBox();
|
||||||
|
theDisableUiaBridgeCheckBox = new javax.swing.JCheckBox();
|
||||||
|
theDisableFiltersUiaCheckBox = new javax.swing.JCheckBox();
|
||||||
|
jLabel1 = new javax.swing.JLabel();
|
||||||
|
jLabel2 = new javax.swing.JLabel();
|
||||||
|
jLabel3 = new javax.swing.JLabel();
|
||||||
|
jLabel4 = new javax.swing.JLabel();
|
||||||
|
filler1 = new javax.swing.Box.Filler(new java.awt.Dimension(0, 20), new java.awt.Dimension(0, 20), new java.awt.Dimension(0, 32767));
|
||||||
|
filler2 = new javax.swing.Box.Filler(new java.awt.Dimension(90, 0), new java.awt.Dimension(90, 0), new java.awt.Dimension(32767, 0));
|
||||||
|
theRefreshKeyTextField = new javax.swing.JTextField();
|
||||||
|
theTargetKeyTextField = new javax.swing.JTextField();
|
||||||
|
theXPathListTextField = new javax.swing.JTextField();
|
||||||
|
theXPathHighlightTextField = new javax.swing.JTextField();
|
||||||
|
filler3 = new javax.swing.Box.Filler(new java.awt.Dimension(50, 0), new java.awt.Dimension(50, 0), new java.awt.Dimension(50, 32767));
|
||||||
|
|
||||||
|
setLayout(new java.awt.GridBagLayout());
|
||||||
|
|
||||||
|
theStrongTextMatchingCheckBox.setText("Use Strong Text Matching");
|
||||||
|
theStrongTextMatchingCheckBox.setHorizontalTextPosition(javax.swing.SwingConstants.LEADING);
|
||||||
|
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||||
|
gridBagConstraints.gridx = 0;
|
||||||
|
gridBagConstraints.gridy = 0;
|
||||||
|
gridBagConstraints.gridwidth = 2;
|
||||||
|
gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
|
||||||
|
gridBagConstraints.insets = new java.awt.Insets(3, 3, 3, 3);
|
||||||
|
add(theStrongTextMatchingCheckBox, gridBagConstraints);
|
||||||
|
|
||||||
|
theAlwaysOnTopCheckBox.setText("Always On Top");
|
||||||
|
theAlwaysOnTopCheckBox.setHorizontalTextPosition(javax.swing.SwingConstants.LEADING);
|
||||||
|
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||||
|
gridBagConstraints.gridx = 0;
|
||||||
|
gridBagConstraints.gridy = 1;
|
||||||
|
gridBagConstraints.gridwidth = 2;
|
||||||
|
gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
|
||||||
|
gridBagConstraints.insets = new java.awt.Insets(3, 3, 3, 3);
|
||||||
|
add(theAlwaysOnTopCheckBox, gridBagConstraints);
|
||||||
|
|
||||||
|
theDisableUiaBridgeCheckBox.setText("Disable Uia Bridge");
|
||||||
|
theDisableUiaBridgeCheckBox.setHorizontalTextPosition(javax.swing.SwingConstants.LEADING);
|
||||||
|
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||||
|
gridBagConstraints.gridx = 0;
|
||||||
|
gridBagConstraints.gridy = 2;
|
||||||
|
gridBagConstraints.gridwidth = 2;
|
||||||
|
gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
|
||||||
|
gridBagConstraints.insets = new java.awt.Insets(3, 3, 3, 3);
|
||||||
|
add(theDisableUiaBridgeCheckBox, gridBagConstraints);
|
||||||
|
|
||||||
|
theDisableFiltersUiaCheckBox.setText("Disable Filters Uia");
|
||||||
|
theDisableFiltersUiaCheckBox.setHorizontalTextPosition(javax.swing.SwingConstants.LEADING);
|
||||||
|
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||||
|
gridBagConstraints.gridx = 0;
|
||||||
|
gridBagConstraints.gridy = 3;
|
||||||
|
gridBagConstraints.gridwidth = 2;
|
||||||
|
gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
|
||||||
|
gridBagConstraints.insets = new java.awt.Insets(3, 3, 3, 3);
|
||||||
|
add(theDisableFiltersUiaCheckBox, gridBagConstraints);
|
||||||
|
|
||||||
|
jLabel1.setText("Refresh Key:");
|
||||||
|
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||||
|
gridBagConstraints.gridx = 4;
|
||||||
|
gridBagConstraints.gridy = 0;
|
||||||
|
gridBagConstraints.gridheight = 2;
|
||||||
|
gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
|
||||||
|
gridBagConstraints.insets = new java.awt.Insets(3, 3, 3, 3);
|
||||||
|
add(jLabel1, gridBagConstraints);
|
||||||
|
|
||||||
|
jLabel2.setText("Target Key:");
|
||||||
|
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||||
|
gridBagConstraints.gridx = 4;
|
||||||
|
gridBagConstraints.gridy = 2;
|
||||||
|
gridBagConstraints.gridheight = 2;
|
||||||
|
gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
|
||||||
|
gridBagConstraints.insets = new java.awt.Insets(3, 3, 3, 3);
|
||||||
|
add(jLabel2, gridBagConstraints);
|
||||||
|
|
||||||
|
jLabel3.setText("XPath List:");
|
||||||
|
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||||
|
gridBagConstraints.gridx = 0;
|
||||||
|
gridBagConstraints.gridy = 5;
|
||||||
|
gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
|
||||||
|
gridBagConstraints.insets = new java.awt.Insets(6, 6, 6, 6);
|
||||||
|
add(jLabel3, gridBagConstraints);
|
||||||
|
|
||||||
|
jLabel4.setText("XPath Highlight:");
|
||||||
|
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||||
|
gridBagConstraints.gridx = 0;
|
||||||
|
gridBagConstraints.gridy = 6;
|
||||||
|
gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
|
||||||
|
gridBagConstraints.insets = new java.awt.Insets(6, 6, 6, 6);
|
||||||
|
add(jLabel4, gridBagConstraints);
|
||||||
|
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||||
|
gridBagConstraints.gridx = 0;
|
||||||
|
gridBagConstraints.gridy = 4;
|
||||||
|
add(filler1, gridBagConstraints);
|
||||||
|
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||||
|
gridBagConstraints.gridx = 2;
|
||||||
|
gridBagConstraints.gridy = 0;
|
||||||
|
add(filler2, gridBagConstraints);
|
||||||
|
|
||||||
|
theRefreshKeyTextField.setText("XXXX");
|
||||||
|
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||||
|
gridBagConstraints.gridx = 5;
|
||||||
|
gridBagConstraints.gridy = 0;
|
||||||
|
gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
|
||||||
|
gridBagConstraints.gridheight = 2;
|
||||||
|
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
|
||||||
|
add(theRefreshKeyTextField, gridBagConstraints);
|
||||||
|
|
||||||
|
theTargetKeyTextField.setText("XXXX");
|
||||||
|
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||||
|
gridBagConstraints.gridx = 5;
|
||||||
|
gridBagConstraints.gridy = 2;
|
||||||
|
gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
|
||||||
|
gridBagConstraints.gridheight = 2;
|
||||||
|
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
|
||||||
|
add(theTargetKeyTextField, gridBagConstraints);
|
||||||
|
|
||||||
|
theXPathListTextField.setText("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX");
|
||||||
|
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||||
|
gridBagConstraints.gridx = 1;
|
||||||
|
gridBagConstraints.gridy = 5;
|
||||||
|
gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
|
||||||
|
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
|
||||||
|
gridBagConstraints.insets = new java.awt.Insets(6, 6, 6, 6);
|
||||||
|
add(theXPathListTextField, gridBagConstraints);
|
||||||
|
|
||||||
|
theXPathHighlightTextField.setText("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX");
|
||||||
|
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||||
|
gridBagConstraints.gridx = 1;
|
||||||
|
gridBagConstraints.gridy = 6;
|
||||||
|
gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
|
||||||
|
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
|
||||||
|
gridBagConstraints.insets = new java.awt.Insets(6, 6, 6, 6);
|
||||||
|
add(theXPathHighlightTextField, gridBagConstraints);
|
||||||
|
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||||
|
gridBagConstraints.gridx = 5;
|
||||||
|
gridBagConstraints.gridy = 4;
|
||||||
|
add(filler3, gridBagConstraints);
|
||||||
|
}// </editor-fold>//GEN-END:initComponents
|
||||||
|
|
||||||
|
|
||||||
|
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||||
|
private javax.swing.Box.Filler filler1;
|
||||||
|
private javax.swing.Box.Filler filler2;
|
||||||
|
private javax.swing.Box.Filler filler3;
|
||||||
|
private javax.swing.JLabel jLabel1;
|
||||||
|
private javax.swing.JLabel jLabel2;
|
||||||
|
private javax.swing.JLabel jLabel3;
|
||||||
|
private javax.swing.JLabel jLabel4;
|
||||||
|
private javax.swing.JCheckBox theAlwaysOnTopCheckBox;
|
||||||
|
private javax.swing.JCheckBox theDisableFiltersUiaCheckBox;
|
||||||
|
private javax.swing.JCheckBox theDisableUiaBridgeCheckBox;
|
||||||
|
private javax.swing.JTextField theRefreshKeyTextField;
|
||||||
|
private javax.swing.JCheckBox theStrongTextMatchingCheckBox;
|
||||||
|
private javax.swing.JTextField theTargetKeyTextField;
|
||||||
|
private javax.swing.JTextField theXPathHighlightTextField;
|
||||||
|
private javax.swing.JTextField theXPathListTextField;
|
||||||
|
// End of variables declaration//GEN-END:variables
|
||||||
|
|
||||||
|
public JCheckBox getAlwaysOnTopCheckBox() {
|
||||||
|
return theAlwaysOnTopCheckBox;
|
||||||
|
}
|
||||||
|
|
||||||
|
public JCheckBox getDisableFiltersUiaCheckBox() {
|
||||||
|
return theDisableFiltersUiaCheckBox;
|
||||||
|
}
|
||||||
|
|
||||||
|
public JCheckBox getDisableUiaBridgeCheckBox() {
|
||||||
|
return theDisableUiaBridgeCheckBox;
|
||||||
|
}
|
||||||
|
|
||||||
|
public JTextField getRefreshKeyTextField() {
|
||||||
|
return theRefreshKeyTextField;
|
||||||
|
}
|
||||||
|
|
||||||
|
public JCheckBox getStrongTextMatchingCheckBox() {
|
||||||
|
return theStrongTextMatchingCheckBox;
|
||||||
|
}
|
||||||
|
|
||||||
|
public JTextField getTargetKeyTextField() {
|
||||||
|
return theTargetKeyTextField;
|
||||||
|
}
|
||||||
|
|
||||||
|
public JTextField getXPathHighlightTextField() {
|
||||||
|
return theXPathHighlightTextField;
|
||||||
|
}
|
||||||
|
|
||||||
|
public JTextField getXPathListTextField() {
|
||||||
|
return theXPathListTextField;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,9 +1,10 @@
|
|||||||
#
|
#
|
||||||
#Tue May 06 12:01:23 EDT 2014
|
#Tue Sep 22 12:05:52 CEST 2015
|
||||||
targetKey=`
|
targetKey=`
|
||||||
|
useStrongTextMatching=true
|
||||||
disableUiaBridge=false
|
disableUiaBridge=false
|
||||||
disableFiltersUia=false
|
disableFiltersUia=false
|
||||||
alwaysOnTop=true
|
alwaysOnTop=false
|
||||||
refreshKey=3
|
refreshKey=3
|
||||||
DEFAULT_PROP_FILENAME=
|
DEFAULT_PROP_FILENAME=
|
||||||
xpathHightlight=
|
xpathHightlight=
|
||||||
|
|||||||
Reference in New Issue
Block a user