Skip to content

Commit

Permalink
Merge branch 'master2023' into 'master'
Browse files Browse the repository at this point in the history
#2023 : В DS в настройках соединения с сервером добавить команду "сохранить соединение"

See merge request shared/runawfe-professional-devstudio!183
  • Loading branch information
dofs197 committed Mar 29, 2021
2 parents 80b7b61 + 214aa49 commit 4e83d2d
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 3 deletions.
3 changes: 2 additions & 1 deletion plugins/ru.runa.gpd/plugin.properties
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,8 @@ pref.language.bpmn.expandContextButtonPad = Expand context button pad
ApplicationWorkbenchWindowAdvisor.window.title=RunaWFE Developer Studio
button.choose=Choose
button.ConnectionSettings = Connection settings
button.add.connection.server = Add
button.ConnectionSettings = Configure
button.test.connection = Test connection
button.add.connection = Add connection
button.delete.connection = Delete connection
Expand Down
3 changes: 2 additions & 1 deletion plugins/ru.runa.gpd/plugin_ru.properties
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,8 @@ pref.language.bpmn.override = \u041f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u
pref.language.bpmn.expandContextButtonPad = \u041f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0432\u0441\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u0432 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u043d\u043e\u043c \u043c\u0435\u043d\u044e \u043d\u0430 \u0433\u0440\u0430\u0444\u0435

button.choose=\u0412\u044b\u0431\u0440\u0430\u0442\u044c
button.ConnectionSettings = \u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f
button.add.connection.server=\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c
button.ConnectionSettings = \u041d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c
button.test.connection = \u041f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435
button.add.connection = \u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u043D\u043E\u0432\u043E\u0435 \u0441\u043E\u0435\u0434\u0438\u043D\u0435\u043D\u0438\u0435
button.delete.connection = \u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0441\u043E\u0435\u0434\u0438\u043D\u0435\u043D\u0438\u0435
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,13 @@
import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.dialogs.PreferencesUtil;
import org.eclipse.ui.forms.events.HyperlinkEvent;
import org.eclipse.ui.forms.widgets.Hyperlink;
import ru.runa.gpd.Activator;
import ru.runa.gpd.Localization;
import ru.runa.gpd.settings.PrefConstants;
import ru.runa.gpd.settings.WfeServerConnectorPreferenceNode;
import ru.runa.gpd.settings.WfeServerConnectorPreferencePage;
import ru.runa.gpd.settings.WfeServerConnectorsPreferenceNode;
import ru.runa.gpd.ui.custom.LoggingHyperlinkAdapter;
Expand All @@ -28,15 +30,18 @@ public class WfeServerConnectorComposite extends Composite {
private final WfeServerConnectorDataImporter<?> importer;
private final WfeServerConnectorSynchronizationCallback callback;
private Combo combo;
private Hyperlink addConnectionLink;
private Hyperlink settingsLink;
private Hyperlink synchronizeLink;

public WfeServerConnectorComposite(Composite parent, WfeServerConnectorDataImporter<?> importer, WfeServerConnectorSynchronizationCallback callback) {
super(parent, SWT.NONE);
this.importer = importer;
this.callback = callback;
setLayout(new GridLayout(3, true));
setLayout(new GridLayout(4, false));

createCombo();
createAddConnectionLink();
createConnectionSettingsLink();
createSynchronizeLink();
}
Expand All @@ -45,6 +50,7 @@ public WfeServerConnectorComposite(Composite parent, WfeServerConnectorDataImpor
public void setEnabled(boolean enabled) {
super.setEnabled(enabled);
combo.setEnabled(enabled);
addConnectionLink.setEnabled(enabled);
settingsLink.setEnabled(enabled);
synchronizeLink.setEnabled(enabled && WfeServerConnector.getInstance().isConfigured());
}
Expand Down Expand Up @@ -79,6 +85,33 @@ protected void onSelection(SelectionEvent e) throws Exception {
});
}

private void createAddConnectionLink() {
addConnectionLink = SwtUtils.createLink(this, Localization.getString("button.add.connection.server"), new LoggingHyperlinkAdapter() {

@Override
protected void onLinkActivated(HyperlinkEvent e) {
getShell().dispose();
openAddConnectionDialog();
}

});
}

private void openAddConnectionDialog() {
WfeServerConnectorsPreferenceNode wfeServerConnectorsNode = WfeServerConnectorsPreferenceNode.getInstance();
IPreferenceNode[] children = wfeServerConnectorsNode.getSubNodes();
WfeServerConnectorPreferenceNode lastNode = (WfeServerConnectorPreferenceNode) children[children.length - 1];
WfeServerConnectorPreferenceNode node = new WfeServerConnectorPreferenceNode(lastNode.getIndex() + 1);
wfeServerConnectorsNode.add(node);
wfeServerConnectorsNode.saveIndices();
WfeServerConnectorSettings connectorSettings = WfeServerConnectorSettings.createDefault(node.getIndex());
connectorSettings.saveToStore();
children = wfeServerConnectorsNode.getSubNodes();
lastNode = (WfeServerConnectorPreferenceNode) children[children.length - 1];
PreferenceDialog dialog = PreferencesUtil.createPreferenceDialogOn(null, "gpd.pref.connector.wfe." + lastNode.getIndex(), null, null);
dialog.open();
}

private void createConnectionSettingsLink() {
settingsLink = SwtUtils.createLink(this, Localization.getString("button.ConnectionSettings"), new LoggingHyperlinkAdapter() {

Expand Down

0 comments on commit 4e83d2d

Please sign in to comment.