Skip to content

Commit

Permalink
Updated support info
Browse files Browse the repository at this point in the history
  • Loading branch information
iloveeclipse committed May 30, 2010
1 parent ff3cf4a commit 02a85c0
Show file tree
Hide file tree
Showing 3 changed files with 157 additions and 263 deletions.
84 changes: 33 additions & 51 deletions FileSync/src/de/loskutov/fs/properties/ProjectSyncPropertyPage.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,8 @@
import org.eclipse.core.runtime.preferences.IEclipsePreferences;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.dialogs.DialogPage;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.dialogs.IMessageProvider;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.dialogs.StatusDialog;
import org.eclipse.jface.preference.PreferencePage;
import org.eclipse.jface.viewers.ILabelProvider;
import org.eclipse.jface.viewers.ITreeContentProvider;
Expand All @@ -48,12 +46,12 @@
import org.eclipse.swt.events.KeyEvent;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.DirectoryDialog;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.TabFolder;
import org.eclipse.swt.widgets.TabItem;
import org.eclipse.ui.dialogs.ElementTreeSelectionDialog;
import org.eclipse.ui.dialogs.ISelectionStatusValidator;
import org.eclipse.ui.dialogs.NewFolderDialog;
Expand Down Expand Up @@ -119,7 +117,6 @@ public class ProjectSyncPropertyPage extends PropertyPage implements
private final static int IDX_EDIT = 2;

private final static int IDX_REMOVE = 3;
private final static int IDX_RATE = 15;

private final PathListElementComparator pathComparator;

Expand Down Expand Up @@ -157,10 +154,37 @@ public Object getValue() {
};
}

protected static Composite createContainer(Composite parent) {
Composite composite = new Composite(parent, SWT.NONE);
GridLayout layout = new GridLayout();
layout.marginWidth = 0;
layout.marginHeight = 0;
composite.setLayout(layout);
GridData gridData = new GridData(GridData.VERTICAL_ALIGN_FILL
| GridData.HORIZONTAL_ALIGN_FILL);
gridData.grabExcessHorizontalSpace = true;
composite.setLayoutData(gridData);
return composite;
}

/**
* @see PreferencePage#createContents(Composite)
*/
protected Control createContents(Composite parent) {
TabFolder tabFolder = new TabFolder(parent, SWT.TOP);
tabFolder.setLayout(new GridLayout(1, true));
tabFolder.setLayoutData(new GridData(GridData.FILL_BOTH));

TabItem tabFilter = new TabItem(tabFolder, SWT.NONE);
tabFilter.setText("Source and Target Configuration");

TabItem support = new TabItem(tabFolder, SWT.NONE);
support.setText("Misc...");
Composite supportPanel = createContainer(tabFolder);
support.setControl(supportPanel);
SupportPanel.createSupportLinks(supportPanel);


// ensure the page has no special buttons
noDefaultAndApplyButton();

Expand Down Expand Up @@ -209,9 +233,10 @@ protected Control createContents(Composite parent) {

init(destPath, variables, properties.getMappings());

PixelConverter converter = new PixelConverter(parent);
PixelConverter converter = new PixelConverter(tabFolder);

Composite composite = new Composite(parent, SWT.NONE);
Composite composite = new Composite(tabFolder, SWT.NONE);
tabFilter.setControl(composite);

GridLayout layout = new GridLayout();
layout.marginWidth = 0;
Expand Down Expand Up @@ -276,19 +301,7 @@ public void initSyncPage() {
/* 0 = IDX_ADDEXIST */"&Add Folder...",
/* 1 */null,
/* 2 = IDX_EDIT */"Edit...",
/* 3 = IDX_REMOVE */"Remove",
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
/* 15 == IDX_RATE */ "Rate It!"};
/* 3 = IDX_REMOVE */"Remove"};

foldersList = new TreeListDialogField(adapter, buttonLabels,
new PathListLabelProvider());
Expand Down Expand Up @@ -499,20 +512,9 @@ protected void pathListButtonPressed(DialogField field, int index) {
editEntry();
} else if (index == IDX_REMOVE) {
removeEntry();
} else if (index == IDX_RATE) {
rateIt();
}
}

private void rateIt() {
Dialog dialog = new DialogExtension(getShell());
dialog.setBlockOnOpen(true);
dialog.open();
}

/**
*
*/
private void addEntry() {
List elementsToAdd = new ArrayList(10);
if (hasMembers(project)) {
Expand Down Expand Up @@ -1373,26 +1375,6 @@ private void updateDefaultDestinationPathStatus() {
destFolderStatus.setOK();
}

private static final class DialogExtension extends StatusDialog {
private DialogExtension(Shell parentShell) {
super(parentShell);
setShellStyle(getShellStyle() | SWT.RESIZE);
setTitle("Rate FileSync on www.eclipseplugincentral.com");
}

protected Control createDialogArea(Composite parent) {
Composite dialogArea2 = (Composite) super.createDialogArea(parent);
RateIt.createTextArea(dialogArea2);
return dialogArea2;
}

protected Button createButton(Composite parent, int id, String label, boolean defaultButton) {
if(id == IDialogConstants.OK_ID){
return null;
}
return super.createButton(parent, id, label, defaultButton);
}
}

class PathContainerAdapter implements ITreeListAdapter, IDialogFieldListener {

Expand Down
212 changes: 0 additions & 212 deletions FileSync/src/de/loskutov/fs/properties/RateIt.java

This file was deleted.

Loading

0 comments on commit 02a85c0

Please sign in to comment.