Image consoleImage = new Image(tabFolder.getShell().getDisplay(),
getClass().getResourceAsStream("/console.png"));
initMenu();
tbtmNewItem = new CTabItem(tabFolder, SWT.NONE);
tbtmNewItem.setShowClose(true);
Composite composite_3 = new Composite(tabFolder, SWT.NONE);
tbtmNewItem.setControl(composite_3);
composite_3.setLayout(new GridLayout(1, false));
tbtmNewItem.setText(server.getName() +" "+RedisClient.i18nFile.getText(I18nFile.CONSOLE));
tbtmNewItem.setImage(consoleImage);
composite_4 = new Composite(composite_3, SWT.NONE);
composite_4.setLayout(new GridLayout(3, false));
composite_4.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false, 1, 1));
btnExecButton = new Button(composite_4, SWT.NONE);
btnExecButton.setText(RedisClient.i18nFile.getText(I18nFile.RUNCURRENT));
btnExecButton.setImage(runImage);
btnExecButton.setToolTipText(RedisClient.i18nFile.getText(I18nFile.RUNCURRENTTIP)+"\tF7");
btnExecSelectButton = new Button(composite_4, SWT.NONE);
btnExecSelectButton.setText(RedisClient.i18nFile.getText(I18nFile.RUNSELECT));
btnExecSelectButton.setImage(runImage);
btnExecSelectButton.setToolTipText(RedisClient.i18nFile.getText(I18nFile.RUNSELECTTIP)+"\tF8");
btnExecNextButton = new Button(composite_4, SWT.NONE);
btnExecNextButton.setText(RedisClient.i18nFile.getText(I18nFile.RUNFOLLOW));
btnExecNextButton.setImage(runImage);
btnExecNextButton.setToolTipText(RedisClient.i18nFile.getText(I18nFile.RUNFOLLOWTIP)+"\tF9");
SashForm sashForm3 = new SashForm(composite_3, SWT.VERTICAL);
sashForm3.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
inputCmd = new StyledText(sashForm3, SWT.BORDER | SWT.WRAP | SWT.V_SCROLL | SWT.MULTI);
inputCmd.addLineStyleListener(new LineStyleListener()
{
public void lineGetStyle(LineStyleEvent e)
{
StyleRange style = new StyleRange();
style.metrics = new GlyphMetrics(0, 0, Integer.toString(100000).length()*5);
e.bullet = new Bullet(ST.BULLET_DOT, style);
}
});
inputCmd.addControlListener(new ControlAdapter() {
@Override
public void controlResized(ControlEvent e) {
inputCmd.setFocus();
}
});
inputCmd.addMouseListener(new MouseAdapter() {
@Override
public void mouseDown(MouseEvent e) {
text = inputCmd;
final Clipboard cb = new Clipboard(tabFolder.getShell().getDisplay());
TextTransfer transfer = TextTransfer.getInstance();
String data = (String) cb.getContents(transfer);
if(data != null)
menu.getItem(2).setEnabled(true);
else
menu.getItem(2).setEnabled(false);
if(inputCmd.getSelectionText().length() > 0){
menu.getItem(0).setEnabled(true);
menu.getItem(1).setEnabled(true);
}else{
menu.getItem(0).setEnabled(false);
menu.getItem(1).setEnabled(false);
}
inputCmd.setMenu(menu);
}
});
tabFolder_2 = new CTabFolder(sashForm3, SWT.BORDER);
tbtmNewItem_1 = new CTabItem(tabFolder_2, SWT.NONE);
tbtmNewItem_1.setText(RedisClient.i18nFile.getText(I18nFile.RESULT));
Composite composite_5 = new Composite(tabFolder_2, SWT.NONE);
tbtmNewItem_1.setControl(composite_5);
composite_5.setLayout(new GridLayout(1, false));