View | Details | Raw Unified | Return to bug 313691 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/core/internal/resources/ICoreConstants.java (+10 lines)
Lines 64-69 Link Here
64
	 */
64
	 */
65
	static final int M_VIRTUAL = 0x80000;
65
	static final int M_VIRTUAL = 0x80000;
66
	/**
66
	/**
67
	 * Marks this resource as flatten.
68
	 * @since 3.7
69
	 */
70
	static final int M_FLATTEN = 0x400000;
71
	/**
72
	 * Marks this resource as floating.
73
	 * @since 3.7
74
	 */
75
	static final int M_FLOATING = 0x800000;
76
	/**
67
	 * The file has no content description.
77
	 * The file has no content description.
68
	 * @since 3.0
78
	 * @since 3.0
69
	 */
79
	 */
(-)src/org/eclipse/core/internal/resources/Project.java (-1 / +1 lines)
Lines 1112-1118 Link Here
1112
				if (parent != null && !parent.exists() && parent.getType() == FOLDER)
1112
				if (parent != null && !parent.exists() && parent.getType() == FOLDER)
1113
					((Folder) parent).ensureExists(Policy.monitorFor(null));
1113
					((Folder) parent).ensureExists(Policy.monitorFor(null));
1114
				if (!toLink.exists() || !toLink.isLinked()) {
1114
				if (!toLink.exists() || !toLink.isLinked()) {
1115
					if (newLink.isGroup())
1115
					if (newLink.isVirtual())
1116
						((Folder) toLink).create(IResource.REPLACE | IResource.VIRTUAL, true, null);
1116
						((Folder) toLink).create(IResource.REPLACE | IResource.VIRTUAL, true, null);
1117
					else
1117
					else
1118
						toLink.createLink(newLink.getLocationURI(), IResource.REPLACE | IResource.ALLOW_MISSING_LOCAL, null);
1118
						toLink.createLink(newLink.getLocationURI(), IResource.REPLACE | IResource.ALLOW_MISSING_LOCAL, null);
(-)src/org/eclipse/core/internal/resources/Resource.java (-4 / +109 lines)
Lines 17-22 Link Here
17
 *******************************************************************************/
17
 *******************************************************************************/
18
package org.eclipse.core.internal.resources;
18
package org.eclipse.core.internal.resources;
19
19
20
import org.eclipse.core.internal.utils.Messages;
21
import org.eclipse.core.internal.utils.Policy;
22
import org.eclipse.core.resources.IResource;
23
import org.eclipse.core.runtime.OperationCanceledException;
24
25
import org.eclipse.core.runtime.CoreException;
26
import org.eclipse.core.runtime.IProgressMonitor;
27
20
import java.net.URI;
28
import java.net.URI;
21
import java.net.URISyntaxException;
29
import java.net.URISyntaxException;
22
import java.util.*;
30
import java.util.*;
Lines 663-672 Link Here
663
				ResourceInfo info = workspace.createResource(this, false);
671
				ResourceInfo info = workspace.createResource(this, false);
664
				if ((updateFlags & IResource.HIDDEN) != 0)
672
				if ((updateFlags & IResource.HIDDEN) != 0)
665
					info.set(M_HIDDEN);
673
					info.set(M_HIDDEN);
674
				if ((updateFlags & IResource.FLATTEN) != 0)
675
					info.set(M_FLATTEN);
676
				
666
				info.set(M_LINK);
677
				info.set(M_LINK);
667
				localLocation = FileUtil.canonicalURI(localLocation);
678
				localLocation = FileUtil.canonicalURI(localLocation);
668
				LinkDescription linkDescription = new LinkDescription(this, localLocation);
679
				LinkDescription linkDescription = new LinkDescription(this, localLocation);
669
				if (linkDescription.isGroup())
680
				if (linkDescription.isVirtual())
670
					info.set(M_VIRTUAL);
681
					info.set(M_VIRTUAL);
671
				getLocalManager().link(this, localLocation, fileInfo);
682
				getLocalManager().link(this, localLocation, fileInfo);
672
				monitor.worked(Policy.opWork * 5 / 100);
683
				monitor.worked(Policy.opWork * 5 / 100);
Lines 2064-2070 Link Here
2064
						info.setDirectory(currentResource.getType() == IResource.FOLDER);
2075
						info.setDirectory(currentResource.getType() == IResource.FOLDER);
2065
						fileInfo = info;
2076
						fileInfo = info;
2066
					}
2077
					}
2067
					IFileInfo[] filtered = parent.filterChildren(new IFileInfo[] {fileInfo}, throwExeception);
2078
					Object[] filtered = parent.filterChildren(new Object[] {fileInfo}, throwExeception);
2068
					if (filtered.length == 0)
2079
					if (filtered.length == 0)
2069
						return true;
2080
						return true;
2070
				}
2081
				}
Lines 2073-2083 Link Here
2073
		}
2084
		}
2074
		return false;
2085
		return false;
2075
	}
2086
	}
2076
	
2087
2077
	public IFileInfo[] filterChildren(IFileInfo[] list, boolean throwException) throws CoreException {
2088
	/**
2089
	 * Filter the list of file entries according to the existing resource filters
2090
	 * @param list can be either an array of IFileInfo or IFileStore
2091
	 * @param throwException
2092
	 * @return the filtered list (either an array of IFileInfo or IFileStore
2093
	 * @throws CoreException
2094
	 */
2095
	public Object[] filterChildren(Object[] list, boolean throwException) throws CoreException {
2078
		Project project = (Project) getProject();
2096
		Project project = (Project) getProject();
2079
		if (project == null)
2097
		if (project == null)
2080
			return list;
2098
			return list;
2099
		if (list.length == 0)
2100
			return list;
2081
		final ProjectDescription description = project.internalGetDescription();
2101
		final ProjectDescription description = project.internalGetDescription();
2082
		if (description == null)
2102
		if (description == null)
2083
			return list;
2103
			return list;
Lines 2181-2184 Link Here
2181
				setLinkLocation(URIUtil.toURI(location.toPortableString()), updateFlags, monitor);
2201
				setLinkLocation(URIUtil.toURI(location.toPortableString()), updateFlags, monitor);
2182
			}
2202
			}
2183
	}
2203
	}
2204
	
2205
	/*
2206
	 * (non-Javadoc)
2207
	 * 
2208
	 * @see IContainer#isFlatten()
2209
	 */
2210
	public boolean isFloating() {
2211
		ResourceInfo info = getResourceInfo(false, false);
2212
		return info != null && info.isSet(M_FLOATING);
2213
	}
2214
2215
	/*
2216
	 * Set the floating flag
2217
	 */
2218
	public void setFloating(boolean floating) {
2219
		ResourceInfo info = getResourceInfo(true, true);
2220
		if (info != null) {
2221
			if (floating)
2222
				info.isSet(M_FLOATING);
2223
			else
2224
				info.clear(M_FLOATING);
2225
		}
2226
	}
2227
2228
	/*
2229
	 * (non-Javadoc)
2230
	 * 
2231
	 * @see IContainer#isFlatten()
2232
	 */
2233
	public boolean isFlatten() {
2234
		ResourceInfo info = getResourceInfo(false, false);
2235
		return info != null && info.isSet(M_FLATTEN);
2236
	}
2237
2238
	/**
2239
	 * 
2240
	 * @exception CoreException 
2241
	 * 
2242
	 * @see #isFlatten()
2243
	 * @since 3.7
2244
	 */
2245
	public void setFlatten(boolean flatten, int updateFlags, IProgressMonitor monitor) throws CoreException {
2246
		monitor = Policy.monitorFor(monitor);
2247
		try {
2248
			String message = NLS.bind(Messages.resources_settingFlattenFlag, getFullPath());
2249
			monitor.beginTask(message, Policy.totalWork);
2250
			Policy.checkCanceled(monitor);
2251
			checkValidPath(path, FOLDER | PROJECT, true);
2252
			final ISchedulingRule rule = workspace.getRuleFactory().createRule(this);
2253
			try {
2254
				workspace.prepareOperation(rule, monitor);
2255
				workspace.beginOperation(true);
2256
				monitor.worked(Policy.opWork * 5 / 100);
2257
				ResourceInfo info = getResourceInfo(true, true);
2258
				// ignore attempts to set flatten flag on anything except projects and folders
2259
				if (info.getType() != PROJECT && info.getType() != FOLDER)
2260
					return;				
2261
2262
				if (flatten)
2263
					info.set(ICoreConstants.M_FLATTEN);
2264
				else {
2265
					info.clear(ICoreConstants.M_FLATTEN);
2266
				}
2267
				//refresh to update resources below this container location
2268
				if (getType() != IResource.FILE) {
2269
					//refresh either in background or foreground
2270
					if ((updateFlags & IResource.BACKGROUND_REFRESH) != 0) {
2271
						workspace.refreshManager.refresh(this);
2272
						monitor.worked(Policy.opWork * 90 / 100);
2273
					} else {
2274
						refreshLocal(DEPTH_INFINITE, Policy.subMonitorFor(monitor, Policy.opWork * 90 / 100));
2275
					}
2276
				} else
2277
					monitor.worked(Policy.opWork * 90 / 100);
2278
			} catch (OperationCanceledException e) {
2279
				workspace.getWorkManager().operationCanceled();
2280
				throw e;
2281
			} finally {
2282
				workspace.endOperation(rule, true, Policy.subMonitorFor(monitor, Policy.endOpWork));
2283
			}
2284
		} finally {
2285
			monitor.done();
2286
		}
2287
	}
2288
2184
}
2289
}
(-)src/org/eclipse/core/internal/resources/Workspace.java (+4 lines)
Lines 13-18 Link Here
13
 *******************************************************************************/
13
 *******************************************************************************/
14
package org.eclipse.core.internal.resources;
14
package org.eclipse.core.internal.resources;
15
15
16
import org.eclipse.core.resources.IResource;
17
16
import java.io.IOException;
18
import java.io.IOException;
17
import java.io.InputStream;
19
import java.io.InputStream;
18
import java.net.URI;
20
import java.net.URI;
Lines 985-990 Link Here
985
			info.set(M_TEAM_PRIVATE_MEMBER);
987
			info.set(M_TEAM_PRIVATE_MEMBER);
986
		if ((updateFlags & IResource.HIDDEN) != 0)
988
		if ((updateFlags & IResource.HIDDEN) != 0)
987
			info.set(M_HIDDEN);
989
			info.set(M_HIDDEN);
990
		if ((updateFlags & IResource.FLATTEN) != 0)
991
			info.set(M_FLATTEN);
988
		//		if ((updateFlags & IResource.VIRTUAL) != 0)
992
		//		if ((updateFlags & IResource.VIRTUAL) != 0)
989
		//			info.set(M_VIRTUAL);
993
		//			info.set(M_VIRTUAL);
990
		return info;
994
		return info;
(-)plugin.properties (+2 lines)
Lines 93-98 Link Here
93
GoToResourceAction.label = &Resource...
93
GoToResourceAction.label = &Resource...
94
DecoratorLinkedResource.label = Linked Resources
94
DecoratorLinkedResource.label = Linked Resources
95
DecoratorLinkedResource.description = Adds an icon decoration to linked resources.
95
DecoratorLinkedResource.description = Adds an icon decoration to linked resources.
96
DecoratorFloatingResource.label = Floating Resources
97
DecoratorFloatingResource.description = Adds an icon decoration to floating resources.
96
DecoratorVirtualResource.label = Virtual Folders
98
DecoratorVirtualResource.label = Virtual Folders
97
DecoratorVirtualResource.description = Shows an icon for virtual folders. 
99
DecoratorVirtualResource.description = Shows an icon for virtual folders. 
98
DecoratorSpecificContentType.label = File Icons Based On Content Analysis
100
DecoratorSpecificContentType.label = File Icons Based On Content Analysis
(-)plugin.xml (+17 lines)
Lines 376-381 Link Here
376
            lightweight="true"
376
            lightweight="true"
377
            adaptable="true"
377
            adaptable="true"
378
            location="BOTTOM_RIGHT"
378
            location="BOTTOM_RIGHT"
379
            label="%DecoratorFloatingResource.label"
380
            class="org.eclipse.ui.internal.ide.FloatingResourceDecorator"
381
            state="true"
382
            id="org.eclipse.ui.FloatingResourceDecorator">
383
         <description>
384
            %DecoratorFloatingResource.description
385
         </description>
386
         <enablement>
387
            <objectClass
388
                  name="org.eclipse.core.resources.IResource">
389
            </objectClass>
390
         </enablement>
391
      </decorator>
392
      <decorator
393
            lightweight="true"
394
            adaptable="true"
395
            location="BOTTOM_RIGHT"
379
            label="%DecoratorVirtualResource.label"
396
            label="%DecoratorVirtualResource.label"
380
            class="org.eclipse.ui.internal.ide.VirtualResourceDecorator"
397
            class="org.eclipse.ui.internal.ide.VirtualResourceDecorator"
381
            state="true"
398
            state="true"
(-)src/org/eclipse/ui/internal/ide/FloatingResourceDecorator.java (+85 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2010 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
8
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
10
 *******************************************************************************/
11
package org.eclipse.ui.internal.ide;
12
13
import org.eclipse.core.resources.IResource;
14
import org.eclipse.jface.resource.ImageDescriptor;
15
import org.eclipse.jface.viewers.IDecoration;
16
import org.eclipse.jface.viewers.ILabelProviderListener;
17
import org.eclipse.jface.viewers.ILightweightLabelDecorator;
18
import org.eclipse.ui.plugin.AbstractUIPlugin;
19
20
/**
21
 * A LinkedResourceDecorator decorates an element's image with a linked 
22
 * resource overlay. 
23
 * 
24
 * @since 2.1
25
 */
26
public class FloatingResourceDecorator implements ILightweightLabelDecorator {
27
    private static final ImageDescriptor FLOATING;
28
29
    static {
30
    	FLOATING = AbstractUIPlugin.imageDescriptorFromPlugin(
31
                IDEWorkbenchPlugin.IDE_WORKBENCH,
32
                "$nl$/icons/full/ovr16/floating_ovr.gif"); //$NON-NLS-1$
33
    }
34
35
    /**
36
     * Creates a new <code>LinkedResourceDecorator</code>.
37
     */
38
    public FloatingResourceDecorator() {
39
    }
40
41
    /**
42
     * @see org.eclipse.jface.viewers.IBaseLabelProvider#addListener(ILabelProviderListener)
43
     */
44
    public void addListener(ILabelProviderListener listener) {
45
    }
46
47
    /**
48
     * @see org.eclipse.jface.viewers.IBaseLabelProvider#dispose()
49
     */
50
    public void dispose() {
51
        // no resources to dispose
52
    }
53
54
    /**
55
     * @see org.eclipse.jface.viewers.IBaseLabelProvider#isLabelProperty(java.lang.Object, java.lang.String)
56
     */
57
    public boolean isLabelProperty(Object element, String property) {
58
        return false;
59
    }
60
61
    /**
62
     * @see org.eclipse.jface.viewers.IBaseLabelProvider#removeListener(ILabelProviderListener)
63
     */
64
    public void removeListener(ILabelProviderListener listener) {
65
    }
66
67
    /**
68
     * Adds the linked resource overlay if the given element is a linked
69
     * resource.
70
     * 
71
     * @param element element to decorate
72
     * @param decoration  The decoration we are adding to
73
     * @see org.eclipse.jface.viewers.ILightweightLabelDecorator#decorate(Object, IDecoration)
74
     */
75
    public void decorate(Object element, IDecoration decoration) {
76
77
        if (element instanceof IResource == false) {
78
			return;
79
		}
80
        IResource resource = (IResource) element;
81
        if (resource.isFloating())
82
			decoration.addOverlay(FLOATING);
83
    }
84
85
}
(-)src/org/eclipse/ui/internal/ide/IDEWorkbenchMessages.java (+3 lines)
Lines 613-618 Link Here
613
	public static String ResourceInfo_folder;
613
	public static String ResourceInfo_folder;
614
	public static String ResourceInfo_project;
614
	public static String ResourceInfo_project;
615
	public static String ResourceInfo_linkedFile;
615
	public static String ResourceInfo_linkedFile;
616
	public static String ResourceInfo_floatingFile;
616
	public static String ResourceInfo_linkedFolder;
617
	public static String ResourceInfo_linkedFolder;
617
	public static String ResourceInfo_virtualFolder;
618
	public static String ResourceInfo_virtualFolder;
618
	public static String ResourceInfo_unknown;
619
	public static String ResourceInfo_unknown;
Lines 622-627 Link Here
622
	public static String ResourceInfo_fileNotExist;
623
	public static String ResourceInfo_fileNotExist;
623
	public static String ResourceInfo_path;
624
	public static String ResourceInfo_path;
624
	public static String ResourceInfo_lastModified;
625
	public static String ResourceInfo_lastModified;
626
	public static String ResourceInfo_folderHierarchy;
627
	public static String ResourceInfo_flatten;
625
	public static String ResourceInfo_fileEncodingTitle;
628
	public static String ResourceInfo_fileEncodingTitle;
626
	public static String ResourceInfo_fileContentEncodingFormat;
629
	public static String ResourceInfo_fileContentEncodingFormat;
627
	public static String ResourceInfo_fileContainerEncodingFormat;
630
	public static String ResourceInfo_fileContainerEncodingFormat;
(-)src/org/eclipse/ui/internal/ide/LinkedResourceDecorator.java (-1 / +1 lines)
Lines 87-93 Link Here
87
			return;
87
			return;
88
		}
88
		}
89
        IResource resource = (IResource) element;
89
        IResource resource = (IResource) element;
90
        if (resource.isLinked() && !resource.isVirtual()) {
90
        if (resource.isLinked() && !resource.isVirtual() && !resource.isFloating()) {
91
			IFileInfo fileInfo = null;
91
			IFileInfo fileInfo = null;
92
			URI location = resource.getLocationURI();
92
			URI location = resource.getLocationURI();
93
			if (location != null) {
93
			if (location != null) {
(-)src/org/eclipse/ui/internal/ide/messages.properties (+3 lines)
Lines 570-575 Link Here
570
ResourceInfo_locked = L&ocked
570
ResourceInfo_locked = L&ocked
571
ResourceInfo_archive = Ar&chive
571
ResourceInfo_archive = Ar&chive
572
ResourceInfo_derived = Deri&ved
572
ResourceInfo_derived = Deri&ved
573
ResourceInfo_flatten = &Flatten
573
ResourceInfo_type = &Type:
574
ResourceInfo_type = &Type:
574
ResourceInfo_location = &Location:
575
ResourceInfo_location = &Location:
575
ResourceInfo_resolvedLocation = Resolved locatio&n:
576
ResourceInfo_resolvedLocation = Resolved locatio&n:
Lines 632-637 Link Here
632
ResourceInfo_folder = Folder
633
ResourceInfo_folder = Folder
633
ResourceInfo_project = Project
634
ResourceInfo_project = Project
634
ResourceInfo_linkedFile = Linked File
635
ResourceInfo_linkedFile = Linked File
636
ResourceInfo_floatingFile = Floating File
635
ResourceInfo_linkedFolder = Linked Folder
637
ResourceInfo_linkedFolder = Linked Folder
636
ResourceInfo_virtualFolder = Virtual Folder
638
ResourceInfo_virtualFolder = Virtual Folder
637
ResourceInfo_unknown = Unknown
639
ResourceInfo_unknown = Unknown
Lines 642-647 Link Here
642
ResourceInfo_fileNotExist = {0} - (does not exist)
644
ResourceInfo_fileNotExist = {0} - (does not exist)
643
ResourceInfo_path = &Path:
645
ResourceInfo_path = &Path:
644
ResourceInfo_lastModified = Last &modified:
646
ResourceInfo_lastModified = Last &modified:
647
ResourceInfo_folderHierarchy = Folder hierarchy:
645
ResourceInfo_fileEncodingTitle = Default encoding for &text files
648
ResourceInfo_fileEncodingTitle = Default encoding for &text files
646
ResourceInfo_fileContentEncodingFormat = &Default (determined from content: {0})
649
ResourceInfo_fileContentEncodingFormat = &Default (determined from content: {0})
647
ResourceInfo_fileContainerEncodingFormat = Default (&inherited from container: {0})
650
ResourceInfo_fileContainerEncodingFormat = Default (&inherited from container: {0})
(-)src/org/eclipse/ui/internal/ide/dialogs/IDEResourceInfoUtils.java (+5 lines)
Lines 60-65 Link Here
60
	private static String FOLDER_LABEL = IDEWorkbenchMessages.ResourceInfo_folder;
60
	private static String FOLDER_LABEL = IDEWorkbenchMessages.ResourceInfo_folder;
61
61
62
	private static String LINKED_FILE_LABEL = IDEWorkbenchMessages.ResourceInfo_linkedFile;
62
	private static String LINKED_FILE_LABEL = IDEWorkbenchMessages.ResourceInfo_linkedFile;
63
	
64
	private static String FLOATING_FILE_LABEL = IDEWorkbenchMessages.ResourceInfo_floatingFile;
63
65
64
	private static String LINKED_FOLDER_LABEL = IDEWorkbenchMessages.ResourceInfo_linkedFolder;
66
	private static String LINKED_FOLDER_LABEL = IDEWorkbenchMessages.ResourceInfo_linkedFolder;
65
67
Lines 351-356 Link Here
351
			IContentDescription description) {
353
			IContentDescription description) {
352
354
353
		if (resource.getType() == IResource.FILE) {
355
		if (resource.getType() == IResource.FILE) {
356
			if (resource.isFloating()) {
357
				return FLOATING_FILE_LABEL;
358
			}
354
			if (resource.isLinked()) {
359
			if (resource.isLinked()) {
355
				return LINKED_FILE_LABEL;
360
				return LINKED_FILE_LABEL;
356
			}
361
			}
(-)src/org/eclipse/ui/internal/ide/dialogs/ResourceInfoPage.java (-20 / +55 lines)
Lines 67-72 Link Here
67
 */
67
 */
68
public class ResourceInfoPage extends PropertyPage {
68
public class ResourceInfoPage extends PropertyPage {
69
69
70
	private Button flattenBox;
71
70
	private Button editableBox;
72
	private Button editableBox;
71
73
72
	private Button executableBox;
74
	private Button executableBox;
Lines 86-91 Link Here
86
	private boolean previousArchiveValue;
88
	private boolean previousArchiveValue;
87
89
88
	private boolean previousDerivedValue;
90
	private boolean previousDerivedValue;
91
	
92
	private boolean previousFlattenValue;
89
93
90
	private int previousPermissionsValue;
94
	private int previousPermissionsValue;
91
95
Lines 104-110 Link Here
104
	private static String ARCHIVE = IDEWorkbenchMessages.ResourceInfo_archive;
108
	private static String ARCHIVE = IDEWorkbenchMessages.ResourceInfo_archive;
105
109
106
	private static String DERIVED = IDEWorkbenchMessages.ResourceInfo_derived;
110
	private static String DERIVED = IDEWorkbenchMessages.ResourceInfo_derived;
107
111
	
108
	private static String TYPE_TITLE = IDEWorkbenchMessages.ResourceInfo_type;
112
	private static String TYPE_TITLE = IDEWorkbenchMessages.ResourceInfo_type;
109
113
110
	private static String LOCATION_TITLE = IDEWorkbenchMessages.ResourceInfo_location;
114
	private static String LOCATION_TITLE = IDEWorkbenchMessages.ResourceInfo_location;
Lines 116-121 Link Here
116
	private static String PATH_TITLE = IDEWorkbenchMessages.ResourceInfo_path;
120
	private static String PATH_TITLE = IDEWorkbenchMessages.ResourceInfo_path;
117
121
118
	private static String TIMESTAMP_TITLE = IDEWorkbenchMessages.ResourceInfo_lastModified;
122
	private static String TIMESTAMP_TITLE = IDEWorkbenchMessages.ResourceInfo_lastModified;
123
	
124
	private static String FOLDER_HIERARCHY_TITLE = IDEWorkbenchMessages.ResourceInfo_folderHierarchy;
125
126
	private static String FLATTEN = IDEWorkbenchMessages.ResourceInfo_flatten;
119
127
120
	private static String FILE_ENCODING_TITLE = IDEWorkbenchMessages.WorkbenchPreference_encoding;
128
	private static String FILE_ENCODING_TITLE = IDEWorkbenchMessages.WorkbenchPreference_encoding;
121
129
Lines 196-202 Link Here
196
			Composite locationComposite = new Composite(basicInfoComposite,
204
			Composite locationComposite = new Composite(basicInfoComposite,
197
					SWT.NULL);
205
					SWT.NULL);
198
			layout = new GridLayout();
206
			layout = new GridLayout();
199
			layout.numColumns = 2;
207
			layout.numColumns = resource.isFloating() ? 1:2;
200
			layout.marginWidth = 0;
208
			layout.marginWidth = 0;
201
			layout.marginHeight = 0;
209
			layout.marginHeight = 0;
202
			locationComposite.setLayout(layout);
210
			locationComposite.setLayout(layout);
Lines 221-244 Link Here
221
			locationValue.setBackground(locationValue.getDisplay().getSystemColor(
229
			locationValue.setBackground(locationValue.getDisplay().getSystemColor(
222
					SWT.COLOR_WIDGET_BACKGROUND));
230
					SWT.COLOR_WIDGET_BACKGROUND));
223
231
224
			Button editButton = new Button(locationComposite, SWT.PUSH);
232
			if (!resource.isFloating()) {
225
			editButton.setText(EDIT_TITLE);
233
				Button editButton = new Button(locationComposite, SWT.PUSH);
226
			setButtonLayoutData(editButton);
234
				editButton.setText(EDIT_TITLE);
227
			((GridData) editButton.getLayoutData()).verticalAlignment = SWT.TOP;
235
				setButtonLayoutData(editButton);
228
			int locationValueHeight = locationValue.computeSize(SWT.DEFAULT, SWT.DEFAULT, true).y;
236
				((GridData) editButton.getLayoutData()).verticalAlignment = SWT.TOP;
229
			int editButtonHeight = editButton.computeSize(SWT.DEFAULT, SWT.DEFAULT, true).y;
237
				int locationValueHeight = locationValue.computeSize(SWT.DEFAULT, SWT.DEFAULT, true).y;
230
			int verticalIndent = (editButtonHeight - locationValueHeight) / 2 ;
238
				int editButtonHeight = editButton.computeSize(SWT.DEFAULT, SWT.DEFAULT, true).y;
231
			((GridData) locationTitle.getLayoutData()).verticalIndent = verticalIndent;
239
				int verticalIndent = (editButtonHeight - locationValueHeight) / 2 ;
232
			((GridData) locationValue.getLayoutData()).verticalIndent = verticalIndent;
240
				((GridData) locationTitle.getLayoutData()).verticalIndent = verticalIndent;
233
			editButton.addSelectionListener(new SelectionListener() {
241
				((GridData) locationValue.getLayoutData()).verticalIndent = verticalIndent;
234
				public void widgetDefaultSelected(SelectionEvent e) {
242
				editButton.addSelectionListener(new SelectionListener() {
235
					editLinkLocation();
243
					public void widgetDefaultSelected(SelectionEvent e) {
236
				}
244
						editLinkLocation();
237
245
					}
238
				public void widgetSelected(SelectionEvent e) {
246
	
239
					editLinkLocation();
247
					public void widgetSelected(SelectionEvent e) {
240
				}
248
						editLinkLocation();
241
			});
249
					}
250
				});
251
			}
242
252
243
			// displayed in all cases since the link can be changed to a path variable any time by the user in this dialog
253
			// displayed in all cases since the link can be changed to a path variable any time by the user in this dialog
244
			Label resolvedLocationTitle = new Label(basicInfoComposite,
254
			Label resolvedLocationTitle = new Label(basicInfoComposite,
Lines 311-316 Link Here
311
		timeStampValue.setLayoutData(new GridData(GridData.FILL_HORIZONTAL
321
		timeStampValue.setLayoutData(new GridData(GridData.FILL_HORIZONTAL
312
				| GridData.GRAB_HORIZONTAL));
322
				| GridData.GRAB_HORIZONTAL));
313
323
324
		if (resource instanceof IContainer)
325
		{
326
			Label folderHierarchyLabel = new Label(basicInfoComposite, SWT.NONE);
327
			folderHierarchyLabel.setText(FOLDER_HIERARCHY_TITLE);
328
			
329
			flattenBox = new Button(basicInfoComposite, SWT.CHECK | SWT.RIGHT);
330
			flattenBox.setAlignment(SWT.LEFT);
331
			flattenBox.setText(FLATTEN);
332
			previousFlattenValue = ((IContainer) resource).isFlatten();
333
			flattenBox.setSelection(previousFlattenValue);
334
		}
335
314
		return basicInfoComposite;
336
		return basicInfoComposite;
315
	}
337
	}
316
338
Lines 899-904 Link Here
899
			this.derivedBox.setSelection(false);
921
			this.derivedBox.setSelection(false);
900
		}
922
		}
901
923
924
		if (this.flattenBox != null) {
925
			this.flattenBox.setSelection(false);
926
		}
927
		
902
		if (permissionBoxes != null) {
928
		if (permissionBoxes != null) {
903
			int defaultPermissionValues = getDefaulPermissions(resource.getType() == IResource.FOLDER);
929
			int defaultPermissionValues = getDefaulPermissions(resource.getType() == IResource.FOLDER);
904
			setPermissionsSelection(defaultPermissionValues);
930
			setPermissionsSelection(defaultPermissionValues);
Lines 1000-1005 Link Here
1000
					derivedBox.setSelection(isDerived);
1026
					derivedBox.setSelection(isDerived);
1001
				}
1027
				}
1002
			}
1028
			}
1029
			if (this.flattenBox != null) {
1030
				boolean localFlattenValue = flattenBox.getSelection();
1031
				if (previousFlattenValue != localFlattenValue) {
1032
					((IContainer)resource).setFlatten(localFlattenValue, 0, null);
1033
					boolean isFlatten = ((IContainer)resource).isFlatten();
1034
					previousFlattenValue = isFlatten;
1035
					flattenBox.setSelection(isFlatten);
1036
				}
1037
			}
1003
		} catch (CoreException exception) {
1038
		} catch (CoreException exception) {
1004
			ErrorDialog.openError(getShell(),
1039
			ErrorDialog.openError(getShell(),
1005
					IDEWorkbenchMessages.InternalError, exception
1040
					IDEWorkbenchMessages.InternalError, exception

Return to bug 313691