Author: yradtsevich
Date: 2011-07-04 06:34:40 -0400 (Mon, 04 Jul 2011)
New Revision: 32547
Added:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/preferences/VpeResourcesDialogFactory.java
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe.resref/src/org/jboss/tools/vpe/resref/core/FolderReferenceComposite.java
trunk/vpe/plugins/org.jboss.tools.vpe.resref/src/org/jboss/tools/vpe/resref/core/Messages.java
trunk/vpe/plugins/org.jboss.tools.vpe.resref/src/org/jboss/tools/vpe/resref/core/VpeResourcesDialog.java
trunk/vpe/plugins/org.jboss.tools.vpe.resref/src/org/jboss/tools/vpe/resref/core/messages.properties
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/MozillaEditor.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/handlers/PageDesignOptionsHandler.java
trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/dialog/VpeResourcesDialogTest.java
Log:
https://issues.jboss.org/browse/JBIDE-8719 : Show default root folder in Page Desigh
Options Dialog on top of the Actual Run-Time Folders tab content
- updated actual runtime folders tab in the dialog
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/MozillaEditor.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/MozillaEditor.java 2011-07-04
10:12:01 UTC (rev 32546)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/MozillaEditor.java 2011-07-04
10:34:40 UTC (rev 32547)
@@ -69,6 +69,7 @@
import org.jboss.tools.vpe.editor.mozilla.listener.MozillaResizeListener;
import org.jboss.tools.vpe.editor.mozilla.listener.MozillaTooltipListener;
import org.jboss.tools.vpe.editor.preferences.VpeEditorPreferencesPage;
+import org.jboss.tools.vpe.editor.preferences.VpeResourcesDialogFactory;
import org.jboss.tools.vpe.editor.toolbar.IVpeToolBarManager;
import org.jboss.tools.vpe.editor.toolbar.VpeDropDownMenu;
import org.jboss.tools.vpe.editor.toolbar.VpeToolBarManager;
@@ -78,7 +79,6 @@
import org.jboss.tools.vpe.editor.util.FileUtil;
import org.jboss.tools.vpe.editor.util.HTML;
import org.jboss.tools.vpe.messages.VpeUIMessages;
-import org.jboss.tools.vpe.resref.core.VpeResourcesDialog;
import org.jboss.tools.vpe.xulrunner.XulRunnerException;
import org.jboss.tools.vpe.xulrunner.browser.XulRunnerBrowser;
import org.jboss.tools.vpe.xulrunner.editor.XulRunnerEditor;
@@ -276,26 +276,7 @@
IAction.AS_PUSH_BUTTON) {
@Override
public void run() {
- IEditorInput input = getEditorInput();
- Object fileLocation = null;
- if (input instanceof IFileEditorInput) {
- IFile file = ((IFileEditorInput) input).getFile();
- fileLocation = file;
- } else if (input instanceof ILocationProvider) {
- ILocationProvider provider = (ILocationProvider) input;
- IPath path = provider.getPath(input);
- if (path != null) {
- fileLocation = path;
- }
- }
- if (null != fileLocation) {
- VpeResourcesDialog dialogNew =
- new VpeResourcesDialog(PlatformUI.getWorkbench().getDisplay()
- .getActiveShell(), fileLocation);
- dialogNew.open();
- } else {
- VpePlugin.getDefault().logError(VpeUIMessages.COULD_NOT_OPEN_VPE_RESOURCES_DIALOG);
- }
+ VpeResourcesDialogFactory.openVpeResourcesDialog(getEditorInput());
}
};
showResouceDialogAction.setImageDescriptor(ImageDescriptor.createFromFile(MozillaEditor.class,
Added:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/preferences/VpeResourcesDialogFactory.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/preferences/VpeResourcesDialogFactory.java
(rev 0)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/preferences/VpeResourcesDialogFactory.java 2011-07-04
10:34:40 UTC (rev 32547)
@@ -0,0 +1,52 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2011 Exadel, Inc. and Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.vpe.editor.preferences;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IFileEditorInput;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.editors.text.ILocationProvider;
+import org.jboss.tools.common.resref.core.ResourceReference;
+import org.jboss.tools.vpe.VpePlugin;
+import org.jboss.tools.vpe.editor.util.VpeStyleUtil;
+import org.jboss.tools.vpe.messages.VpeUIMessages;
+import org.jboss.tools.vpe.resref.core.VpeResourcesDialog;
+
+public class VpeResourcesDialogFactory {
+ public static void openVpeResourcesDialog(IEditorInput input) {
+ Object fileLocation = null;
+ if (input instanceof IFileEditorInput) {
+ IFile file = ((IFileEditorInput) input).getFile();
+ fileLocation = file;
+ } else if (input instanceof ILocationProvider) {
+ ILocationProvider provider = (ILocationProvider) input;
+ IPath path = provider.getPath(input);
+ if (path != null) {
+ fileLocation = path;
+ }
+ }
+ if (null != fileLocation) {
+ IPath absoluteDefaultPath = VpeStyleUtil.getRootPath(input);
+ IPath relativeDafaultPath = VpeStyleUtil.getInputParentPath(input);
+ VpeResourcesDialog dialogNew =
+ new VpeResourcesDialog(
+ PlatformUI.getWorkbench().getDisplay().getActiveShell(),
+ fileLocation,
+ new ResourceReference(absoluteDefaultPath != null ?
absoluteDefaultPath.toOSString() : "", ResourceReference.PROJECT_SCOPE),
//$NON-NLS-1$
+ new ResourceReference(relativeDafaultPath != null ?
relativeDafaultPath.toOSString() : "", ResourceReference.FOLDER_SCOPE));
//$NON-NLS-1$
+ dialogNew.open();
+ } else {
+ VpePlugin.getDefault().logError(VpeUIMessages.COULD_NOT_OPEN_VPE_RESOURCES_DIALOG);
+ }
+ }
+}
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/handlers/PageDesignOptionsHandler.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/handlers/PageDesignOptionsHandler.java 2011-07-04
10:12:01 UTC (rev 32546)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/handlers/PageDesignOptionsHandler.java 2011-07-04
10:34:40 UTC (rev 32547)
@@ -23,10 +23,14 @@
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.editors.text.ILocationProvider;
import org.eclipse.ui.handlers.HandlerUtil;
+import org.jboss.tools.common.resref.core.ResourceReference;
import org.jboss.tools.jst.jsp.jspeditor.JSPMultiPageEditor;
import org.jboss.tools.vpe.VpePlugin;
import org.jboss.tools.vpe.editor.VpeController;
+import org.jboss.tools.vpe.editor.mozilla.MozillaEditor;
+import org.jboss.tools.vpe.editor.preferences.VpeResourcesDialogFactory;
import org.jboss.tools.vpe.editor.util.FileUtil;
+import org.jboss.tools.vpe.editor.util.VpeStyleUtil;
import org.jboss.tools.vpe.messages.VpeUIMessages;
import org.jboss.tools.vpe.resref.core.VpeResourcesDialog;
@@ -43,26 +47,8 @@
*/
public Object execute(ExecutionEvent event) throws ExecutionException {
IEditorPart activeEditor = HandlerUtil.getActiveEditorChecked(event);
- IEditorInput input = activeEditor.getEditorInput();
- Object fileLocation = null;
- if (input instanceof IFileEditorInput) {
- IFile file = ((IFileEditorInput) input).getFile();
- fileLocation = file;
- } else if (input instanceof ILocationProvider) {
- ILocationProvider provider = (ILocationProvider) input;
- IPath path = provider.getPath(input);
- if (path != null) {
- fileLocation = path;
- }
- }
- if (null != fileLocation) {
- VpeResourcesDialog dialogNew = new VpeResourcesDialog(PlatformUI
- .getWorkbench().getDisplay().getActiveShell(), fileLocation);
- dialogNew.open();
- } else {
- VpePlugin.getDefault().logError(
- VpeUIMessages.COULD_NOT_OPEN_VPE_RESOURCES_DIALOG);
- }
+ VpeResourcesDialogFactory.openVpeResourcesDialog(activeEditor.getEditorInput());
+
return null;
}
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe.resref/src/org/jboss/tools/vpe/resref/core/FolderReferenceComposite.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe.resref/src/org/jboss/tools/vpe/resref/core/FolderReferenceComposite.java 2011-07-04
10:12:01 UTC (rev 32546)
+++
trunk/vpe/plugins/org.jboss.tools.vpe.resref/src/org/jboss/tools/vpe/resref/core/FolderReferenceComposite.java 2011-07-04
10:34:40 UTC (rev 32547)
@@ -12,6 +12,7 @@
import java.io.File;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.List;
import org.eclipse.core.resources.IFile;
@@ -21,7 +22,6 @@
import org.eclipse.swt.events.ModifyListener;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
@@ -35,41 +35,51 @@
import org.jboss.tools.common.resref.core.ResourceReference;
import org.jboss.tools.common.resref.core.ResourceReferenceList;
-public abstract class FolderReferenceComposite implements ModifyListener {
+public abstract class FolderReferenceComposite {
- private final String BROWSE_BUTTON_NAME = "&Browse...";//$NON-NLS-1$
- private Text text = null;
+ private Text pathText = null;
/*
* Object representing file location.
* Can be IFile or IPath.
*/
Object fileLocation = null;
- ResourceReference[] rs = null;
- ResourceReference current = null;
- private String browseDialogFilterPath = null;
+ private ResourceReference defaultReference;
+ List<ResourceReference> resourceReferences = new
ArrayList<ResourceReference>();
+ private ResourceReference currentReference;
+ private boolean overrideDefaultPath;
+ private Combo scopeCombo = null;
+ private static final String[] scopeNames = { Messages.SCOPE_PAGE_SHORT,
+ Messages.SCOPE_FOLDER_SHORT, Messages.SCOPE_PROJECT_SHORT };
+ private static final int[] scopeValues = { ResourceReference.FILE_SCOPE,
+ ResourceReference.FOLDER_SCOPE, ResourceReference.PROJECT_SCOPE };
+ private Button browseButton;
+ private Button overrideDefaultPathCheckBox;
+ private Label pathLabel;
+ private Label scopeLabel;
+
+
public FolderReferenceComposite() {}
- public void setObject(Object fileLocation) {
+ public void setObject(Object fileLocation, ResourceReference defaultReference) {
+ this.defaultReference = defaultReference;
+
this.fileLocation = fileLocation;
+
if (fileLocation instanceof IFile) {
- browseDialogFilterPath = ((IFile)fileLocation).getProject().getLocation().toString();
+ resourceReferences.addAll(Arrays.asList(getReferenceList().getAllResources((IFile)
fileLocation)));
+ } else if (fileLocation instanceof IPath) {
+ resourceReferences.addAll(Arrays.asList(getReferenceList().getAllResources((IPath)
fileLocation)));
}
- if (null != fileLocation) {
- if (fileLocation instanceof IFile) {
- rs = getReferenceList().getAllResources((IFile) fileLocation);
- } else if (fileLocation instanceof IPath) {
- rs = getReferenceList().getAllResources((IPath) fileLocation);
- }
+
+ if (resourceReferences.size() != 0) {
+ overrideDefaultPath = true;
+ ResourceReference firstReference = resourceReferences.remove(0);
+ currentReference = new ResourceReference(firstReference.getLocation(),
firstReference.getScope());
} else {
- rs = new ResourceReference[0];
+ overrideDefaultPath = false;
+ currentReference = new ResourceReference(defaultReference.getLocation(),
defaultReference.getScope());
}
-
- if(rs.length == 0) {
- rs = new ResourceReference[1];
- rs[0] = new ResourceReference("", ResourceReference.FILE_SCOPE);
//$NON-NLS-1$
- }
- current = rs[0];
}
protected abstract ResourceReferenceList getReferenceList();
@@ -86,40 +96,53 @@
groupControl.setLayoutData(gd);
groupControl.setText(getTitle());
- /*
- * Create label control
- */
- Label pathLabel = new Label(groupControl, SWT.RIGHT);
+
+ overrideDefaultPathCheckBox = new Button(groupControl, SWT.LEFT | SWT.CHECK);
+ overrideDefaultPathCheckBox.setText(Messages.OVERRIDE_DEFAULT_FOLDER);
+ gd = new GridData();
+ gd.horizontalSpan = 3;
+ overrideDefaultPathCheckBox.setLayoutData(gd);
+ overrideDefaultPathCheckBox.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ overrideDefaultPath = overrideDefaultPathCheckBox.getSelection();
+ updateFieldsForOverrideDefaultPath();
+ }
+ });
+ overrideDefaultPathCheckBox.setSelection(overrideDefaultPath);
+
+ pathLabel = new Label(groupControl, SWT.RIGHT);
pathLabel.setText(Messages.FOLDER_PATH);
gd = new GridData();
+ gd.horizontalIndent = 20;
pathLabel.setLayoutData(gd);
/*
* Create text control.
*/
- text = new Text(groupControl, SWT.BORDER);
+ pathText = new Text(groupControl, SWT.BORDER);
/*
* Set location from stored resource reference
* if it presents.
*/
- text.setText(current.getLocation());
+ pathText.setText(currentReference.getLocation());
gd = new GridData(SWT.FILL, SWT.NONE, true, false);
- text.setLayoutData(gd);
- text.addModifyListener(this);
+ pathText.setLayoutData(gd);
+ pathText.addModifyListener(new ModifyListener() {
+ public void modifyText(ModifyEvent e) {
+ currentReference.setLocation(pathText.getText().trim());
+ }
+ });
- /*
- * Create browse control.
- */
- final Button button = new Button(groupControl, SWT.PUSH);
- button.setText(BROWSE_BUTTON_NAME);
+ browseButton = new Button(groupControl, SWT.PUSH);
+ browseButton.setText(Messages.BROWSE_BUTTON_NAME);
gd = new GridData();
- button.setLayoutData(gd);
- button.addSelectionListener(new SelectionAdapter() {
+ browseButton.setLayoutData(gd);
+ browseButton.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent evt) {
- DirectoryDialog dialog = new DirectoryDialog(button.getShell());
+ DirectoryDialog dialog = new DirectoryDialog(browseButton.getShell());
dialog.setMessage(Messages.SELECT_FOLDER_DIALOG_TITLE);
- if ((null != browseDialogFilterPath) && (new
File(browseDialogFilterPath).exists()) ){
- dialog.setFilterPath(browseDialogFilterPath);
+ if (new File(currentReference.getLocation()).exists() ){
+ dialog.setFilterPath(currentReference.getLocation());
}
String newPath = dialog.open();
/*
@@ -127,73 +150,81 @@
* store it to current resref, filter, text field.
*/
if (newPath != null) {
- newPath = newPath.trim();
- browseDialogFilterPath = newPath;
- current.setLocation(newPath);
- text.setText(newPath);
+ currentReference.setLocation(newPath.trim());
+ pathText.setText(currentReference.getLocation());
}
}
});
- /*
- * Create scope label.
- */
- Label comboboxLabel = new Label(groupControl, SWT.RIGHT);
- comboboxLabel.setText(Messages.SCOPE_GROUP_NAME);
+ scopeLabel = new Label(groupControl, SWT.RIGHT);
+ scopeLabel.setText(Messages.SCOPE_GROUP_NAME);
gd = new GridData();
- comboboxLabel.setLayoutData(gd);
+ gd.horizontalIndent = 20;
+ scopeLabel.setLayoutData(gd);
- /*
- * Create scope combobox.
- */
- final Combo scopeCombo
- = new Combo(groupControl, SWT.BORDER | SWT.READ_ONLY);
- String[] items = { Messages.SCOPE_PAGE_SHORT,
- Messages.SCOPE_FOLDER_SHORT, Messages.SCOPE_PROJECT_SHORT };
- scopeCombo.setItems(items);
- scopeCombo.select(current.getScope());
+ scopeCombo = new Combo(groupControl, SWT.BORDER | SWT.READ_ONLY);
+ scopeCombo.setItems(scopeNames);
+ setScopeComboValue(currentReference.getScope());
+
gd = new GridData(SWT.FILL, SWT.NONE, true, false, 2, 1);
scopeCombo.setLayoutData(gd);
scopeCombo.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
- current.setScope(scopeCombo.getSelectionIndex());
+ currentReference.setScope(getScopeComboValue());
}
});
+ updateFieldsForOverrideDefaultPath();
+
return groupControl;
}
public void commit() {
- List l = new ArrayList();
- for (int i = rs.length - 2; i >= 0; i--) {
- if(rs[i].getLocation().equals(current.getLocation())) {
- continue;
+ List<ResourceReference> newResourceReferencesList = new
ArrayList<ResourceReference>();
+ for (int i = resourceReferences.size() - 1; i >= 0; i--) {
+ if(!resourceReferences.get(i).getLocation().equals(currentReference.getLocation())
+ && resourceReferences.get(i).getScope() != currentReference.getScope()) {
+ newResourceReferencesList.add(resourceReferences.get(i));
}
- if(rs[i].getScope() == current.getScope()) {
- continue;
- }
- l.add(rs[i]);
}
- l.add(current);
- rs = (ResourceReference[])l.toArray(new ResourceReference[0]);
- if (null != fileLocation) {
- if (fileLocation instanceof IFile) {
- getReferenceList().setAllResources((IFile) fileLocation, rs);
- } else if (fileLocation instanceof IPath) {
- getReferenceList().setAllResources((IPath) fileLocation, rs);
+ if (overrideDefaultPath) {
+ newResourceReferencesList.add(currentReference);
+ }
+
+ ResourceReference[] newResourceReferences = newResourceReferencesList.toArray(new
ResourceReference[0]);
+ if (fileLocation instanceof IFile) {
+ getReferenceList().setAllResources((IFile) fileLocation, newResourceReferences);
+ } else if (fileLocation instanceof IPath) {
+ getReferenceList().setAllResources((IPath) fileLocation, newResourceReferences);
+ }
+ }
+
+ private int getScopeComboValue() {
+ return scopeValues[scopeCombo.getSelectionIndex()];
+ }
+
+ private void setScopeComboValue(int value) {
+ int i = 0;
+ for (int scopeValue : scopeValues) {
+ if (scopeValue == value) {
+ break;
}
+ i++;
}
+ scopeCombo.select(i);
}
-
- public void setFileLocation(Object fileLocation) {
- this.fileLocation = fileLocation;
+
+ private void updateFieldsForOverrideDefaultPath() {
+ for (Control control : new Control[] {pathLabel, pathText, browseButton,
+ scopeLabel, scopeCombo}) {
+ control.setEnabled(overrideDefaultPath);
+ }
+ if (!overrideDefaultPath) {
+ pathText.setText(defaultReference.getLocation());
+ setScopeComboValue(defaultReference.getScope());
+ }
}
- public void modifyText(ModifyEvent e) {
- browseDialogFilterPath = text.getText().trim();
- current.setLocation(browseDialogFilterPath);
- }
-
-}
\ No newline at end of file
+}
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe.resref/src/org/jboss/tools/vpe/resref/core/Messages.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe.resref/src/org/jboss/tools/vpe/resref/core/Messages.java 2011-07-04
10:12:01 UTC (rev 32546)
+++
trunk/vpe/plugins/org.jboss.tools.vpe.resref/src/org/jboss/tools/vpe/resref/core/Messages.java 2011-07-04
10:34:40 UTC (rev 32547)
@@ -68,6 +68,7 @@
public static String VRD_ADD_EL_PREFERENCE;
public static String VRD_ADD_EL_PREFERENCE_MESSAGE;
public static String ADD_GLOBAL_EL_PREFERENCE_MESSAGE;
+ public static String BROWSE_BUTTON_NAME;
public static String VRD_PAGE_DESIGN_OPTIONS_ABOUT;
public static String VRD_ACTUAL_RUN_TIME_FOLDERS_ABOUT;
@@ -100,4 +101,5 @@
public static String INVALID_EL_EXPRESSION;
public static String CANNOT_PARSE_SCOPE_VALUE;
public static String EL_EXPRESSION_ALREADY_EXISTS;
+ public static String OVERRIDE_DEFAULT_FOLDER;
}
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe.resref/src/org/jboss/tools/vpe/resref/core/VpeResourcesDialog.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe.resref/src/org/jboss/tools/vpe/resref/core/VpeResourcesDialog.java 2011-07-04
10:12:01 UTC (rev 32546)
+++
trunk/vpe/plugins/org.jboss.tools.vpe.resref/src/org/jboss/tools/vpe/resref/core/VpeResourcesDialog.java 2011-07-04
10:34:40 UTC (rev 32547)
@@ -14,6 +14,7 @@
import java.net.URL;
import org.eclipse.core.runtime.FileLocator;
+import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Platform;
import org.eclipse.jface.dialogs.TitleAreaDialog;
import org.eclipse.jface.resource.ImageDescriptor;
@@ -31,6 +32,7 @@
import org.eclipse.swt.widgets.TabItem;
import org.jboss.tools.common.model.ui.ModelUIImages;
import org.jboss.tools.common.model.ui.action.CommandBar;
+import org.jboss.tools.common.resref.core.ResourceReference;
public class VpeResourcesDialog extends TitleAreaDialog {
@@ -46,24 +48,22 @@
private final int DIALOG_HEIGHT = 300;
- public VpeResourcesDialog(Shell parentShell, Object fileLocation) {
+ public VpeResourcesDialog(Shell parentShell, Object fileLocation,
+ ResourceReference defaultAbsReference, ResourceReference defaultRelReference) {
super(parentShell);
setHelpAvailable(false);
+
this.fileLocation = fileLocation;
- init(fileLocation);
- }
-
- private void init(Object fileLocation) {
absFolder = new AbsoluteFolderReferenceComposite();
relFolder = new RelativeFolderReferenceComposite();
css = new CssReferencesComposite();
el = new ElVariablesComposite();
tld = new TaglibReferencesComposite();
css.setObject(fileLocation);
- el.setObject(fileLocation);
- tld.setObject(fileLocation);
- absFolder.setObject(fileLocation);
- relFolder.setObject(fileLocation);
+ el.setObject(fileLocation);
+ tld.setObject(fileLocation);
+ absFolder.setObject(fileLocation, defaultAbsReference);
+ relFolder.setObject(fileLocation, defaultRelReference);
}
@Override
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe.resref/src/org/jboss/tools/vpe/resref/core/messages.properties
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe.resref/src/org/jboss/tools/vpe/resref/core/messages.properties 2011-07-04
10:12:01 UTC (rev 32546)
+++
trunk/vpe/plugins/org.jboss.tools.vpe.resref/src/org/jboss/tools/vpe/resref/core/messages.properties 2011-07-04
10:34:40 UTC (rev 32547)
@@ -51,6 +51,7 @@
VRD_ADD_EL_PREFERENCE=Add EL Reference
VRD_ADD_EL_PREFERENCE_MESSAGE=Add El variable, which will be substituted in a visual part
for generating a preview
ADD_GLOBAL_EL_PREFERENCE_MESSAGE=Add global El variable, which will be substituted in a
visual part for generating a preview
+BROWSE_BUTTON_NAME=&Browse...
GLOBAL_EL_WIZARD_PAGE_NAME=Global EL Page
EL_WIZARD_PAGE_NAME=EL Page
EL_NAME=El Name*
@@ -70,4 +71,5 @@
# CSS Validation
CSS_FILE_DOES_NOT_EXIST=CSS file does not exist.
-CSS_FILE_PATH_SHOULD_BE_SET=CSS file path should be set.
\ No newline at end of file
+CSS_FILE_PATH_SHOULD_BE_SET=CSS file path should be set.
+OVERRIDE_DEFAULT_FOLDER=Override default folder
Modified:
trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/dialog/VpeResourcesDialogTest.java
===================================================================
---
trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/dialog/VpeResourcesDialogTest.java 2011-07-04
10:12:01 UTC (rev 32546)
+++
trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/dialog/VpeResourcesDialogTest.java 2011-07-04
10:34:40 UTC (rev 32547)
@@ -12,8 +12,10 @@
import org.eclipse.core.resources.IFile;
import org.eclipse.jface.window.Window;
import org.eclipse.ui.PlatformUI;
+import org.jboss.tools.common.resref.core.ResourceReference;
import org.jboss.tools.vpe.base.test.TestUtil;
import org.jboss.tools.vpe.base.test.VpeTest;
+import org.jboss.tools.vpe.editor.util.VpeStyleUtil;
import org.jboss.tools.vpe.resref.core.VpeResourcesDialog;
import org.jboss.tools.vpe.ui.test.VpeUiTests;
@@ -33,7 +35,9 @@
+ "; projectName = " + VpeUiTests.IMPORT_PROJECT_NAME, file);
//$NON-NLS-1$
VpeResourcesDialog dialog = new VpeResourcesDialog(PlatformUI
- .getWorkbench().getDisplay().getActiveShell(), file);
+ .getWorkbench().getDisplay().getActiveShell(), file,
+ new ResourceReference("", ResourceReference.PROJECT_SCOPE),
+ new ResourceReference("", ResourceReference.FOLDER_SCOPE));
dialog.setBlockOnOpen(false);
int code = dialog.open();