Commit b925d954 authored by azara's avatar azara
Browse files

Merge branch '6.3.x' of https://github.com/bonitasoft/bonita-studio.git into 6.3.x

parents 2629be16 a3db06ea
......@@ -303,7 +303,8 @@ dataListViewerTitle=Data
searchIndexListViewerTitle=Search index
parameterListTitle=Parameter
widgetListViewerTitle=Widget
outlineDialogRefactoringText=Here are the references found for theerrorValidationMessage=Some errors have been found in the diagram
outlineDialogRefactoringText=Here are the references found for the {0}\:
errorValidationMessage=Some errors have been found in the diagram
errorValidationContinueAnywayMessage=\n Do you want to continue anyway? {0}\:
errorValidationMessage = Some errors have been found in the diagram
validationFailedTitle=Some errors have been found in the diagram
\ No newline at end of file
validationFailedTitle=Some errors have been found in the diagram
removalConfirmationDialogTitle=Removal confirmation
\ No newline at end of file
/**
* Copyright (C) 2012 BonitaSoft S.A.
* Copyright (C) 2012-2014 BonitaSoft S.A.
* BonitaSoft, 32 rue Gustave Eiffel - 38000 Grenoble
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2.0 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.bonitasoft.studio.properties.sections.document;
import static org.bonitasoft.studio.common.Messages.bonitaPortalModuleName;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
......@@ -69,32 +64,32 @@ public abstract class FileStoreSelectDialog extends Dialog {
private Button removeButton;
private AbstractFileStore selected;
public FileStoreSelectDialog(Shell parentShell) {
public FileStoreSelectDialog(final Shell parentShell) {
super(parentShell);
}
public FileStoreSelectDialog(IShellProvider parentShell) {
public FileStoreSelectDialog(final IShellProvider parentShell) {
super(parentShell);
}
@Override
protected void configureShell(Shell newShell) {
protected void configureShell(final Shell newShell) {
super.configureShell(newShell);
newShell.setText(getDialogTitle());
}
@Override
protected Control createContents(Composite parent) {
protected Control createContents(final Composite parent) {
final Control createContents = super.createContents(parent);
fileStoreListViewer.setSelection(new StructuredSelection());
return createContents;
}
@Override
protected Control createDialogArea(Composite parent) {
protected Control createDialogArea(final Composite parent) {
final Control dialogArea = super.createDialogArea(parent);
Composite mainComposite = new Composite((Composite) dialogArea, SWT.NONE);
final Composite mainComposite = new Composite((Composite) dialogArea, SWT.NONE);
mainComposite.setLayout(GridLayoutFactory.fillDefaults().numColumns(2).create());
mainComposite.setLayoutData(GridDataFactory.fillDefaults().grab(true, true).create());
createDescription(mainComposite);
......@@ -104,14 +99,16 @@ public abstract class FileStoreSelectDialog extends Dialog {
return dialogArea;
}
private void createDescription(Composite mainComposite) {
Label descriptionLabel = new Label(mainComposite, SWT.NONE);
private void createDescription(final Composite mainComposite) {
final Label descriptionLabel = new Label(mainComposite, SWT.NONE);
descriptionLabel.setLayoutData(GridDataFactory.fillDefaults().grab(true, false).span(2,1).create());
descriptionLabel.setText(Messages.bind(Messages.selectDocumentDescription, new Object[]{bonitaPortalModuleName}));
descriptionLabel.setText(getDialogDescription());
}
private void createList(Composite mainComposite) {
Composite listComposite = new Composite(mainComposite, SWT.NONE);
protected abstract String getDialogDescription();
private void createList(final Composite mainComposite) {
final Composite listComposite = new Composite(mainComposite, SWT.NONE);
listComposite.setLayout(GridLayoutFactory.fillDefaults().create());
listComposite.setLayoutData(GridDataFactory.fillDefaults().grab(true, true).create());
final Text fileStoreListFilter = new Text(listComposite, SWT.BORDER | SWT.SEARCH | SWT.ICON_SEARCH | SWT.ICON_CANCEL);
......@@ -122,7 +119,7 @@ public abstract class FileStoreSelectDialog extends Dialog {
private ViewerFilter filter;
@Override
public void modifyText(ModifyEvent e) {
public void modifyText(final ModifyEvent e) {
final String textForFiltering = fileStoreListFilter.getText();
if(filter != null){
fileStoreListViewer.removeFilter(filter);
......@@ -132,7 +129,7 @@ public abstract class FileStoreSelectDialog extends Dialog {
filter = new ViewerFilter() {
@Override
public boolean select(Viewer viewer, Object parentElement, Object element) {
public boolean select(final Viewer viewer, final Object parentElement, final Object element) {
return ((AbstractFileStore)element).getName().contains(textForFiltering);
}
};
......@@ -145,12 +142,12 @@ public abstract class FileStoreSelectDialog extends Dialog {
fileStoreListViewer.getList().setLayoutData(GridDataFactory.fillDefaults().grab(true, true).hint(SWT.DEFAULT, 300).create());
fileStoreListViewer.setContentProvider(new ArrayContentProvider());
fileStoreListViewer.setLabelProvider(new FileStoreLabelProvider());
IRepositoryStore<?> ars = (IRepositoryStore<?>) RepositoryManager.getInstance().getRepositoryStore(getRepositoryStoreClass());
final IRepositoryStore<?> ars = (IRepositoryStore<?>) RepositoryManager.getInstance().getRepositoryStore(getRepositoryStoreClass());
fileStoreListViewer.setInput(ars.getChildren());
fileStoreListViewer.addSelectionChangedListener(new ISelectionChangedListener() {
@Override
public void selectionChanged(SelectionChangedEvent event) {
public void selectionChanged(final SelectionChangedEvent event) {
final boolean empty = event.getSelection().isEmpty();
getButton(IDialogConstants.OK_ID).setEnabled(!empty);
removeButton.setEnabled(!empty);
......@@ -160,9 +157,9 @@ public abstract class FileStoreSelectDialog extends Dialog {
fileStoreListViewer.getList().setFocus();
}
private void createButtons(Composite mainComposite) {
Composite buttonComposite = new Composite(mainComposite, SWT.NONE);
RowLayout rowLayout = new RowLayout(SWT.VERTICAL);
private void createButtons(final Composite mainComposite) {
final Composite buttonComposite = new Composite(mainComposite, SWT.NONE);
final RowLayout rowLayout = new RowLayout(SWT.VERTICAL);
rowLayout.fill = true;
buttonComposite.setLayout(rowLayout);
createAddButton(buttonComposite);
......@@ -170,32 +167,32 @@ public abstract class FileStoreSelectDialog extends Dialog {
}
private void createAddButton(Composite buttonComposite) {
Button addButton = new Button(buttonComposite, SWT.FLAT);
private void createAddButton(final Composite buttonComposite) {
final Button addButton = new Button(buttonComposite, SWT.FLAT);
addButton.setText(Messages.importEtc);
addButton.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
FileDialog fileDialog = new FileDialog(getShell());
String fileDialogResult = fileDialog.open();
public void widgetSelected(final SelectionEvent e) {
final FileDialog fileDialog = new FileDialog(getShell());
final String fileDialogResult = fileDialog.open();
if(fileDialogResult != null){
AbstractRepositoryStore<IRepositoryFileStore> ars = (AbstractRepositoryStore<IRepositoryFileStore>)RepositoryManager.getInstance().getRepositoryStore(getRepositoryStoreClass());
File newFile = new File(fileDialogResult);
final AbstractRepositoryStore<IRepositoryFileStore> ars = (AbstractRepositoryStore<IRepositoryFileStore>)RepositoryManager.getInstance().getRepositoryStore(getRepositoryStoreClass());
final File newFile = new File(fileDialogResult);
FileInputStream inputStream = null;
try {
inputStream = new FileInputStream(newFile);
IRepositoryFileStore fileStoreCreated = ars.importInputStream(newFile.getName(), inputStream);
final IRepositoryFileStore fileStoreCreated = ars.importInputStream(newFile.getName(), inputStream);
fileStoreListViewer.setInput(ars.getChildren());
fileStoreListViewer.setSelection(new StructuredSelection(fileStoreCreated));
fileStoreListViewer.refresh();
} catch (FileNotFoundException e1) {
} catch (final FileNotFoundException e1) {
BonitaStudioLog.error(e1);
} finally {
if(inputStream != null){
try {
inputStream.close();
} catch (IOException e1) {
} catch (final IOException e1) {
BonitaStudioLog.error(e1);
}
}
......@@ -206,15 +203,15 @@ public abstract class FileStoreSelectDialog extends Dialog {
});
}
private void createRemoveButton(Composite buttonComposite) {
private void createRemoveButton(final Composite buttonComposite) {
removeButton = new Button(buttonComposite, SWT.FLAT);
removeButton.setText(Messages.remove);
removeButton.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
public void widgetSelected(final SelectionEvent e) {
super.widgetSelected(e);
((IRepositoryFileStore) ((StructuredSelection) fileStoreListViewer.getSelection()).getFirstElement()).delete();
AbstractRepositoryStore<IRepositoryFileStore> ars = (AbstractRepositoryStore<IRepositoryFileStore>)RepositoryManager.getInstance().getRepositoryStore(getRepositoryStoreClass());
final AbstractRepositoryStore<IRepositoryFileStore> ars = (AbstractRepositoryStore<IRepositoryFileStore>)RepositoryManager.getInstance().getRepositoryStore(getRepositoryStoreClass());
fileStoreListViewer.setInput(ars.getChildren());
}
});
......
/**
* Copyright (C) 2012 BonitaSoft S.A.
* Copyright (C) 2012-2014 BonitaSoft S.A.
* BonitaSoft, 32 rue Gustave Eiffel - 38000 Grenoble
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2.0 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.bonitasoft.studio.properties.sections.document;
......@@ -31,11 +28,11 @@ import org.eclipse.swt.widgets.Shell;
*/
public class SelectDocumentInBonitaStudioRepository extends FileStoreSelectDialog {
public SelectDocumentInBonitaStudioRepository(IShellProvider parentShell) {
public SelectDocumentInBonitaStudioRepository(final IShellProvider parentShell) {
super(parentShell);
}
public SelectDocumentInBonitaStudioRepository(Shell parentShell){
public SelectDocumentInBonitaStudioRepository(final Shell parentShell){
super(parentShell);
}
......@@ -52,4 +49,10 @@ public class SelectDocumentInBonitaStudioRepository extends FileStoreSelectDialo
protected String getDialogTitle() {
return Messages.bind(Messages.selectDocumentDialogTitle, new Object[]{bonitaStudioModuleName});
}
@Override
protected String getDialogDescription() {
return Messages.bind(Messages.selectDocumentDescription, new Object[] { bonitaStudioModuleName });
}
}
......@@ -119,6 +119,6 @@ descripitonProperty=Description
tooLongDescriptionHasBeenTruncated=Une description de cet \u00e9l\u00e9ment a \u00e9t\u00e9 tronqu\u00e9e car elle d\u00e9passait le nouveau nombre maximum de caract\u00e8res autoris\u00e9s
warningImageFormat=Format d'image non valide
warningImageFormatMessage={0} n'a pas pu \u00eatre import\u00e9 car son format n'est pas support\u00e9. Merci d'utiliser l'un des formats suivants \: .gif;.jpg;.jpeg;.png;*.bmp.
migratingCustomConnector=Migrating custom connector {0}...
groovyForNameWarningDescription=Groovy reflection has been detected in script. The classpath management has changed and you should consider to change the script or put libraries in shared classpath
groovyForNameWarningPropertyName=Script content
migratingCustomConnector=Migration en cours du connecteur personnalis\u00e9 {0}...
groovyForNameWarningDescription=Une Groovy reflection a \u00e9t\u00e9 d\u00e9tect\u00e9 dans le script. La gestion du classpath a chang\u00e9 et vous devriez modifier le script ou placer les librairies dans un classpath partag\u00e9.
groovyForNameWarningPropertyName=Contenu du script
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