From f9873ef742946b10c037939eefb58f4652dc312f Mon Sep 17 00:00:00 2001 From: Ole Lensmar Date: Thu, 24 Nov 2016 22:06:52 +0100 Subject: [PATCH 1/2] Updated to use java 1.8 and fixed layout of global preferences dialog --- pom.xml | 14 ++- soapui/pom.xml | 17 ---- .../actions/SoapUIPreferencesAction.java | 96 +++++++++++-------- .../soapui/support/JsonPathFacade.java | 3 +- 4 files changed, 66 insertions(+), 64 deletions(-) diff --git a/pom.xml b/pom.xml index 2efae423e8..0b348cfccb 100644 --- a/pom.xml +++ b/pom.xml @@ -66,8 +66,8 @@ maven-compiler-plugin 3.1 - 1.7 - 1.7 + 1.8 + 1.8 @@ -97,7 +97,7 @@ - 1.7 + 1.8 true @@ -115,15 +115,19 @@ org.codehaus.mojo animal-sniffer-maven-plugin - 1.9 + 1.15 org.codehaus.mojo.signature - java17 + java18 1.0 + + javafx.* + netscape.* + diff --git a/soapui/pom.xml b/soapui/pom.xml index 6ffd177b7f..7686987ad3 100644 --- a/soapui/pom.xml +++ b/soapui/pom.xml @@ -584,21 +584,4 @@ - - - javafx.dependency - - [1.6,1.8] - - - - javafx - jfxrt - ${javafx.version} - system - ${javafx.runtime.lib.jar} - - - - diff --git a/soapui/src/main/java/com/eviware/soapui/actions/SoapUIPreferencesAction.java b/soapui/src/main/java/com/eviware/soapui/actions/SoapUIPreferencesAction.java index 12565d0500..b00fbe0ee3 100644 --- a/soapui/src/main/java/com/eviware/soapui/actions/SoapUIPreferencesAction.java +++ b/soapui/src/main/java/com/eviware/soapui/actions/SoapUIPreferencesAction.java @@ -1,40 +1,34 @@ /* - * SoapUI, Copyright (C) 2004-2016 SmartBear Software + * Copyright 2004-2014 SmartBear Software * - * Licensed under the EUPL, Version 1.1 or - as soon as they will be approved by the European Commission - subsequent - * versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * - * http://ec.europa.eu/idabc/eupl - * - * Unless required by applicable law or agreed to in writing, software distributed under the Licence is - * distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the Licence for the specific language governing permissions and limitations - * under the Licence. - */ + * Licensed under the EUPL, Version 1.1 or - as soon as they will be approved by the European Commission - subsequent + * versions of the EUPL (the "Licence"); + * You may not use this work except in compliance with the Licence. + * You may obtain a copy of the Licence at: + * + * http://ec.europa.eu/idabc/eupl + * + * Unless required by applicable law or agreed to in writing, software distributed under the Licence is + * distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the Licence for the specific language governing permissions and limitations + * under the Licence. +*/ package com.eviware.soapui.actions; import com.eviware.soapui.SoapUI; import com.eviware.soapui.impl.wsdl.support.HelpUrls; import com.eviware.soapui.model.settings.Settings; -import com.eviware.soapui.settings.HttpSettings; -import com.eviware.soapui.settings.SSLSettings; -import com.eviware.soapui.settings.SecuritySettings; -import com.eviware.soapui.settings.VersionUpdateSettings; -import com.eviware.soapui.settings.WSISettings; -import com.eviware.soapui.settings.WsaSettings; -import com.eviware.soapui.settings.WsdlSettings; +import com.eviware.soapui.settings.*; import com.eviware.soapui.support.UISupport; import com.eviware.soapui.support.components.SwingConfigurationDialogImpl; import com.eviware.soapui.support.factory.SoapUIFactoryRegistryListener; import com.eviware.soapui.support.types.StringToStringMap; -import javax.swing.AbstractAction; -import javax.swing.Action; -import javax.swing.JScrollPane; -import javax.swing.JTabbedPane; +import javax.swing.*; +import javax.swing.event.ListSelectionEvent; +import javax.swing.event.ListSelectionListener; +import java.awt.*; import java.awt.event.ActionEvent; import java.util.ArrayList; import java.util.HashMap; @@ -61,11 +55,12 @@ public class SoapUIPreferencesAction extends AbstractAction implements SoapUIFac public static final String GLOBAL_SENSITIVE_INFORMATION_TOKENS = "Global Sensitive Information Tokens"; public static final String VERSIONUPDATE_SETTINGS = "Version Update Settings"; private SwingConfigurationDialogImpl dialog; - private JTabbedPane tabs; private List prefs = new ArrayList(); private Map prefsFactories = new HashMap(); private static SoapUIPreferencesAction instance; + private DefaultListModel prefsListModel; + private JPanel prefsPanel; public SoapUIPreferencesAction() { super("Preferences"); @@ -102,8 +97,9 @@ public void addPrefsFactory(PrefsFactory factory) { addPrefs( pref ); prefsFactories.put( factory, pref ); - if( tabs != null ) - addPrefToTabs( pref ); + if (prefsPanel != null) { + addPrefToTabs(pref); + } } public void removePrefsFactory( PrefsFactory factory ) @@ -112,11 +108,13 @@ public void removePrefsFactory( PrefsFactory factory ) if( pref != null ) { prefsFactories.remove( factory ); - if( tabs != null ) + if (prefsPanel != null) { - int ix = tabs.indexOfTab( pref.getTitle() ); - if( ix != -1 ) - tabs.removeTabAt( ix ); + int ix = prefsListModel.indexOf(pref.getTitle()); + if (ix != -1) { + prefsListModel.remove(ix); + prefsPanel.remove(ix); + } } prefs.remove( pref ); @@ -166,11 +164,8 @@ public boolean show(String initialTab) { pref.setFormValues(settings); } - if (initialTab != null) { - int ix = tabs.indexOfTab(initialTab); - if (ix != -1) { - tabs.setSelectedIndex(ix); - } + if (prefsPanel != null && initialTab != null) { + selectPrefs(initialTab); } if (dialog.show(new StringToStringMap())) { @@ -184,22 +179,41 @@ public boolean show(String initialTab) { return false; } + public void selectPrefs(String initialTab) { + CardLayout cl = (CardLayout) (prefsPanel.getLayout()); + cl.show(prefsPanel, initialTab); + } + private void buildDialog() { dialog = new SwingConfigurationDialogImpl("SoapUI Preferences", HelpUrls.PREFERENCES_HELP_URL, "Set global SoapUI settings", UISupport.OPTIONS_ICON); + dialog.setSize(new Dimension(1000, 700)); + + prefsListModel = new DefaultListModel(); + JList prefItems = new JList(prefsListModel); + prefItems.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); + prefsPanel = new JPanel(new CardLayout()); - tabs = new JTabbedPane(); - tabs.setTabLayoutPolicy(JTabbedPane.SCROLL_TAB_LAYOUT); - tabs.setTabPlacement(JTabbedPane.LEFT); for (Prefs pref : prefs) { addPrefToTabs(pref); } - dialog.setContent(UISupport.createTabPanel(tabs, false)); + prefItems.addListSelectionListener(new ListSelectionListener() { + @Override + public void valueChanged(ListSelectionEvent e) { + selectPrefs(prefsListModel.get(e.getFirstIndex())); + } + }); + + JSplitPane split = UISupport.createHorizontalSplit(new JScrollPane(prefItems), new JScrollPane(prefsPanel)); + split.setDividerLocation(250); + split.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5)); + dialog.setContent(split); } private void addPrefToTabs(Prefs pref) { - tabs.addTab(pref.getTitle(), new JScrollPane(pref.getForm().getPanel())); + prefsPanel.add(pref.getForm().getPanel(), pref.getTitle()); + prefsListModel.addElement(pref.getTitle()); } } diff --git a/soapui/src/main/java/com/eviware/soapui/support/JsonPathFacade.java b/soapui/src/main/java/com/eviware/soapui/support/JsonPathFacade.java index f500685a1d..b02dfbd4b7 100644 --- a/soapui/src/main/java/com/eviware/soapui/support/JsonPathFacade.java +++ b/soapui/src/main/java/com/eviware/soapui/support/JsonPathFacade.java @@ -47,7 +47,8 @@ public JsonPathFacade(String targetJson) { } public String readStringValue(String jsonPathExpression) { - return String.valueOf(readObjectValue(jsonPathExpression)); + Object data = readObjectValue(jsonPathExpression); + return String.valueOf(data); } public void writeValue(String jsonPathExpression, Object value) { From b1e515c6ec0dd965da911b236568d3b2281937af Mon Sep 17 00:00:00 2001 From: Ole Lensmar Date: Thu, 24 Nov 2016 22:43:07 +0100 Subject: [PATCH 2/2] fixed selection of preferences page --- .../com/eviware/soapui/actions/SoapUIPreferencesAction.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/soapui/src/main/java/com/eviware/soapui/actions/SoapUIPreferencesAction.java b/soapui/src/main/java/com/eviware/soapui/actions/SoapUIPreferencesAction.java index b00fbe0ee3..597c5a3b38 100644 --- a/soapui/src/main/java/com/eviware/soapui/actions/SoapUIPreferencesAction.java +++ b/soapui/src/main/java/com/eviware/soapui/actions/SoapUIPreferencesAction.java @@ -201,7 +201,7 @@ private void buildDialog() { prefItems.addListSelectionListener(new ListSelectionListener() { @Override public void valueChanged(ListSelectionEvent e) { - selectPrefs(prefsListModel.get(e.getFirstIndex())); + selectPrefs(prefsListModel.get(prefItems.getSelectedIndex())); } });