New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 2017.02 #60

Merged
merged 30 commits into from Feb 8, 2017
Commits
Jump to file or symbol
Failed to load files and symbols.
+77 鈭17
Diff settings

Always

Just for now

Viewing a subset of changes. View all

Scroll drivers list (#23)

* master: create separate class (MessageDialogWithScrollableMessage)

# Conflicts:
#	com.cubrid.common.ui/src/com/cubrid/common/ui/spi/util/CommonUITool.java

* master: add scrollable window with the drivers list

* ScrollDriversList: repair git mistake

* ScrollDriversList: fix another merging mistake

* ScrollDriversList: replace "OK" with Messages.btnOk

* ScrollDriversList: choose whether you show informative message or informative message + scrollable text when opening an information box.

* ScrollDriversList: remove some unused imports

* ScrollDriversList: small improvement

* ScrollDriversList: remove a couple of double lines

* ScrollDriversList: change the same of two variables

* ScrollDriversList: remove redundant setLayout. format code

* ScrollDriversList: delete {0} from jdbcDriverDownloadSuccessMsg.
		   change the way we build the downloadedFiles string
  • Loading branch information...
paulgheorghecristian authored and hongwoo-nam committed Dec 15, 2016
commit b2467c408968c96cb429a9f61843fd4ba22be62a
@@ -500,7 +500,7 @@ confirmUseCQB=There is no installed CUBRID Query Browser in the default path.\nA
errSelectLoginDbToRunSQL=Please select a database you are currently logged into in order to run a SQL query.
jdbcDriverDownloadSuccessMsg=The JDBC driver(s) have been updated successfully.\n{0}
jdbcDriverDownloadSuccessMsg=The JDBC driver(s) have been updated successfully.\n
expConDialogCopyBtnLabel=Copy JDBC URL to Clipboard
expConDialogCopyErrorMsg=Please select database(s) to copy to the clipboard.
@@ -305,9 +305,9 @@ msgSchemaComparison=Please choose a base database to compare and click the Compa
btnCompare=Compare
errSelectOverTwoDb=Please select more than 2 databases.
lblSchemaComparisonBase=The basis of schema comparison:
jdbcDriverDownloadSuccessMsg=There is updated JDBC driver(s) successfully.\n{0}
jdbcDriverDownloadSuccessMsg=There is updated JDBC driver(s) successfully.\n
expConDialogCopyBtnLabel=Copy to Clipboard
expConDialogCopyErrorMsg=Please select a connection/host to copy
expConDialogCopyConfrimMsg=Are you sure to copy the jdbc URL of selected connection/host into the clipboard?
expConDialogCopySucessMsg=Copy successful!
expConDialogCopySucessMsg=Copy successful!
@@ -271,9 +271,9 @@ msgSchemaComparison=Please choose a base database to compare and click the Compa
btnCompare=Compare
errSelectOverTwoDb=Please select more than 2 databases.
lblSchemaComparisonBase=The basis of schema comparison:
jdbcDriverDownloadSuccessMsg=There is updated JDBC driver(s) successfully.\n{0}
jdbcDriverDownloadSuccessMsg=There is updated JDBC driver(s) successfully.\n
expConDialogCopyBtnLabel=Copy to Clipboard
expConDialogCopyErrorMsg=Please select a connection/host to copy
expConDialogCopyConfrimMsg=Are you sure to copy the jdbc URL of selected connection/host into the clipboard?
expConDialogCopySucessMsg=Copy successful!
expConDialogCopySucessMsg=Copy successful!
@@ -0,0 +1,47 @@
package com.cubrid.common.ui.common.dialog;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.ScrolledComposite;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
public class MessageDialogWithScrollableMessage extends MessageDialog {
private String message;
public MessageDialogWithScrollableMessage(Shell parentShell, String title, Image titleImage, String mainMessage,
String secondaryMessage, int imageType, String[] buttonLabels) {
super(parentShell, title, null, mainMessage, imageType, buttonLabels, 0);
this.message = secondaryMessage;
}
@Override
public Control createDialogArea(Composite parent) {
if (this.message.length() == 0) {
return super.createDialogArea(parent);
}
Composite content = (Composite) super.createDialogArea(parent);
GridData data = new GridData(SWT.FILL, SWT.FILL, true, true);
ScrolledComposite sc = new ScrolledComposite(content, SWT.H_SCROLL | SWT.V_SCROLL);
Composite composite = new Composite(sc, SWT.NONE);
composite.setLayout(new FillLayout(SWT.VERTICAL));
Label l = new Label(composite, SWT.NONE);
l.setText(message);
sc.setLayoutData(data);
sc.setContent(composite);
sc.setExpandHorizontal(true);
sc.setExpandVertical(true);
sc.setMinSize(composite.computeSize(SWT.DEFAULT, SWT.DEFAULT));
return parent;
}
}
@@ -37,6 +37,7 @@
import java.util.Map;
import java.util.Map.Entry;
import org.apache.commons.lang.StringUtils;
import org.eclipse.jface.viewers.ColumnWeightData;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.StructuredSelection;
@@ -302,11 +303,11 @@ public void widgetSelected(SelectionEvent event) {
* Update new jdbc drivers.
*/
private void updateNewJdbcDrivers() {
Display.getDefault().asyncExec(new Runnable() {
public void run() {
try {
String downloadedFiles = "";
JDBCDriverDownloadTask task = new JDBCDriverDownloadTask();
String savedPath = getDefaultJDBCSavedPath();
List<String> jdbcList = task.getJDBCFileList();
@@ -323,20 +324,15 @@ public void run() {
if (taskExec.isSuccess()) {
List<String> downloadedList = task.getDriverList();
if (downloadedList != null && downloadedList.size() > 0) {
downloadedFiles = downloadedList.toString();
downloadedFiles = StringUtils.join(downloadedList, '\n');
for (int i = 0; i < jdbcList.size(); i++) {
String path = savedPath + File.separator
+ jdbcList.get(i);
loadJDBC(path);
}
}
}
String message = Messages.bind(
Messages.jdbcDriverDownloadSuccessMsg,
downloadedFiles);
CommonUITool.openInformationBox(Messages.titleSuccess,
message);
CommonUITool.openInformationBox(Messages.titleSuccess, Messages.jdbcDriverDownloadSuccessMsg, downloadedFiles);
} catch (Exception e) {
LOGGER.error("", e);
}
@@ -105,6 +105,7 @@
import com.cubrid.common.core.util.DateUtil;
import com.cubrid.common.core.util.LogUtil;
import com.cubrid.common.core.util.StringUtil;
import com.cubrid.common.ui.common.dialog.MessageDialogWithScrollableMessage;
import com.cubrid.common.ui.common.navigator.CubridDeferredTreeContentManager;
import com.cubrid.common.ui.common.navigator.DeferredContentProvider;
import com.cubrid.common.ui.query.action.CopyAction;
@@ -358,12 +359,19 @@ public static GridLayout createGridLayout(int columns) {
*/
public static int openMsgBox(Shell sh, int dialogImageType, String title, String msg,
String[] dialogButton) {
return openMsgBox(sh, dialogImageType, title, msg, "", dialogButton);
}
public static int openMsgBox(Shell sh, int dialogImageType, String title, String mainMessage, String secondaryMessage,
String[] dialogButton) {
Shell shell = sh;
if (shell == null) {
shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
.getShell();
}
MessageDialog dialog = new MessageDialog(shell, title, null, msg, dialogImageType,
dialogButton, 0);
MessageDialogWithScrollableMessage dialog = new MessageDialogWithScrollableMessage(
shell, title, null, mainMessage, secondaryMessage,
dialogImageType, dialogButton);
return dialog.open();
}
@@ -438,6 +446,10 @@ public static void openInformationBox(Shell sh, String title, String msg) {
openMsgBox(sh, MessageDialog.INFORMATION, title, msg, new String[] { Messages.btnOk });
}
public static void openInformationBox(Shell sh, String title, String mainMessage, String secondaryMessage) {
openMsgBox(sh, MessageDialog.INFORMATION, title, mainMessage, secondaryMessage, new String[] { Messages.btnOk });
}
/**
* Open information box
*
@@ -448,6 +460,11 @@ public static void openInformationBox(String title, String msg) {
openInformationBox(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), title,
msg);
}
public static void openInformationBox(String title, String mainMessage, String secondaryMessage) {
openInformationBox(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), title,
mainMessage, secondaryMessage);
}
/**
* Open information box
@@ -458,7 +475,7 @@ public static void openInformationBox(String msg) {
openInformationBox(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
Messages.titleInformation, msg);
}
/**
*
* Open Warning box
ProTip! Use n and p to navigate between commits in a pull request.