Commit 4f5ec518 authored by Adrien's avatar Adrien Committed by Romain Bioteau
Browse files

feat(welcome message) (#617)

* add an expandable details section
* use existing key for details section
* change Import workspace menu from 'From another Workspace...' to
'Workspace...'


closes [BS-16837](https://bonitasoft.atlassian.net/browse/BS-16837)
closes [BS-16839](https://bonitasoft.atlassian.net/browse/BS-16839)
parent f6e5df06
......@@ -32,6 +32,7 @@ incompatibleJavaVersionTitle=Incompatible java runtime environment version
incompatibleJavaVersionMessage=You are running {0} using an incompatible JRE version ({1}).\nPlease check java requirements.
exitWarningMessage=Exit {0}?\n\nClosing the Studio will delete unsaved work in the {1} and in the {2}. Be sure you have saved any opened elements in the {2}, and export your custom resources from the {1}.\n\nNote: In <A>Preferences > Database</A>, you can uncheck the "On exit clean database" option to keep your database content.
startDialogTitle=Welcome
doNotShowMeAgain=Do not show me again
doNotShowMeAgain=Do not show me this dialog again
startDialogMsg=Welcome to Bonita Studio. If you are upgrading from a previous version you may want to <a>%s</a>.
importWorkFromAnotherWorkspace=import your work from another workspace
\ No newline at end of file
importWorkFromAnotherWorkspace=import your work from an existing workspace
startDialogDetails=you can import an existing workspace later, using the following menu from the Studio:\nFile > Import > Workspace
\ No newline at end of file
......@@ -29,6 +29,7 @@ import org.eclipse.e4.core.contexts.IEclipseContext;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.layout.GridDataFactory;
import org.eclipse.jface.layout.GridLayoutFactory;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.resource.JFaceResources;
import org.eclipse.swt.SWT;
......@@ -42,6 +43,9 @@ import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Link;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.forms.events.ExpansionAdapter;
import org.eclipse.ui.forms.events.ExpansionEvent;
import org.eclipse.ui.forms.widgets.Section;
import org.eclipse.ui.internal.WorkbenchWindow;
public class StartupMessageDialog extends MessageDialogWithPrompt {
......@@ -100,10 +104,41 @@ public class StartupMessageDialog extends MessageDialogWithPrompt {
Display.getDefault().asyncExec(this::openImportWorkspaceDialog);
}
});
createDetailsSection(composite);
}
return composite;
}
private void createDetailsSection(Composite parent) {
Label filer = new Label(parent, SWT.NONE);
filer.setLayoutData(GridDataFactory.fillDefaults().create());
Section detailsSection = new Section(parent, Section.TWISTIE | Section.NO_TITLE_FOCUS_BOX | Section.CLIENT_INDENT);
detailsSection.setLayout(GridLayoutFactory.fillDefaults().create());
detailsSection.setLayoutData(GridDataFactory.fillDefaults().grab(true, true).create());
detailsSection.setText(org.bonitasoft.studio.common.Messages.moreDetails);
Composite detailsComposite = new Composite(detailsSection, SWT.NONE);
detailsComposite.setLayout(GridLayoutFactory.fillDefaults().create());
detailsComposite.setLayoutData(GridDataFactory.fillDefaults().grab(true, true).create());
Label details = new Label(detailsComposite, SWT.NONE);
details.setLayoutData(GridDataFactory.fillDefaults().create());
details.setText(Messages.startDialogDetails);
detailsSection.setClient(detailsComposite);
detailsSection.addExpansionListener(new ExpansionAdapter() {
@Override
public void expansionStateChanged(ExpansionEvent e) {
parent.getShell().pack();
}
});
}
private void openImportWorkspaceDialog() {
IEclipseContext context = ((WorkbenchWindow) PlatformUI.getWorkbench().getActiveWorkbenchWindow()).getModel()
.getContext();
......
......@@ -69,6 +69,8 @@ public class Messages extends NLS {
public static String startDialogMsg;
public static String importWorkFromAnotherWorkspace;
public static String startDialogDetails;
static {
NLS.initializeMessages(BUNDLE_NAME, Messages.class);
}
......
import_BOS_desc=Import processes designed with Bonita Studio 6.x and 7.x (.bos)
import_BOS_Name=Bonita 6.x and 7.x
importBosCommandLabel=BOS archive...
importWorkspaceCommandLabel=From another Workspace...
\ No newline at end of file
importWorkspaceCommandLabel=Workspace...
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment