Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 284447 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/ui/internal/ide/IDEInternalPreferences.java (-1 / +7 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2009 IBM Corporation and others.
2
 * Copyright (c) 2000, 2010 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 8-13 Link Here
8
 * Contributors:
8
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
9
 *     IBM Corporation - initial API and implementation
10
 *     Dina Sayed, dsayed@eg.ibm.com, IBM -  bug 269844
10
 *     Dina Sayed, dsayed@eg.ibm.com, IBM -  bug 269844
11
 *     Markus Schorn (Wind River Systems) -  bug 284447
11
 *******************************************************************************/
12
 *******************************************************************************/
12
13
13
package org.eclipse.ui.internal.ide;
14
package org.eclipse.ui.internal.ide;
Lines 99-102 Link Here
99
100
100
    // Always show this import window
101
    // Always show this import window
101
    public static final String IMPORT_FILES_AND_FOLDERS_SHOW_DIALOG = "IMPORT_FILES_AND_FOLDERS_SHOW_DIALOG"; //$NON-NLS-1$
102
    public static final String IMPORT_FILES_AND_FOLDERS_SHOW_DIALOG = "IMPORT_FILES_AND_FOLDERS_SHOW_DIALOG"; //$NON-NLS-1$
103
104
    /**
105
     * Workspace name, will be displayed in the window title.
106
     */
107
	public static final String WORKSPACE_NAME = "WORKSPACE_NAME"; //$NON-NLS-1$
102
}
108
}
(-)src/org/eclipse/ui/internal/ide/IDEWorkbenchMessages.java (-1 / +2 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2005, 2009 IBM Corporation and others.
2
 * Copyright (c) 2005, 2010 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 486-491 Link Here
486
	public static String IDEWorkspacePreference_relatedLink;
486
	public static String IDEWorkspacePreference_relatedLink;
487
	public static String IDEWorkspacePreference_openReferencedProjects;
487
	public static String IDEWorkspacePreference_openReferencedProjects;
488
	public static String IDEWorkspacePreference_closeUnrelatedProjectsToolTip;
488
	public static String IDEWorkspacePreference_closeUnrelatedProjectsToolTip;
489
	public static String IDEWorkspacePreference_workspaceName;
489
490
490
	// --- Linked Resources ---
491
	// --- Linked Resources ---
491
	public static String LinkedResourcesPreference_explanation;
492
	public static String LinkedResourcesPreference_explanation;
(-)src/org/eclipse/ui/internal/ide/messages.properties (-1 / +2 lines)
Lines 1-5 Link Here
1
###############################################################################
1
###############################################################################
2
# Copyright (c) 2000, 2009 IBM Corporation and others.
2
# Copyright (c) 2000, 2010 IBM Corporation and others.
3
# All rights reserved. This program and the accompanying materials
3
# All rights reserved. This program and the accompanying materials
4
# are made available under the terms of the Eclipse Public License v1.0
4
# are made available under the terms of the Eclipse Public License v1.0
5
# which accompanies this distribution, and is available at
5
# which accompanies this distribution, and is available at
Lines 476-481 Link Here
476
IDEWorkspacePreference_relatedLink = See <a>''{0}''</a> for workspace startup and shutdown preferences.
476
IDEWorkspacePreference_relatedLink = See <a>''{0}''</a> for workspace startup and shutdown preferences.
477
IDEWorkspacePreference_openReferencedProjects = Open referenced projects when a project is opened
477
IDEWorkspacePreference_openReferencedProjects = Open referenced projects when a project is opened
478
IDEWorkspacePreference_closeUnrelatedProjectsToolTip = Close unrelated projects without prompt
478
IDEWorkspacePreference_closeUnrelatedProjectsToolTip = Close unrelated projects without prompt
479
IDEWorkspacePreference_workspaceName=Workspace name (shown in window title):
479
480
480
# --- Linked Resources ---
481
# --- Linked Resources ---
481
LinkedResourcesPreference_explanation = Path variables specify locations in the file system. The locations of linked resources\nmay be specified relative to these path variables.
482
LinkedResourcesPreference_explanation = Path variables specify locations in the file system. The locations of linked resources\nmay be specified relative to these path variables.
(-)src/org/eclipse/ui/internal/ide/dialogs/IDEWorkspacePreferencePage.java (-2 / +35 lines)
Lines 1-5 Link Here
1
 /****************************************************************************
1
 /****************************************************************************
2
 * Copyright (c) 2000, 2009 IBM Corporation and others.
2
 * Copyright (c) 2000, 2010 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 8-13 Link Here
8
 * Contributors:
8
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
9
 *     IBM Corporation - initial API and implementation
10
 *     Dina Sayed, dsayed@eg.ibm.com, IBM -  bug 269844
10
 *     Dina Sayed, dsayed@eg.ibm.com, IBM -  bug 269844
11
 *     Markus Schorn (Wind River Systems) -  bug 284447
11
 *******************************************************************************/
12
 *******************************************************************************/
12
package org.eclipse.ui.internal.ide.dialogs;
13
package org.eclipse.ui.internal.ide.dialogs;
13
14
Lines 63-68 Link Here
63
64
64
    private IntegerFieldEditor saveInterval;
65
    private IntegerFieldEditor saveInterval;
65
66
67
	private FieldEditor workspaceName;
68
66
    private Button autoRefreshButton;
69
    private Button autoRefreshButton;
67
    
70
    
68
    private Button closeUnrelatedProjectButton;
71
    private Button closeUnrelatedProjectButton;
Lines 76-81 Link Here
76
79
77
	private RadioGroupFieldEditor openReferencesEditor;
80
	private RadioGroupFieldEditor openReferencesEditor;
78
81
82
79
    /*
83
    /*
80
     * (non-Javadoc)
84
     * (non-Javadoc)
81
     * 
85
     * 
Lines 105-110 Link Here
105
        
109
        
106
        createSpace(composite);
110
        createSpace(composite);
107
        createSaveIntervalGroup(composite);
111
        createSaveIntervalGroup(composite);
112
        createWindowTitleGroup(composite);
108
		createSpace(composite);
113
		createSpace(composite);
109
		
114
		
110
		createOpenPrefControls(composite);
115
		createOpenPrefControls(composite);
Lines 217-223 Link Here
217
        });
222
        });
218
223
219
    }
224
    }
220
	
225
226
    /**
227
     * Create a composite that contains entry fields specifying the workspace name
228
     * preference.
229
     * 
230
     * @param composite the Composite the group is created in.
231
     */
232
    private void createWindowTitleGroup(Composite composite) {
233
        Composite groupComposite = new Composite(composite, SWT.LEFT);
234
        GridLayout layout = new GridLayout();
235
        layout.numColumns = 2;
236
        groupComposite.setLayout(layout);
237
        GridData gd = new GridData();
238
        gd.horizontalAlignment = GridData.FILL;
239
        gd.grabExcessHorizontalSpace = true;
240
        groupComposite.setLayoutData(gd);
241
242
        workspaceName = new StringFieldEditor(
243
                IDEInternalPreferences.WORKSPACE_NAME, IDEWorkbenchMessages.IDEWorkspacePreference_workspaceName,
244
                groupComposite);
245
246
        workspaceName.setPreferenceStore(getIDEPreferenceStore());
247
        workspaceName.load();
248
        workspaceName.setPage(this);
249
    }
250
221
	/**
251
	/**
222
     * Create the Refresh controls
252
     * Create the Refresh controls
223
     * 
253
     * 
Lines 345-350 Link Here
345
                .setSelection(store
375
                .setSelection(store
346
                        .getDefaultBoolean(IDEInternalPreferences.SAVE_ALL_BEFORE_BUILD));
376
                        .getDefaultBoolean(IDEInternalPreferences.SAVE_ALL_BEFORE_BUILD));
347
        saveInterval.loadDefault();
377
        saveInterval.loadDefault();
378
        workspaceName.loadDefault();
348
        
379
        
349
        boolean closeUnrelatedProj = store.getDefaultBoolean(IDEInternalPreferences.CLOSE_UNRELATED_PROJECTS);
380
        boolean closeUnrelatedProj = store.getDefaultBoolean(IDEInternalPreferences.CLOSE_UNRELATED_PROJECTS);
350
        closeUnrelatedProjectButton.setSelection(closeUnrelatedProj);
381
        closeUnrelatedProjectButton.setSelection(closeUnrelatedProj);
Lines 413-418 Link Here
413
            }
444
            }
414
        }
445
        }
415
        
446
        
447
        workspaceName.store();
448
        
416
        Preferences preferences = ResourcesPlugin.getPlugin()
449
        Preferences preferences = ResourcesPlugin.getPlugin()
417
                .getPluginPreferences();
450
                .getPluginPreferences();
418
451
(-)src/org/eclipse/ui/internal/ide/application/IDEWorkbenchWindowAdvisor.java (-2 / +23 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2005, 2009 IBM Corporation and others.
2
 * Copyright (c) 2005, 2010 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 7-12 Link Here
7
 *
7
 *
8
 * Contributors:
8
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
9
 *     IBM Corporation - initial API and implementation
10
 *     Markus Schorn (Wind River Systems) -  bug 284447
10
 *******************************************************************************/
11
 *******************************************************************************/
11
package org.eclipse.ui.internal.ide.application;
12
package org.eclipse.ui.internal.ide.application;
12
13
Lines 27-32 Link Here
27
import org.eclipse.jface.dialogs.MessageDialogWithToggle;
28
import org.eclipse.jface.dialogs.MessageDialogWithToggle;
28
import org.eclipse.jface.preference.IPreferenceStore;
29
import org.eclipse.jface.preference.IPreferenceStore;
29
import org.eclipse.jface.resource.JFaceResources;
30
import org.eclipse.jface.resource.JFaceResources;
31
import org.eclipse.jface.util.IPropertyChangeListener;
32
import org.eclipse.jface.util.PropertyChangeEvent;
30
import org.eclipse.osgi.util.NLS;
33
import org.eclipse.osgi.util.NLS;
31
import org.eclipse.swt.SWT;
34
import org.eclipse.swt.SWT;
32
import org.eclipse.swt.dnd.FileTransfer;
35
import org.eclipse.swt.dnd.FileTransfer;
Lines 101-107 Link Here
101
	};
104
	};
102
105
103
	private IAdaptable lastInput;
106
	private IAdaptable lastInput;
104
105
	private IWorkbenchAction openPerspectiveAction;
107
	private IWorkbenchAction openPerspectiveAction;
106
108
107
	/**
109
	/**
Lines 297-302 Link Here
297
						// do nothing
299
						// do nothing
298
					}
300
					}
299
				});
301
				});
302
		
303
		// Listen for changes of the workspace name.
304
		IDEWorkbenchPlugin.getDefault().getPreferenceStore().addPropertyChangeListener(
305
				new IPropertyChangeListener() {
306
					public void propertyChange(PropertyChangeEvent event) {
307
						if (IDEInternalPreferences.WORKSPACE_NAME.equals(event.getProperty())) {
308
							// Make sure the title is actually updated by setting last active page.
309
							lastActivePage= null;
310
							updateTitle(false);
311
						}
312
					}
313
				});
300
	}
314
	}
301
315
302
	private String computeTitle() {
316
	private String computeTitle() {
Lines 344-349 Link Here
344
			title = NLS.bind(IDEWorkbenchMessages.WorkbenchWindow_shellTitle,
358
			title = NLS.bind(IDEWorkbenchMessages.WorkbenchWindow_shellTitle,
345
					title, workspaceLocation);
359
					title, workspaceLocation);
346
		}
360
		}
361
		
362
		// Bug 284447: Prepend workspace name to the title
363
		String workspaceName = IDEWorkbenchPlugin.getDefault().getPreferenceStore().getString(
364
				IDEInternalPreferences.WORKSPACE_NAME);
365
		if (workspaceName != null && workspaceName.length() > 0) {
366
			title= NLS.bind(IDEWorkbenchMessages.WorkbenchWindow_shellTitle, workspaceName, title);
367
		}
347
368
348
		return title;
369
		return title;
349
	}
370
	}

Return to bug 284447