Révision 769
| tmp/org.txm.rcp/src/main/java/org/txm/rcp/editors/TXMEditor.java (revision 769) | ||
|---|---|---|
| 197 | 197 |
if(!this.getResult().canCompute() && this.getResult().isDirty()) {
|
| 198 | 198 |
showComputingParameters = true; |
| 199 | 199 |
} |
| 200 |
this.computingParametersGroup = this.topToolBar.installGroup(COMPUTING_PARAMETERS_GROUP_ID, "Show/Hide command parameters", "icons/show_computing_parameters.png", showComputingParameters); |
|
| 200 |
this.computingParametersGroup = this.topToolBar.installGroup(COMPUTING_PARAMETERS_GROUP_ID, "Show/Hide command parameters", |
|
| 201 |
"icons/show_computing_parameters.png", |
|
| 202 |
"icons/hide_computing_parameters.png", |
|
| 203 |
showComputingParameters); |
|
| 201 | 204 |
|
| 202 | 205 |
|
| 203 | 206 |
// display main area |
| tmp/org.txm.rcp/src/main/java/org/txm/rcp/editors/TXMEditorToolBar.java (revision 769) | ||
|---|---|---|
| 165 | 165 |
* @param toolBar |
| 166 | 166 |
* @param groupTitle |
| 167 | 167 |
* @param buttonToolTip |
| 168 |
* @param iconFilePath
|
|
| 168 |
* @param openIconFilePath
|
|
| 169 | 169 |
* @return the Group widget created |
| 170 | 170 |
*/ |
| 171 |
public Group installGroup(String groupTitle, String buttonToolTip, String iconFilePath, boolean showGroup) {
|
|
| 171 |
public Group installGroup(String groupTitle, String buttonToolTip, String openIconFilePath, String closeIconFilePath, boolean showGroup) {
|
|
| 172 | 172 |
|
| 173 | 173 |
if (this.groups.containsKey(groupTitle)) {
|
| 174 | 174 |
return (Group) this.groups.get(groupTitle); |
| ... | ... | |
| 192 | 192 |
|
| 193 | 193 |
|
| 194 | 194 |
// add finally a button to the toolbar to show/hide the Group |
| 195 |
|
|
| 196 |
final OpenCloseButton showParameters = new OpenCloseButton(this, groupTitle, iconFilePath); |
|
| 197 |
// if (iconFilePath != null) {
|
|
| 198 |
// showParameters.setImage(IImageKeys.getImage(iconFilePath)); |
|
| 199 |
// } |
|
| 200 |
// // if no icon specified, show the group title in the toolitem |
|
| 201 |
// else {
|
|
| 202 |
// showParameters.setText(groupTitle); |
|
| 203 |
// } |
|
| 204 |
// |
|
| 205 |
// if (buttonToolTip != null) {
|
|
| 206 |
// showParameters.setToolTipText(buttonToolTip); |
|
| 207 |
// } |
|
| 208 | 195 |
|
| 196 |
final OpenCloseButton showParameters = new OpenCloseButton(this, groupTitle, openIconFilePath, closeIconFilePath); |
|
| 197 |
// if (iconFilePath != null) {
|
|
| 198 |
// showParameters.setImage(IImageKeys.getImage(iconFilePath)); |
|
| 199 |
// } |
|
| 200 |
// // if no icon specified, show the group title in the toolitem |
|
| 201 |
// else {
|
|
| 202 |
// showParameters.setText(groupTitle); |
|
| 203 |
// } |
|
| 204 |
// |
|
| 205 |
// if (buttonToolTip != null) {
|
|
| 206 |
// showParameters.setToolTipText(buttonToolTip); |
|
| 207 |
// } |
|
| 208 |
|
|
| 209 | 209 |
this.setVisible(group, showParameters, showGroup); // default init |
| 210 | 210 |
|
| 211 | 211 |
showParameters.addSelectionListener(new SelectionListener() {
|
| ... | ... | |
| 223 | 223 |
this.buttons.put(groupTitle, showParameters); |
| 224 | 224 |
return group; |
| 225 | 225 |
} |
| 226 |
|
|
| 226 |
|
|
| 227 | 227 |
//failure of open/close decorator |
| 228 | 228 |
public class OpenCloseButton {
|
| 229 |
// ToolItem sep; |
|
| 229 |
// ToolItem sep;
|
|
| 230 | 230 |
ToolItem showParameters; |
| 231 |
// ControlDecoration openCloseDeco; |
|
| 232 |
|
|
| 233 |
public OpenCloseButton(TXMEditorToolBar toolbar, String groupTitle, String iconFilePath) {
|
|
| 234 |
|
|
| 235 |
// sep = new ToolItem(toolbar, SWT.SEPARATOR); |
|
| 231 |
// ControlDecoration openCloseDeco; |
|
| 232 |
protected Image openIcon; |
|
| 233 |
protected Image closeIcon; |
|
| 234 |
|
|
| 235 |
public OpenCloseButton(TXMEditorToolBar toolbar, String groupTitle, String openIconFilePath, String closeIconFilePath) {
|
|
| 236 |
|
|
| 237 |
// sep = new ToolItem(toolbar, SWT.SEPARATOR); |
|
| 236 | 238 |
showParameters = new ToolItem(toolbar, SWT.CHECK); |
| 237 |
if (iconFilePath != null) {
|
|
| 238 |
showParameters.setImage(IImageKeys.getImage(iconFilePath)); |
|
| 239 |
if (openIconFilePath != null) {
|
|
| 240 |
openIcon = IImageKeys.getImage(openIconFilePath); |
|
| 241 |
showParameters.setImage(openIcon); |
|
| 239 | 242 |
showParameters.setToolTipText(groupTitle); |
| 243 |
if (closeIconFilePath != null) {
|
|
| 244 |
closeIcon = IImageKeys.getImage(closeIconFilePath); |
|
| 245 |
} |
|
| 240 | 246 |
} else {
|
| 241 | 247 |
showParameters.setText(groupTitle); |
| 242 | 248 |
} |
| 243 |
|
|
| 244 |
|
|
| 245 |
|
|
| 246 |
// showParameters.pack(); |
|
| 247 |
// sep.setWidth (showParameters.getSize ().x); |
|
| 248 |
// sep.setControl (showParameters); |
|
| 249 |
|
|
| 250 |
// openCloseDeco = new ControlDecoration(showParameters, SWT.RIGHT); |
|
| 251 |
// openCloseDeco.setImage(IImageKeys.getImage(IImageKeys.CLOSE_DECORATOR)); |
|
| 249 |
|
|
| 250 |
|
|
| 251 |
|
|
| 252 |
// showParameters.pack();
|
|
| 253 |
// sep.setWidth (showParameters.getSize ().x);
|
|
| 254 |
// sep.setControl (showParameters);
|
|
| 255 |
|
|
| 256 |
// openCloseDeco = new ControlDecoration(showParameters, SWT.RIGHT);
|
|
| 257 |
// openCloseDeco.setImage(IImageKeys.getImage(IImageKeys.CLOSE_DECORATOR));
|
|
| 252 | 258 |
} |
| 253 | 259 |
|
| 254 | 260 |
public void setSelection(boolean visible) {
|
| 255 | 261 |
showParameters.setSelection(visible); |
| 256 |
// if (visible) {
|
|
| 257 |
// openCloseDeco.setImage(IImageKeys.getImage(IImageKeys.CLOSE_DECORATOR)); |
|
| 258 |
// } else {
|
|
| 259 |
// openCloseDeco.setImage(IImageKeys.getImage(IImageKeys.OPEN_DECORATOR)); |
|
| 260 |
// } |
|
| 262 |
if (closeIcon != null) {
|
|
| 263 |
if (visible) {
|
|
| 264 |
showParameters.setImage(closeIcon); |
|
| 265 |
} else {
|
|
| 266 |
showParameters.setImage(openIcon); |
|
| 267 |
} |
|
| 268 |
} |
|
| 261 | 269 |
} |
| 262 | 270 |
|
| 263 | 271 |
public void addSelectionListener(SelectionListener selectionListener) {
|
| tmp/org.txm.chartsengine.rcp/src/org/txm/chartsengine/rcp/editors/ChartEditor.java (revision 769) | ||
|---|---|---|
| 119 | 119 |
|
| 120 | 120 |
// Advanced tool bar |
| 121 | 121 |
//this.advancedToolBarComposite = new Composite(parent, SWT.NONE); |
| 122 |
Group group = this.topToolBar.installGroup("Rendering", "Show/Hide rendering parameters", "platform:/plugin/org.txm.chartsengine.rcp/icons/show_rendering_parameters.png", false);
|
|
| 122 |
Group group = this.topToolBar.installGroup("Rendering", "Show/Hide rendering parameters",
|
|
| 123 |
"platform:/plugin/org.txm.chartsengine.rcp/icons/show_rendering_parameters.png", |
|
| 124 |
"platform:/plugin/org.txm.chartsengine.rcp/icons/hide_rendering_parameters.png", |
|
| 125 |
false); |
|
| 123 | 126 |
this.advancedChartToolBar = new AdvancedChartEditorToolBar(this, group, this.getParametersGroupsComposite(), SWT.FLAT); |
| 124 | 127 |
//this.advancedChartToolBar.setBackground(parent.getDisplay().getSystemColor(SWT.COLOR_WHITE)); |
| 125 | 128 |
// this.advancedToolBarComposite.pack(true); |
| tmp/org.txm.statsengine.r.core/src/org/txm/statsengine/r/core/RWorkspace.java (revision 769) | ||
|---|---|---|
| 184 | 184 |
try {
|
| 185 | 185 |
Log.info(RCoreMessages.bind(RCoreMessages.info_connectingToRAt, host, port)); |
| 186 | 186 |
connection = new RConnection(host, port); |
| 187 |
//connection.setStringEncoding("UTF-8");
|
|
| 187 |
connection.setStringEncoding("utf8"); // mandatory !
|
|
| 188 | 188 |
|
| 189 | 189 |
return isConnected(); |
| 190 | 190 |
} catch (RserveException x) {
|
| ... | ... | |
| 207 | 207 |
Log.info(RCoreMessages.bind(RCoreMessages.info_connectingToRAtWithUser, new Object[] {host, port, user}));
|
| 208 | 208 |
connection = new RConnection(host, port); |
| 209 | 209 |
connection.login(user, password); |
| 210 |
connection.setStringEncoding("utf8"); // mandatory !
|
|
| 210 | 211 |
return isConnected(); |
| 211 | 212 |
|
| 212 | 213 |
} catch (RserveException x) {
|
Formats disponibles : Unified diff